I'm puzzled about what you are trying to do.

Are you trying to generate Java types from WSDL that's housed on a "secure" HTTP/S URL, or are you trying to generate code to write a secure application? My guess is the former, and I am afraid I can't answer that question, though I would say in general that whatever service is running at https://user:[EMAIL PROTECTED]:8181/ InsuranceBrokerBeanService/InsuranceBrokerBean?wsdl should at a minimum require that you specify a trust store against which to validate any received X.509 certificates sent by the server as part of the SSL handshake. I believe that in the client case, there may also be a fallback on your ~/.keystore, so you might be able to configure that to include trusted CAs that will work in your case, but in general I would not recommend doing this, for what should be obvious security reasons.

As far as the second error you had, when you ended up downloading the WSDL, perhaps you could send the contents of /home/peter/work/test/ webservice3/WebService3Client/InsuranceBrokerBean.wsdl?

Sorry I can't be of more help,
-Fred

On Apr 4, 2007, at 11:56 AM, Peter Henderson wrote:

Hi List.

I'm new here and new to web services.

I have created a very simple web service using Glassfish and @Webservice annotations on a stateless session bean, which I can call using CXF.

I'd like to do something very similar but with the web service requiring transport security and authentication, so https and username/password.


Should wsdl2java be able to support this? Do web services work this way?





What I've tried so far with no success.



/home/peter/downloads/java/apache-cxf/cxf-2.0-incubator-M1/bin/ wsdl2java -verbose -ant -client -d clientdirInsurance/ https:// user:[EMAIL PROTECTED]:8181/InsuranceBrokerBeanService/ InsuranceBrokerBean?wsdl

Which moans about keystore and truststores, so rather than supply a whole bunch of -Djavax.net.ssl.keyStore=blah settings I though I'll download and save the WSDL locally.
(should username/password be optional arguments to wsdl2java?)



[EMAIL PROTECTED]:~/work/play/Tests/cxf$ /home/peter/downloads/ java/apache-cxf/cxf-2.0-incubator-M1/bin/wsdl2java -verbose -ant - client -d clientdirInsurance/ /home/peter/work/test/webservice3/ WebService3Client/InsuranceBrokerBean.wsdl /home/peter/downloads/java/apache-cxf/cxf-2.0-incubator-M1/bin/ wsdl2java wsdl2java -verbose -ant -client -d clientdirInsurance/ /home/peter/ work/test/webservice3/WebService3Client/InsuranceBrokerBean.wsdl
wsdl2java - 2.0-incubator-M1

Error : Fail to create wsdl definition file:/home/peter/work/test/ webservice3/WebService3Client/InsuranceBrokerBean.wsdl

org.apache.cxf.tools.common.ToolException: Fail to create wsdl definition file:/home/peter/work/test/webservice3/WebService3Client/ InsuranceBrokerBean.wsdl at org.apache.cxf.tools.wsdl2java.processor.WSDLToProcessor.parseWSDL (WSDLToProcessor.java:165) at org.apache.cxf.tools.wsdl2java.processor.WSDLToProcessor.init (WSDLToProcessor.java:360) at org.apache.cxf.tools.wsdl2java.processor.WSDLToJavaProcessor.process (WSDLToJavaProcessor.java:54) at org.apache.cxf.tools.wsdl2java.WSDLToJava.execute (WSDLToJava.java:85) at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool (ToolRunner.java:69) at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool (ToolRunner.java:38) at org.apache.cxf.tools.wsdl2java.WSDLToJava.main (WSDLToJava.java:218)
Caused by: java.lang.NullPointerException
        at java.util.Hashtable.get(Hashtable.java:334)
        at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at org.apache.cxf.tools.wsdl2java.processor.WSDLToProcessor.parseWSDL (WSDLToProcessor.java:157)
        ... 6 more




Many thanks

Peter Henderson.



Reply via email to