Yea, this seems to be a common issue with JAXB. :-( The ONLY workaround I've seen is to copy the wsdl locally and either add an import for the schema namespace or to convert the:
<xsd:element ref="xsd:schema"/> <xsd:any/> to: <xsd:any maxOccurs="2"/> or similar and then use the local wsdl. :-( Dan On Saturday 20 September 2008 11:09:36 am Jay Guidos wrote: > Hi All, > > > > I am returning to web service programming after several years of other > tasks.It's kind of rusty but coming back to me! Anyway I have what > seems to be a fairly well known problem, in that I need to consume a web > service that is giving out .NET un-typed DataSets in a document/literal > service. > > > > I tried running wsdl2java -client on a wsdl that had the following type > for an output response: > > > > <xsd:element name="GetBlotterResponse"> > > <xsd:complexType> > > <xsd:sequence> > > <xsd:element minOccurs="0" > name="GetBlotterResult" nillable="true"> > > <xsd:complexType> > > <xsd:annotation> > > <xsd:appinfo> > > <ActualType Name="DataSet" > > > Namespace="http://schemas.datacontract.org/2004/07/System.Data" > > > xmlns="http://schemas.microsoft.com/2003/10/Serialization/"/> > > </xsd:appinfo> > > </xsd:annotation> > > <xsd:sequence> > > <xsd:element ref="xsd:schema"/> > > <xsd:any/> > > </xsd:sequence> > > </xsd:complexType> > > </xsd:element> > > </xsd:sequence> > > </xsd:complexType> > > </xsd:element> > > > > The offending line seems to be: > > > > <xsd:element ref="xsd:schema"/> > > > > This causes wsdl2java to die with the following error: > > > > WSDLToJava Error: Thrown by JAXB : undefined element declaration > 'xsd:schema' > > > > As others have lamented, the above WSDL is reported as valid by the 3 > WSDL validators I have washed it through, but there does not seem to be > anyone who supports this kind of dynamically typed responses except > .NET. I have tried Glassfish, JWSDP 2.0, Axis 2 and now CFX in both > JAX-RPC and JAX-WS approaches and all are a no-go. I would like to stay > with CFX because your stuff seems to work beautifully with groovy, my > new favourite language. > > > > So, since I don't have the luxury of getting this service changed, what > are my options? Suggestions, anyone? > > > > Jay Guidos > > Dark Technologies -- Daniel Kulp [EMAIL PROTECTED] http://www.dankulp.com/blog
