Hi,

I searched the archives, and couldn't find any info on this.  I'm far from an 
expert with web services, so I hope this isn't a dumb question, but even if it 
is, any help would be appreciated.

I am trying to generate Java code using CXF to work with a third-party tool 
which they provide as a web service.  I have attached the WSDL for their 
service to this message.  When I try to run the wsdl2java tool on it (using 
either CXF 2.0.5, which we've used before, and currently use for one other 
project, or with 2.2.3, which I downloaded when I started having problems), I 
get a NullPointerException with no useful error message:

jrob...@yggdrasil,11:10am,[~/tmp/newcxf/apache-cxf-2.2.3/bin]% ./wsdl2java -d 
/tmp/harcourt -client -verbose /tmp/harcourt/HarcourtWS.wsdl
Loading FrontEnd jaxws ...
Loading DataBinding jaxb ...
wsdl2java -d /tmp/harcourt -client -verbose /tmp/harcourt/HarcourtWS.wsdl
wsdl2java - Apache CXF 2.2.3


WSDLToJava Error: java.lang.NullPointerException

org.apache.cxf.tools.common.ToolException: java.lang.NullPointerException
        at 
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:271)
        at 
org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
        at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
        at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
        at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:184)
Caused by: java.lang.NullPointerException
        at 
org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.FaultProcessor.processFault(FaultProcessor.java:96)
        at 
org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.FaultProcessor.process(FaultProcessor.java:54)
        at 
org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.OperationProcessor.process(OperationProcessor.java:66)
        at 
org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.PortTypeProcessor.process(PortTypeProcessor.java:143)
        at 
org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.WSDLToJavaProcessor.wsdlDefinitionToJavaModel(WSDLToJavaProcessor.java:88)
        at 
org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.WSDLToJavaProcessor.process(WSDLToJavaProcessor.java:60)
        at 
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:229)
        at 
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:127)
        at 
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:263)
        ... 4 more


There is no indication here as to what the problem is, and searching the web 
and the us...@cxf archives, I don't find anything that seems related to this 
error.

When I try running with -validate to see if the WSDL is valid, it gives me the 
following error:

jrob...@yggdrasil,11:17am,[~/tmp/newcxf/apache-cxf-2.2.3/bin]% ./wsdl2java -d 
/tmp/harcourt -validate -verbose /tmp/harcourt/HarcourtWS.wsdl
Loading FrontEnd jaxws ...
Loading DataBinding jaxb ...
wsdl2java -d /tmp/harcourt -validate -verbose /tmp/harcourt/HarcourtWS.wsdl
wsdl2java - Apache CXF 2.2.3


WSDLToJava Error: WSI-BP-1.0 R2205 violation: In Message SubmitRequestFault, 
part ExceptionId must specify a 'element' attribute



org.apache.cxf.tools.common.ToolException: WSI-BP-1.0 R2205 violation: In 
Message SubmitRequestFault, part ExceptionId must specify a 'element' attribute


        at 
org.apache.cxf.tools.validator.internal.WSDL11Validator.isValid(WSDL11Validator.java:140)
        at 
org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:201)
        at 
org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:61)
        at 
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:166)
        at 
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:127)
        at 
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:263)
        at 
org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
        at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
        at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
        at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:184)


So it seems like there is an issue with conforming to the WS-I Basic Profile.  
However, I was under the impression that conforming to the BP was optional, and 
that a WSDL can still be valid even if it does not conform.  I am sort of 
assuming that CXF is providing this message as informational, rather than as a 
requirement, but I don't know.  Is it possible that this violation is what's 
causing the NullPointerException?  And since this WSDL seems to be valid WSDL, 
even if it doesn't conform to the Basic Profile (it passes the validation at 
http://www.validwsdl.com/, for example), is there a way to get CXF not to 
require that it conform, and still generate Java client code?  Since this is a 
third-party tool, we don't have the option of changing the WSDL or the service, 
so I'm hoping I can find a way to make this work.

Thank you in advance for any help or advice you can offer.




Joe Robins
Director, Systems & Software Development
Teach For America
Email: [email protected]
Phone: 212-279-2080, x368

One day, all children in this nation will have the opportunity to attain an 
excellent education.
http://www.teachforamerica.org/




____________________________________________
This communication and any file transmitted with it may contain information 
that is confidential, privileged and exempt from disclosure under applicable 
law. It is intended solely for the use of the individual or entity to which it 
is addressed. If you are not the intended recipient, you are hereby notified 
that any use, dissemination or copying of this communication is strictly 
prohibited. If you have received this communication in error, please notify the 
sender. Thank you for your cooperation.

Reply via email to