You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Peter Henderson <pe...@starjar.com> on 2007/04/04 17:56:24 UTC

wsdl2java when wsdl is on https and password protected.

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:password@peter-laptop: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?)



peter@peter-laptop:~/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.


RE: wsdl2java when wsdl is on https and password protected.

Posted by Jim Ma <ji...@iona.com>.
How about add a  method tryFromProxy()  in URIResolver ?
Tools or DynamicClientFactory can all get wsdl or other resource by
URIResolver.

Regards

Jim

> -----Original Message-----
> From: Dan Diephouse [mailto:dan@envoisolutions.com]
> Sent: Thursday, April 05, 2007 10:52 AM
> To: cxf-user@incubator.apache.org
> Subject: Re: wsdl2java when wsdl is on https and password protected.
>
>
> Where do you think the appropriate place to add this would be?
>
> Guillaume Alleon who is working on the Groovy Web Services
> support which use
> the CXF DynamicClientFactory has been bugging me about this too.
> He is just
> passing in a URL to the DCF. Is it possible to register a
> URLConnectionFactory that can handle proxies? Or do we need to add support
> for this somewhere else? Any ideas welcome :-)
>
> Thanks,
> - Dan
>
> On 4/4/07, James Mao <ja...@iona.com> wrote:
> >
> > Hi,
> >
> > Sorry, we do not support this yet, please add this to wish list on [1]
> >
> > Cheers,
> > James.
> > [1] https://issues.apache.org/jira/browse/CXF
> >
> > > 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:password@peter-laptop: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?)
> > >
> > >
> > >
> > > peter@peter-laptop:~/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/InsuranceBroke
> rBean.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/InsuranceBroke
> rBean.wsdl
> > >
> > > wsdl2java - 2.0-incubator-M1
> > >
> > > Error : Fail to create wsdl definition
> > >
> >
> file:/home/peter/work/test/webservice3/WebService3Client/Insurance
> BrokerBean.wsdl
> > >
> > >
> > > org.apache.cxf.tools.common.ToolException: Fail to create wsdl
> > > definition
> > >
> >
> file:/home/peter/work/test/webservice3/WebService3Client/Insurance
> BrokerBean.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.
> > >
> > >
> >
> >
>
>
> --
> Dan Diephouse
> Envoi Solutions
> http://envoisolutions.com | http://netzooid.com/blog
>


Re: wsdl2java when wsdl is on https and password protected.

Posted by Dan Diephouse <da...@envoisolutions.com>.
Where do you think the appropriate place to add this would be?

Guillaume Alleon who is working on the Groovy Web Services support which use
the CXF DynamicClientFactory has been bugging me about this too. He is just
passing in a URL to the DCF. Is it possible to register a
URLConnectionFactory that can handle proxies? Or do we need to add support
for this somewhere else? Any ideas welcome :-)

Thanks,
- Dan

On 4/4/07, James Mao <ja...@iona.com> wrote:
>
> Hi,
>
> Sorry, we do not support this yet, please add this to wish list on [1]
>
> Cheers,
> James.
> [1] https://issues.apache.org/jira/browse/CXF
>
> > 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:password@peter-laptop: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?)
> >
> >
> >
> > peter@peter-laptop:~/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.
> >
> >
>
>


-- 
Dan Diephouse
Envoi Solutions
http://envoisolutions.com | http://netzooid.com/blog

Re: wsdl2java when wsdl is on https and password protected.

Posted by James Mao <ja...@iona.com>.
Hi,

Sorry, we do not support this yet, please add this to wish list on [1]

Cheers,
James.
[1] https://issues.apache.org/jira/browse/CXF

> 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:password@peter-laptop: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?)
>
>
>
> peter@peter-laptop:~/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.
>
>


Re: wsdl2java when wsdl is on https and password protected.

Posted by Peter Henderson <pe...@starjar.com>.
Thanks for helping ;-)
All responses help me learn more.


Thanks
Peter Henderson


Fred Dushin wrote:
> 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, 
Yes I'd like to access a secured service over https with 'basic' 
authentication.


or are you trying to generate code to write a
> secure application?  
Also yes.
The server is an EJB3 application that i'd like to make available via a 
web service. I would like to ensure :
1) all access is over a SSL type connection (at the moment I am using 
self signed certificates so I'll need to add the server public keys to 
the clients keystore)
2) If possible user/password authentication is used (and propagated to 
the the EJB)

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:password@peter-laptop: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? 
The file is attached.

If you need the EJB3 application I can send that also, as it is a very 
simple stateless session bean annotated with @WebService then deployed 
on glassfish.

> 
> 
> Sorry I can't be of more help,
You have helped already, for which I thank you ;-)


> -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:password@peter-laptop: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?)
>>
>>
>>
>> peter@peter-laptop:~/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.
>>
>>
> 
> 


Re: wsdl2java when wsdl is on https and password protected.

Posted by Fred Dushin <fr...@dushin.net>.
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:password@peter-laptop: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:password@peter-laptop: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?)
>
>
>
> peter@peter-laptop:~/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.
>
>