I have some questions about client stub generation via ssl and also confguring
the
conduit programmatically.
I'm using CXF 2.0.6 with jdk1.6 and tomcat 6.0.14
I'm trying to get SSL working on it so I've created a simple test for myself.
I have a HelloWorldService running on port 8085 over http.
I've setup tomcat to also run ssl (with a self signed certificate) on port 8086
over
https. I've gone to the url with my browser and checked and verified that 8086
is
running properly as I'd expect it.
I've tested my client stub generation as well as a test client on port 8085
http so
I know it all works.
First problem is, I'd like to turn off http completely so client stub
generation via
HTTPS doesn't seem to work for me and or I can't find any documentation on how
to do
it. I normally generate my client stubs via
java -classpath ${CLASSPATH} org.apache.cxf.tools.wsdlto.WSDLToJava -client
-p
com.foo.client -d src/examples/java
http://127.0.0.1:8085/foo/ws/HelloWorldService?wsdl
When I change the location to https and port 8086, it doesn't seem to work. Is
this
suppose to work? or do all client stub generations have to happen via http?
My second problem is the programmtic conduit configuration seems a little
confusing
or non functional. After generating the client stubs via http, I tried to run
my
client over https and it fails
javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem
parsing
'https://127.0.0.1:8086/foo/ws/HelloWorldService?wsdl'.:
javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorException:
PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target
My test client code is very very simple (and use to work before I tried to
change
it to https):
public static void main(String... argv) throws Exception
{
URL url = new
URL("https://127.0.0.1:8086/foo/ws/HelloWorldService?wsdl");
HelloWorldWsService service=new HelloWorldWsService(url);
// HelloWorldWsService service=new HelloWorldWsService();
HelloWorldWs helloWorld=service.getHelloWorldWsPort();
Client cxfClient = ClientProxy.getClient(helloWorld);
HTTPConduit http = (HTTPConduit) cxfClient.getConduit();
System.err.println(helloWorld.helloWorld());
System.err.println(helloWorld.helloWorld2("foo"));
}
Can anyone shed some light on why this doesn't work? I'm fairly sure the server
is
fine because it works via a browser.
thanks.
--
Ted Leung
[EMAIL PROTECTED]
The world is spinning too fast, it's making me dizzy.