Hi Julio, I believe I fixed this yesterday as part of CXF-811. Could you try a SNAPSHOT build?
http://incubator.apache.org/cxf/download.html The fixes will be part of our 2.0.1 release. Thanks, - Dan On 7/19/07, Julio Arias <[EMAIL PROTECTED]> wrote:
Hi Jim - I partially fix this, I change the data binding to Aegis (now the map has a type in the WSDL) but now I get a different problem with wsdl2java The WSDL looks very similar at the one generated by xFire I think there is a problem with the WSDL namespaces but I'm not sure what. This is the WSDL: <?xml version="1.0" encoding="utf-8"?> <wsdl:definitions name="MetadataService" targetNamespace="http:// lor.rbx.com/ws/metadata" xmlns:ns1="http://lor.rbx.com/ws/metadata" xmlns:ns2="urn:com:rbx:lor:ws:model" xmlns:ns3="http://util.java" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http:// schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <wsdl:types> <schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http:// metadata.core.lor.rbx.com" xmlns="http://www.w3.org/2001/XMLSchema"> <simpleType name="DocumentLanguage"> <restriction base="string"> <enumeration value="Any"/> <enumeration value="English"/> </restriction> </simpleType> <simpleType name="DocumentDegreeInteractivity"> <restriction base="string"> <enumeration value="Any"/> <enumeration value="VeryLow"/> <enumeration value="Low"/> <enumeration value="Medium"/> <enumeration value="High"/> <enumeration value="VeryHigh"/> </restriction> </simpleType> <simpleType name="DocumentFormat"> <restriction base="string"> <enumeration value="Any"/> <enumeration value="HTML_XHTML"/> <enumeration value="SHOWCKWAVE_FLASH"/> <enumeration value="FLASH_VIDEO"/> <enumeration value="JPEG"/> <enumeration value="GIF"/> <enumeration value="MPEG"/> <enumeration value="PDF"/> <enumeration value="MSWORD"/> <enumeration value="MSEXCEL"/> <enumeration value="MSPOWERPOINT"/> <enumeration value="XML"/> </restriction> </simpleType> <simpleType name="DocumentDifficulty"> <restriction base="string"> <enumeration value="Any"/> <enumeration value="VeryLow"/> <enumeration value="Low"/> <enumeration value="Medium"/> <enumeration value="High"/> <enumeration value="VeryHigh"/> </restriction> </simpleType> <simpleType name="DocumentLearningResourceType"> <restriction base="string"> <enumeration value="Any"/> <enumeration value="Excercise"/> <enumeration value="Simulation"/> <enumeration value="Questionnaire"/> <enumeration value="Diagram"/> <enumeration value="Figure"/> <enumeration value="Graph"/> <enumeration value="Index"/> <enumeration value="Slide"/> <enumeration value="Table"/> <enumeration value="NarrativeText"/> <enumeration value="Exam"/> <enumeration value="Experiment"/> <enumeration value="ProblemStatement"/> <enumeration value="SelfAssesment"/> </restriction> </simpleType> <simpleType name="DocumentIntendedEndUser"> <restriction base="string"> <enumeration value="Any"/> <enumeration value="Teacher"/> <enumeration value="Author"/> <enumeration value="Learner"/> <enumeration value="Manager"/> </restriction> </simpleType> <simpleType name="Context"> <restriction base="string"> <enumeration value="Any"/> <enumeration value="PrimaryEducation"/> <enumeration value="SecondaryEducation"/> <enumeration value="HigherEducation"/> <enumeration value="UniversityFirstCycle"/> <enumeration value="UniversitySecondCycle"/> <enumeration value="UniversityPostgrade"/> <enumeration value="TechnicalSchoolFirstCycle"/> <enumeration value="TechnicalSchoolSecondCycle"/> <enumeration value="ProfessionalFormation"/> <enumeration value="ContinuousFormation"/> <enumeration value="VocationalTraining"/> </restriction> </simpleType> <simpleType name="DocumentStatus"> <restriction base="string"> <enumeration value="Any"/> <enumeration value="Draft"/> <enumeration value="Final"/> <enumeration value="Revised"/> <enumeration value="Unavailable"/> </restriction> </simpleType> <simpleType name="DocumentInteractivityType"> <restriction base="string"> <enumeration value="Any"/> <enumeration value="Active"/> <enumeration value="Expositive"/> <enumeration value="Mixed"/> <enumeration value="Undefined"/> </restriction> </simpleType> </schema> <schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://lor.rbx.com/ws/ metadata" xmlns="http://www.w3.org/2001/XMLSchema"> <complexType name="anyType2anyTypeMap"> <sequence> <element maxOccurs="unbounded" minOccurs="0" name="entry"> <complexType> <sequence> <element minOccurs="0" name="key" type="anyType"/> <element minOccurs="0" name="value" type="anyType"/> </sequence> </complexType> </element> </sequence> </complexType> </schema> <schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="urn:com:rbx:lor:ws:model" xmlns="http://www.w3.org/ 2001/XMLSchema" xmlns:ns0="http://util.java" xmlns:ns1="http:// metadata.core.lor.rbx.com"> <complexType name="User"> <sequence> <element minOccurs="0" name="firstName" nillable="true" type="string"/> <element minOccurs="0" name="id" nillable="true" type="ns0:UUID"/> <element minOccurs="0" name="lastName" nillable="true" type="string"/> <any maxOccurs="unbounded"/> </sequence> </complexType> <complexType name="Metadata"> <sequence> <element minOccurs="0" name="ageFrom" type="int"/> <element minOccurs="0" name="ageTo" type="int"/> <element minOccurs="0" name="context" nillable="true" type="ns1:Context"/> <element minOccurs="0" name="coverage" nillable="true" type="ns3:Coverage"/> <element minOccurs="0" name="creator" nillable="true" type="ns3:User"/> <element minOccurs="0" name="degreeInteractivity" nillable="true" type="ns1:DocumentDegreeInteractivity"/> <element minOccurs="0" name="description" nillable="true" type="string"/> <element minOccurs="0" name="difficulty" nillable="true" type="ns1:DocumentDifficulty"/> <element minOccurs="0" name="format" nillable="true" type="ns1:DocumentFormat"/> <element minOccurs="0" name="id" nillable="true" type="ns0:UUID"/> <element minOccurs="0" name="intendedUser" nillable="true" type="ns1:DocumentIntendedEndUser"/> <element minOccurs="0" name="interactivityType" nillable="true" type="ns1:DocumentInteractivityType"/> <element minOccurs="0" name="keywords" nillable="true" type="ns3:ArrayOfKeyword"/> <element minOccurs="0" name="language" nillable="true" type="ns1:DocumentLanguage"/> <element minOccurs="0" name="lastUpdate" type="dateTime"/> <element minOccurs="0" name="owner" nillable="true" type="ns3:User"/> <element minOccurs="0" name="rating" type="int"/> <element minOccurs="0" name="resourceType" nillable="true" type="ns1:DocumentLearningResourceType"/> <element minOccurs="0" name="size" type="int"/> <element minOccurs="0" name="status" nillable="true" type="ns1:DocumentStatus"/> <element minOccurs="0" name="subject" nillable="true" type="ns3:Subject"/> <element minOccurs="0" name="title" nillable="true" type="string"/> <element minOccurs="0" name="version" nillable="true" type="string"/> <any maxOccurs="unbounded"/> </sequence> </complexType> <complexType name="Coverage"> <sequence> <element minOccurs="0" name="id" nillable="true" type="ns0:UUID"/> <element minOccurs="0" name="value" nillable="true" type="string"/> <any maxOccurs="unbounded"/> </sequence> </complexType> <complexType name="ArrayOfKeyword"> <sequence> <element maxOccurs="unbounded" minOccurs="0" name="Keyword" nillable="true" type="ns3:Keyword"/> </sequence> </complexType> <complexType name="Subject"> <sequence> <element minOccurs="0" name="id" nillable="true" type="ns0:UUID"/> <element minOccurs="0" name="value" nillable="true" type="string"/> <any maxOccurs="unbounded"/> </sequence> </complexType> </schema> <schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://util.java" xmlns="http://www.w3.org/2001/XMLSchema"> <complexType name="UUID"> <sequence> <element minOccurs="0" name="leastSignificantBits" type="long"/> <element minOccurs="0" name="mostSignificantBits" type="long"/> </sequence> </complexType> </schema> </wsdl:types> <wsdl:message name="updateMetadata"> <wsdl:part name="metadata" type="ns2:Metadata"> </wsdl:part> </wsdl:message> <wsdl:message name="getMap"> <wsdl:part name="arg0" type="ns1:anyType2anyTypeMap"> </wsdl:part> </wsdl:message> <wsdl:message name="getDocumentMetadata"> <wsdl:part name="documentID" type="ns3:UUID"> </wsdl:part> </wsdl:message> <wsdl:message name="updateMetadataResponse"> </wsdl:message> <wsdl:message name="getMapResponse"> <wsdl:part name="return" type="ns1:anyType2anyTypeMap"> </wsdl:part> </wsdl:message> <wsdl:message name="getDocumentMetadataResponse"> <wsdl:part name="metadata" type="ns2:Metadata"> </wsdl:part> </wsdl:message> <wsdl:portType name="MetadataService"> <wsdl:operation name="updateMetadata"> <wsdl:input message="ns1:updateMetadata" name="updateMetadata"> </wsdl:input> <wsdl:output message="ns1:updateMetadataResponse" name="updateMetadataResponse"> </wsdl:output> </wsdl:operation> <wsdl:operation name="getDocumentMetadata"> <wsdl:input message="ns1:getDocumentMetadata" name="getDocumentMetadata"> </wsdl:input> <wsdl:output message="ns1:getDocumentMetadataResponse" name="getDocumentMetadataResponse"> </wsdl:output> </wsdl:operation> <wsdl:operation name="getMap"> <wsdl:input message="ns1:getMap" name="getMap"> </wsdl:input> <wsdl:output message="ns1:getMapResponse" name="getMapResponse"> </wsdl:output> </wsdl:operation> </wsdl:portType> <wsdl:binding name="MetadataServiceSoapBinding" type="ns1:MetadataService"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/ soap/http"/> <wsdl:operation name="updateMetadata"> <soap:operation soapAction="" style="rpc"/> <wsdl:input name="updateMetadata"> <soap:body namespace="http://lor.rbx.com/ws/metadata" use="literal"/> </wsdl:input> <wsdl:output name="updateMetadataResponse"> <soap:body namespace="http://lor.rbx.com/ws/metadata" use="literal"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="getDocumentMetadata"> <soap:operation soapAction="" style="rpc"/> <wsdl:input name="getDocumentMetadata"> <soap:body namespace="http://lor.rbx.com/ws/metadata" use="literal"/> </wsdl:input> <wsdl:output name="getDocumentMetadataResponse"> <soap:body namespace="http://lor.rbx.com/ws/metadata" use="literal"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="getMap"> <soap:operation soapAction="" style="rpc"/> <wsdl:input name="getMap"> <soap:body namespace="http://lor.rbx.com/ws/metadata" use="literal"/> </wsdl:input> <wsdl:output name="getMapResponse"> <soap:body namespace="http://lor.rbx.com/ws/metadata" use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="MetadataService"> <wsdl:port binding="ns1:MetadataServiceSoapBinding" name="MetadataServiceImplPort"> <soap:address location="http://localhost:8080/lor/services/ MetadataService"/> </wsdl:port> </wsdl:service> </wsdl:definitions> And this is the error: WSDLToJava Error : Thrown by JAXB : undefined simple or complex type 'ns3:Coverage' org.apache.cxf.tools.common.ToolException: Thrown by JAXB : undefined simple or complex type 'ns3:Coverage' at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBBindErrorListener.error (JAXBBindErrorListener.java:34) at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.error (SchemaCompilerImpl.java:245) at com.sun.tools.xjc.util.ErrorReceiverFilter.error (ErrorReceiverFilter.java:61) at com.sun.xml.xsom.impl.parser.ParserContext$2.error (ParserContext.java:188) at com.sun.xml.xsom.impl.parser.ParserContext$1.reportError (ParserContext.java:166) at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.reportError (NGCCRuntimeEx.java:103) at com.sun.xml.xsom.impl.parser.DelayedRef.resolve (DelayedRef.java:91) at com.sun.xml.xsom.impl.parser.DelayedRef.run (DelayedRef.java:66) at com.sun.xml.xsom.impl.parser.ParserContext.getResult (ParserContext.java:126) at com.sun.xml.xsom.parser.XSOMParser.getResult (XSOMParser.java:172) at com.sun.tools.xjc.ModelLoader.createXSOM(ModelLoader.java: 488) at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind (SchemaCompilerImpl.java:197) at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize( JAXBDataBinding.java:123) at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.generate (JAXBDataBinding.java:163) at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes (WSDLToJavaContainer.java:483) at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute (WSDLToJavaContainer.java:168) at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute (WSDLToJavaContainer.java:215) at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool (ToolRunner.java:84) at org.apache.cxf.tools.wsdlto.WSDLToJava.run (WSDLToJava.java:102) at org.apache.cxf.tools.wsdlto.WSDLToJava.main (WSDLToJava.java:171) Caused by: org.xml.sax.SAXParseException: undefined simple or complex type 'ns3:Coverage' at com.sun.xml.xsom.impl.parser.ParserContext$1.reportError (ParserContext.java:162) ... 15 more On Jul 19, 2007, at 8:06 PM, Jim Ma wrote: > Hi , > The generated wsdl seems invalid**. Can you also paste the wsdl you > generated? > Cheers > > Jim > > Julio Arias wrote: >> Hi - >> >> I have the following web method, we are using JAXB binding but the >> WSDL generator doesn't create a complex type for the returning(or >> param) map thus wsdl2java blows up with the following exception >> (see below). Xfire use to create a complex type in the WSDL for >> this. Do I need a special annotation? >> >> @WebMethod >> Map<Long, MetadataVO> getMap(Map<Long, String> param); >> >> --------------------------------------------------------------------- >> ---------------- >> >> WSDLToJava Error : java.lang.NullPointerException >> >> org.apache.cxf.tools.common.ToolException: >> java.lang.NullPointerException >> at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute >> (WSDLToJavaContainer.java:223) >> at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool >> (ToolRunner.java:84) >> at org.apache.cxf.tools.wsdlto.WSDLToJava.run >> (WSDLToJava.java:102) >> at org.apache.cxf.tools.wsdlto.WSDLToJava.main >> (WSDLToJava.java:171) >> Caused by: java.lang.NullPointerException >> at >> org.apache.ws.commons.schema.XmlSchemaCollection.getElementByQName >> (XmlSchemaCollection.java:372) >> at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildMessage >> (WSDLServiceBuilder.java:775) >> at >> org.apache.cxf.wsdl11.WSDLServiceBuilder.buildInterfaceOperation >> (WSDLServiceBuilder.java:578) >> at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildInterface >> (WSDLServiceBuilder.java:561) >> at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices >> (WSDLServiceBuilder.java:251) >> at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices >> (WSDLServiceBuilder.java:154) >> at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices >> (WSDLServiceBuilder.java:143) >> at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute >> (WSDLToJavaContainer.java:142) >> at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute >> (WSDLToJavaContainer.java:215) >> ... 3 more >> >> >> >> >> >> >> Julio Arias >> Java Developer >> Roundbox Global : enterprise : technology : genius >> --------------------------------------------------------------------- >> Avenida 11 y Calle 7-9, Barrio Amón, San Jose, Costa Rica >> tel: 404.567.5000 ext. 2001 | cell: 11.506.849.5981 >> email: [EMAIL PROTECTED] | www.rbxglobal.com >> --------------------------------------------------------------------- >> >> Julio Arias Java Developer Roundbox Global : enterprise : technology : genius --------------------------------------------------------------------- Avenida 11 y Calle 7-9, Barrio Amón, San Jose, Costa Rica tel: 404.567.5000 ext. 2001 | cell: 11.506.849.5981 email: [EMAIL PROTECTED] | www.rbxglobal.com ---------------------------------------------------------------------
-- Dan Diephouse Envoi Solutions http://envoisolutions.com | http://netzooid.com/blog
