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 10:35:58 +0800

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?



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"


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"

  <display-name>Hello World Application</display-name>
  <description>A Java application containing a simple JAX-RPC endpoint</description>


      <description>Endpoint for Hello Service</description>




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=""

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());

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