Sorry, thought I'd included the stack trace initially. The
-noAddressBinding allows wsdl2java to finish successfully, but looks
like it breaks things. At the very least the existing code doesn't work
and like you say I've got a workaround with replacing the Addressing
schema.
Thanks,
Nate
[java] Loading FrontEnd jaxws ...
[java] Loading DataBinding jaxb ...
[java] wsdl2java -client -d src -verbose http://hostname/WSDL?wsdl
[java] wsdl2java - Apache CXF 2.2.4
[java] WSDLToJava Error: Thrown by JAXB : SCD "wsa:From" didnt
match any schema component at line 32 column 28 of schema
jar:file:/C:/Documents%20and%20Settings/nate/Desktop/apache-cxf-2.2.4/li
b/cxf-2.2.4.jar!/org/apache/cxf/tools/wsdlto/databinding/jaxb/W3CEPRJaxb
Binding.xml
[java] org.apache.cxf.tools.common.ToolException: Thrown by JAXB :
SCD "wsa:From" didnt match any schema component at line 32 column 28 of
schema
jar:file:/C:/Documents%20and%20Settings/nate/Desktop/apache-cxf-2.2.4/li
b/cxf-2.2.4.jar!/org/apache/cxf/tools/wsdlto/databinding/jaxb/W3CEPRJaxb
Binding.xml
[java] at
org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBBindErrorListener.error
(JAXBBindErrorListener.java:35)
[java] at
com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.error(SchemaCompilerIm
pl.java:286)
[java] at
com.sun.tools.xjc.util.ErrorReceiverFilter.error(ErrorReceiverFilter.jav
a:77)
[java] at
com.sun.tools.xjc.reader.internalizer.SCDBasedBindingSet.reportError(SCD
BasedBindingSet.java:255)
[java] at
com.sun.tools.xjc.reader.internalizer.SCDBasedBindingSet.reportError(SCD
BasedBindingSet.java:246)
[java] at
com.sun.tools.xjc.reader.internalizer.SCDBasedBindingSet.access$100(SCDB
asedBindingSet.java:74)
[java] at
com.sun.tools.xjc.reader.internalizer.SCDBasedBindingSet$Target.apply(SC
DBasedBindingSet.java:154)
[java] at
com.sun.tools.xjc.reader.internalizer.SCDBasedBindingSet$Target.applyAll
(SCDBasedBindingSet.java:138)
[java] at
com.sun.tools.xjc.reader.internalizer.SCDBasedBindingSet$Target.apply(SC
DBasedBindingSet.java:159)
[java] at
com.sun.tools.xjc.reader.internalizer.SCDBasedBindingSet$Target.applyAll
(SCDBasedBindingSet.java:138)
[java] at
com.sun.tools.xjc.reader.internalizer.SCDBasedBindingSet$Target.access$7
00(SCDBasedBindingSet.java:82)
[java] at
com.sun.tools.xjc.reader.internalizer.SCDBasedBindingSet.apply(SCDBasedB
indingSet.java:237)
[java] at
com.sun.tools.xjc.ModelLoader.createXSOM(ModelLoader.java:522)
[java] at
com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImp
l.java:236)
[java] at
com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImp
l.java:85)
[java] at
org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize(
JAXBDataBinding.java:328)
[java] at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJava
Container.java:568)
[java] at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaCo
ntainer.java:219)
[java] at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContai
ner.java:127)
[java] at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContai
ner.java:263)
[java] at
org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:
103)
[java] at
org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
[java] at
org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
[java] at
org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:184)
[java] Caused by: com.sun.istack.SAXParseException2: SCD "wsa:From"
didnt match any schema component
[java] at
com.sun.tools.xjc.reader.internalizer.SCDBasedBindingSet.reportError(SCD
BasedBindingSet.java:252)
[java] ... 20 more
-----Original Message-----
From: Daniel Kulp [mailto:[email protected]]
Sent: Tuesday, October 27, 2009 2:27 PM
To: [email protected]
Cc: Nate Woody
Subject: Re: WSDLToJava Error
It's possible that the modified schema is causing issues. What's the
stack
trace if you run wsdl2java with -v?
Also, you can try adding: -noAddressBinding to wsdl2java to turn off the
internal mapping of the ws-addressing schema into
javax.xml.ws.wsaddressing
types. It would actually generate types for stuff in the schema which
may or
may not be appropriate for what you need to accomplish, but worth a
shot.
That said, using a catalog or something to map that schemaLocation to a
local
xsd is probably the best option.
Dan
On Tue October 27 2009 9:19:43 am Nate Woody wrote:
> I maintain a CXF-interface to Microsofts HPC2008 webservice (meaning
the
> WSDL exists in the wild), which we recently upgraded and I'm unable to
> build stubs off of the WSDL anymore. I've tried wsdltojava from 2.3
and
> 2.4, but I get the same error. It's a WS-Addressing error of some
> sort, but I'm not sure if it's a CXF bug. The WSDL provides an import
> for WS-A:
>
> <xsd:import
>
> schemaLocation="http://hostname/WSDL?xsd=xsd5"
>
>
namespace="http://www.w3.org/2005/08/addressing"
> />
>
>
>
> Which refers to a partial schema I've pasted at the bottom of the
email.
> If I change that import to point to a local ws-addr.xsd taken from the
> W3 site then the service builds and works OK. The provided schema is
> missing these entries, which I suspect is what breaks things.
>
>
>
> <xs:element name="ReplyTo" type="tns:EndpointReferenceType"/>
>
> <xs:element name="From" type="tns:EndpointReferenceType"/>
>
> <xs:element name="FaultTo" type="tns:EndpointReferenceType"/>
>
> <xs:element name="To" type="tns:AttributedURIType"/>
>
> <xs:element name="Action" type="tns:AttributedURIType"/>
>
>
>
> I can provide a test case and put in a JIRA ticket if the dev's think
> this is a CXF bug.
>
>
>
> Thanks,
>
> Nate
>
>
>
>
>
> Partial WS-A schema:
>
>
>
> <xs:schema elementFormDefault="qualified"
> targetNamespace="http://www.w3.org/2005/08/addressing">
>
> <xs:complexType name="EndpointReferenceType">
>
> <xs:sequence>
>
> <xs:element minOccurs="0" maxOccurs="1" name="Address"
> type="tns:AttributedURIType"/>
>
> <xs:element minOccurs="0" maxOccurs="1" name="ReferenceParameters"
> type="tns:ReferenceParametersType"/>
>
> <xs:element minOccurs="0" maxOccurs="1" name="Metadata"
> type="tns:MetadataType"/>
>
> <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
>
> </xs:sequence>
>
> <xs:anyAttribute/>
>
> </xs:complexType>
>
> <xs:complexType name="AttributedURIType">
>
> <xs:simpleContent>
>
> <xs:extension base="xs:anyURI">
>
> <xs:anyAttribute/>
>
> </xs:extension>
>
> </xs:simpleContent>
>
> </xs:complexType>
>
> <xs:complexType name="ReferenceParametersType">
>
> <xs:sequence>
>
> <xs:any minOccurs="0" maxOccurs="unbounded"/>
>
> </xs:sequence>
>
> <xs:anyAttribute/>
>
> </xs:complexType>
>
> <xs:complexType name="MetadataType">
>
> <xs:sequence>
>
> <xs:any minOccurs="0" maxOccurs="unbounded"/>
>
> </xs:sequence>
>
> <xs:anyAttribute/>
>
> </xs:complexType>
>
> </xs:schema>
>
--
Daniel Kulp
[email protected]
http://www.dankulp.com/blog