Hi, I have the same issue. According to the WSDL 1.1 spec (http://www.w3.org/TR/wsdl), WSDL can import xsd by using <wsdl:import>, but CXF wsdl2java throws exception. Another thing I am having a problem in //types/schema is CXF wsdl2java does not recognize absolute schemaLocation. Even if I specified the absolute path, it always complains with:
[java] Caused by: javax.wsdl.WSDLException: WSDLException (at /definitions/types/xsd:schema[1]/xsd:schema/xsd:schema): faultCode=OTHER_ERROR: Unable to locate with a locator the schema referenced 'http://www.ecma-international.org/standards/ecma-323/csta/ed3/csta.xsd' relative to document base 'http://135.9.30.73/avayaxsd/get-device.xsd' Is this a CXF wsdl2java bug or am I doing something wrong? Any way to get around this? Thanks hj > James Mao wrote: > >>If you want to import schema, you have to put the <import> inside the >>//types/schema node, e.g >> >> <wsdl:types> >> <xsd:schema> >> <xsd:import >>namespace="http://apache.org/hello_world_soap_http/types" >>schemaLocation="schema1.xsd"/> >> </xsd:schema> >> </wsdl:types> > >>Also, you can turn on the -validate to see the exact reason why the >>wsdl2java failed. > > > >> Hello, >> (I'm a complete beginner with CXF/JAXB and even webservices, so perhaps I >> missed something obvious). >> >> I would like to build an "Liberty Alliance" enabled application >> [http://www.projectliberty.org/] ("Liberty" is a federation protocol >> which >> managed identity federation, Single Sign On, etc). To achieve that goal, >> my application need to be compliant with Project Liberty's WSDL and >> schema: >> http://www.projectliberty.org/index.php/liberty/resource_center/specifications/liberty_alliance_specifications_support_documents_and_utility_schema_files >> (for now, I just care of "ID-FF" resources (identity federation >> framework)), and more precisely >> http://www.projectliberty.org/liberty/content/download/1231/7997/file/liberty-idff-wsdl-v1.1.wsdl >> >> So, I attempt to generate all the java classes from the WSDL with >> wsdl2java tool of CXF 2.0.1, but it doesn't work, and I don't know where >> to begin to try to correct the problem. >> When I run the tool, it raise this exception: >> 8<----------------------------------------------------------------- >> $wsdl2java -verbose liberty-idff-wsdl-v1.1.wsdl >> Loading FrontEnd jaxws ... >> Loading DataBinding jaxb ... >> wsdl2java -verbose liberty-idff-wsdl-v1.1.wsdl >> wsdl2java - 2.0.1-incubator >> >> WSDLToJava Error : java.lang.RuntimeException: Fail to create wsdl >> definition from : >> file:/home/fanf/tmp/test_cxf_liberty/liberty-idff-wsdl-v1.1.wsdl >> Caused by : null >> >> org.apache.cxf.tools.common.ToolException: java.lang.RuntimeException: >> Fail to create wsdl definition from : >> file:/home/fanf/tmp/test_cxf_liberty/liberty-idff-wsdl-v1.1.wsdl >> Caused by : null >> at >> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:242) >> at >> org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83) >> 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.RuntimeException: Fail to create wsdl definition >> from >> : file:/home/fanf/tmp/test_cxf_liberty/liberty-idff-wsdl-v1.1.wsdl Caused >> by : null >> at >> org.apache.cxf.wsdl11.WSDLDefinitionBuilder.parseWSDL(WSDLDefinitionBuilder.java:131) >> at >> org.apache.cxf.wsdl11.WSDLDefinitionBuilder.build(WSDLDefinitionBuilder.java:112) >> at >> org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.build(JAXWSDefinitionBuilder.java:90) >> at >> org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.build(JAXWSDefinitionBuilder.java:63) >> at >> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:143) >> at >> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:234) >> ... 3 more >> Caused by: java.lang.NullPointerException >> at com.ibm.wsdl.xml.WSDLReaderImpl.parseImport(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.wsdl11.WSDLDefinitionBuilder.parseWSDL(WSDLDefinitionBuilder.java:123) >> ... 8 more >> 8<----------------------------------------------------------------- >> >> I know that schema definition are quite complex, perhaps I need to >> do/configure somethings ? >> Any help or link to documentation would really much appreciated :) >> >> > > -- View this message in context: http://www.nabble.com/wsdl2java-NPE-for-liberty-idff-wsdl-v1.1.wsdl-tf4290441.html#a13397128 Sent from the cxf-user mailing list archive at Nabble.com.
