WSDL compilation error when migrating from Axis2 version 0.94/0.95 to 1.0
-------------------------------------------------------------------------
Key: AXIS2-823
URL: http://issues.apache.org/jira/browse/AXIS2-823
Project: Apache Axis 2.0 (Axis2)
Type: Bug
Components: wsdl
Versions: 1.0
Environment: Windows XP, cygwin, Java1.5
Reporter: Vijay Phadke
Priority: Blocker
The wsdl that compiled properly under Axis2 version 0.94 and 0.95, fails to
compile under version 1.0 and gives the following error -
Exception in thread "main"
org.apache.axis2.wsdl.codegen.CodeGenerationException:
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:185)
at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
Caused by: java.lang.RuntimeException:
java.lang.reflect.InvocationTargetException
at
org.apache.axis2.wsdl.codegen.extension.XMLBeansExtension.engage(XMLBeansExtension.java:93)
at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:140)
... 2 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.axis2.wsdl.codegen.extension.XMLBeansExtension.engage(XMLBeansExtension.java:83)
... 3 more
Caused by: java.lang.RuntimeException: org.apache.xmlbeans.XmlException: error:
Use of undefined namespace prefix: xs
at
org.apache.axis2.xmlbeans.CodeGenerationUtility.processSchemas(CodeGenerationUtility.java:192)
... 8 more
Caused by: org.apache.xmlbeans.XmlException: error: Use of undefined namespace
prefix: xs
at
org.apache.xmlbeans.impl.store.Locale$SaxLoader.load(Locale.java:3455)
at org.apache.xmlbeans.impl.store.Locale.parse(Locale.java:706)
at
org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:690)
at
org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:677)
at
org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:208)
at org.apache.xmlbeans.XmlObject$Factory.parse(XmlObject.java:632)
at
org.apache.axis2.xmlbeans.CodeGenerationUtility.processSchemas(CodeGenerationUtility.java:136)
... 8 more
The wsdl has no such prefix 'xs' as the error incorrectly reports.
Here's a sample wsdl that will compile under 0.95 but fails under 1.0
<?xml version="1.0" encoding="UTF-8"?>
<definitions
targetNamespace="http://axis2.mycompany.com/sample"
xmlns:tns="http://axis2.mycompany.com/sample"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<types>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://axis2.mycompany.com/sample">
<import namespace =
"http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="Environments">
<sequence>
<element name="Environment"
type="tns:Environment" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</complexType>
<complexType name="Environment">
<sequence>
<element name="name" type="xsd:string"/>
<element name="Nodes" type="xsd:int"/>
<element name="LogicalComponents"
type="xsd:int"/>
</sequence>
</complexType>
<element name="getEnvironments" type="xsd:string"/>
<element name="addEnvironment" type="tns:Environment"/>
<element name="service_fault" type="xsd:string"/>
<element name="ArrayOfEnvironments" type="tns:Environments"/>
<element name="result" type="xsd:boolean"/>
</schema>
</types>
<message name="getEnvironmentsRequest">
<part name="nodeID" element="tns:getEnvironments" />
</message>
<message name="getEnvironmentsResponse">
<part name="envList" element="tns:ArrayOfEnvironments" />
</message>
<message name="addEnvironmentRequest">
<part name="env" element="tns:addEnvironment" />
</message>
<message name="addEnvironmentResponse">
<part name="result" element="tns:result"/>
</message>
<message name="service_error">
<part name="error_msg" element="tns:service_fault"/>
</message>
<portType name="EnvServicePT">
<operation name="getEnvironments">
<input message="tns:getEnvironmentsRequest"
name="getEnvironmentsRequestSoapIn"/>
<output message="tns:getEnvironmentsResponse"
name="getEnvironmentsResponseSoapOut"/>
<fault message="tns:service_error" name="getEnvironments_fault"/>
</operation>
<operation name="addEnvironment">
<input message="tns:addEnvironmentRequest"
name="addEnvironmentRequestSoapIn"/>
<output message="tns:addEnvironmentResponse"
name="addEnvironmentResponseSoapOut"/>
<fault message="tns:service_error" name="addEnvironment_fault"/>
</operation>
</portType>
<binding name="SampleServiceBinding" type="tns:EnvServicePT">
<operation name="getEnvironments">
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
<fault name="getEnvironments_fault">
<soap:fault use="literal"/>
</fault>
<soap:operation soapAction="" />
</operation>
<operation name="addEnvironment">
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
<fault name="addEnvironment_fault">
<soap:fault use="literal"/>
</fault>
<soap:operation soapAction="" />
</operation>
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
</binding>
<service name="sample">
<port name="SampleServices" binding="tns:SampleServiceBinding">
<soap:address
location="http://localhost:9090/axis/services/SampleServices" />
</port>
</service>
</definitions>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]