RE: jaxrpc with https

From: Potter, Brian L <>
Date: Tue, 12 Oct 2004 10:43:21 -0500

i'm running on Windows XP (version 5.1).
i left out one possibly important detail; my client is based on the
dynamicproxy example instead of the staticstub example (like
mutualauthclient). i'm not sure if that's important. here's a revised (originally from the mutualauthclient example, modified to
use a dynamic proxy). it fails with the same error as my client
( HTTPS host name wrong: should be <localhost>).
package mutualauthclient;
import javax.xml.rpc.Stub;
import javax.xml.rpc.Service;
import javax.xml.rpc.JAXRPCException;
import javax.xml.namespace.QName;
import javax.xml.rpc.ServiceFactory;
import com.edms.utils.*;
public class HelloClient {
    public static void main(String[] args) {
        if (args.length != 5) {
            System.out.println("5 command-line parms required");
        String keyStore = args[0];
        String keyStorePassword = args[1];
        String trustStore = args[2];
        String trustStorePassword = args[3];
        String endpointAddress = args[4];
        System.out.println("keystore: '" + keyStore + "'");
        System.out.println("keystorePassword: '" + keyStorePassword + "'");
        System.out.println("trustStore: '" + trustStore + "'");
        System.out.println("trustStorePassword: '" + trustStorePassword +
        System.out.println("Endpoint address = '" + endpointAddress + "'");
        try {
            System.setProperty("", keyStore);
            System.setProperty("", trustStore);
   URL loginWsdlUrl = new URL (endpointAddress + "?WSDL");
   ServiceFactory serviceFactory = ServiceFactory.newInstance();
   String nameSpaceUri = "urn:foo";
   String serviceName = "MySecureHelloService";
   String portName = "HelloIFPort";
   Service hello = serviceFactory.createService(loginWsdlUrl, new
QName(nameSpaceUri, serviceName));
   HelloIF helloIF = (HelloIF) hello.getPort(new QName(nameSpaceUri,
            System.out.println(helloIF.sayHello(" Duke (secure)"));
        } catch (Exception ex) {
    private static Stub createProxy() {
        return (Stub) (new MySecureHelloService_Impl().getHelloIFPort());

-----Original Message-----
From: kathy walsh [mailto:Kathleen.Walsh_at_Sun.COM]
Sent: Tuesday, October 12, 2004 10:10 AM
Subject: Re: jaxrpc with https

what platform, oOS are you running on?

kathy walsh wrote:

Can you send me a sample service
and client that reproduces this problem-
ie, something I can drop into J2EE 1.4, deploy and run?
I will try to reproduce the problem and see if I can find
out the problem you are having-

Potter, Brian L wrote:

i've written a J2EE 1.4 JAXRPC web service that works great using http and
port 8080. but when i try to call it using https and port 1043, i get:
Client exception: modeler error: failed to parse document at "
https://localhost:1043/procnetService/procnetService?WSDL": HTTPS host name wrong: should be <localhost>
looks like the client cert's hostname is incorrect, but the sample
(security/mutualauth and security/mutualauthclient) works fine using the
same keystore and truststore. i'm using the ones delivered in

Brian L. Potter
Software Scientist
Solutions Group
Intergraph Corporation (NASDAQ:INGR)
170 Graphics Drive, Madison, AL 35758
P 1.256.730.8219 F 1.256.730.7514 <> < <> >, <>