Re: Java application trying to connect to remote web service via SSL

From: Kwan Hon Luen <hon_luen_at_YAHOO.COM>
Date: Wed, 30 Oct 2002 17:20:20 +0800

The tutorial example uses Apache ANT. But I am trying to just use xrpcc for both web service and client, which is okay for non-SSL. I am trying to find out the correct steps for SSL. Does anyone know that?

  ----- Original Message -----
  From: Harvinder Singh
  Sent: Wednesday, October 30, 2002 5:09 PM
  Subject: Re: Java application trying to connect to remote web service via SSL

  If you follow the instructions given in Tutorial (Security for JAX-RPC ) ..step by step it will work..

  You need to give the path of the certificate through Tomact Admin interface.

  It worked for me..should work for you also..



  Kwan Hon Luen wrote:

    Hi all, I have a problem here:A java client application (not a servlet, just pure console) trying to connect to remote web service via SSL. I can just this java console client to connect via non-SSL port. What modification do I have to make to both the web service and the client, in order to connect via SSL? I have checked out the Sun web service tutorial, but not relevant, since I am using a java console client here, and not a servlet. Can someone help? ~honluen
    On the web service machine, This is the config.xml which I use xrpcc to build the web service. <?xml version="1.0" encoding="UTF-8"?>
    <configuration xmlns=""> <service name="HelloService"
     packageName="hello"> <interface
    </configuration> This is the web.xml which I use to deploy the web service on tomcat server. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app
        PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        ""> <web-app>
      <display-name>Hello World Application</display-name>
      <description>A Java application containing a simple JAX-RPC endpoint</description>
      </session-config> <security-constraint>
      </login-config> <servlet>
          <description>Endpoint for Hello Service</description>
      </servlet> <servlet-mapping>
      </servlet-mapping> <session-config>
     On the client machine, This is the config.xml which i use xrpcc to generate the client stubs. Is there any wrong here? since I should be accessing via, but that gives me errors. <?xml version="1.0" encoding="UTF-8"?>
      <wsdl location=""
    </configuration>This is the client code, which I suspect is not very correct. package hello; import javax.xml.rpc.Stub; public class HelloClient {
        public static void main(String[] args) { String trustStore = "f:/SSL/client.keystore";
            String trustStorePassword = "12345678";
            String username = "honluen";
            String password = "12345678";
      try {
                HelloIF_Stub stub = (HelloIF_Stub)(new HelloService_Impl().getHelloIFPort()); System.setProperty("",

        HelloIF_Stub hello = (HelloIF_Stub)stub;
            } catch (Exception ex) {


  Dr. Harvinder Singh
  SeE Consulting {P} Ltd.
  Ph.No: 91-11-6163260
  Hp:(91) 9810381470