Wsdl2Java throws a code generation exception if the input message has 2 parts.
(Document-Literal Wrapped Dispatching)
----------------------------------------------------------------------------------------------------------------------
Key: AXIS2-953
URL: http://issues.apache.org/jira/browse/AXIS2-953
Project: Apache Axis 2.0 (Axis2)
Issue Type: Bug
Components: wsdl
Affects Versions: 1.0
Environment: Linux
Reporter: Nitesh kant
I am trying to generate Java client side stubs from WSDL using Wsdl2Java.
Following is the wsdl:
------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.foo.bar/schemas/2006/02/26/wsdl/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:types="http://www.foo.bar/schemas/2006/02/26/wsdl/types"
targetNamespace="http://www.foo.bar/schemas/2006/02/26/wsdl/"
name="WSDLFILE">
<wsdl:types>
<xsd:schema
targetNamespace="http://www.foo.bar/schemas/2006/02/26/wsdl/types"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xsd:element name="session_id" type="xsd:string" />
<xsd:element name="attachment" type="xsd:hexBinary" />
<xsd:element name="putBundle">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="groupName" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<!-- Message definitions -->
<wsdl:message name="putBundleRequest">
<wsdl:part name="body" element="types:putBundle"/>
<wsdl:part name="attachment" element="types:attachment"/>
</wsdl:message>
<wsdl:message name="putBundleResponse">
<wsdl:part element="types:session_id" name="PutAGBundleResponse"/>
</wsdl:message>
<wsdl:portType name="Config">
<wsdl:operation name="putBundle">
<wsdl:input message="tns:PutBundleRequest"/>
<wsdl:output message="tns:PutBundleResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="configSoapBinding" type="tns:Config">
<wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="putBundle">
<wsdlsoap:operation/>
<wsdl:input>
<mime:multipartRelated
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/">
<mime:part>
<wsdlsoap:body parts="body"
use="literal"/>
</mime:part>
<mime:part>
<mime:content part="attachment"
type="application/zip"/>
</mime:part>
</mime:multipartRelated>
</wsdl:input>
<wsdl:output>
<wsdlsoap:body parts="tns:PutBundleResponse" use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ConfigService">
<wsdl:port binding="tns:configSoapBinding"
name="config">
<wsdlsoap:address
location="http://localhost:8080/config"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
------------------------------------------------------------------
The whole intention is to send a SOAP attachment as a part of the request for
"putBundle" operation.
I am not sure whether this is the correct way of doing it in Axis2 but yes,
wsdl specs do suggest the same.
The following is the stack trace for the code-generation 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: src-resolve: type '[EMAIL
PROTECTED]://www.foo.bar/schemas/2006/02/26/wsdl/' not found.
at
org.apache.axis2.xmlbeans.CodeGenerationUtility.processSchemas(CodeGenerationUtility.java:192)
... 8 more
Caused by: org.apache.xmlbeans.XmlException: error: src-resolve: type
'[EMAIL PROTECTED]://www.foo.bar/schemas/2006/02/26/wsdl/' not found.
at
org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler.compile(SchemaTypeSystemCompiler.java:225)
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.xmlbeans.XmlBeans.compileXmlBeans(XmlBeans.java:665)
at
org.apache.axis2.xmlbeans.CodeGenerationUtility.processSchemas(CodeGenerationUtility.java:161)
... 8 more
----------------------------------------------------------------------
However, if the "PutBundleRequest" message contains only one part, everything
works fine.
The following is the ant task i am using to call Wsdl2Java
-------------------------------------------------------------------------------------------------------------------
<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
<classpath refid="wsdl2Java.gen.classpath"/>
<arg value="-u"/>
<arg value="-s"/>
<arg value="-d"/>
<arg value="xmlbeans"/>
<arg value="-uri"/>
<arg file="${wsdl2Java_schemas}/ConfigService.wsdl"/>
<arg value="-o"/>
<arg file="${wsdl2Java_root}"/>
<arg value="-p"/>
<arg value="com.sonoa.soi.client"/>
<arg value="-ns2p"/>
<arg
value="http://wwwfoo.bar/schemas/2006/02/26/wsdl/=com.foo,http://www.foo.bar/schemas/2006/02/26/wsdl/types=com.foo.wsdl.types"/>
</java>
---------------------------------------------------------------------------------------------
Am i missing something or is it a bug?
Also, it will be helpful, if you can suggest a way that works with Axis2 to
send SOAP attachments using stubs generated by Wsdl2Java.
thanks and regards,
nitesh
--
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]