If the operation name is defined similar to the request element name in the
wsdl schema type then wsdl2java generates incorrect classes.
----------------------------------------------------------------------------------------------------------------------------------------
Key: AXIS-2570
URL: http://issues.apache.org/jira/browse/AXIS-2570
Project: Apache Axis
Issue Type: Bug
Components: WSDL processing
Affects Versions: 1.4
Environment: Windows XP, Tomcat Server - Version -
jakarta-tomcat-5.0.28.,JDK - Version - java full version "1.5.0_06-b05"
Reporter: Saif Rizvi
Priority: Blocker
Hi All
I am using Axis 1.4 to create Java classes for my wsdl but i am facing a
strange problem.
If my wsdl has the operation name defined similar to the request element in the
schemas the classes age generated faulty.
For example, the below wsdl defines the request element TestInputRequest as :
<message name="TestInputRequest">
<part name="parameters" element="ns:TestInputRequest"/>
</message>
and soap operation name TestInputRequest as:
<portType name="TestPortType">
<operation name="TestInputRequest">
<input message="ns:TestInputRequest"/>
<output message="ns:TestOutputResponse"/>
</operation>
</portType>
the classes generated have signatures which define the operation's input
parameters and output parameters incorrectly(i.e. not complying with the wsdl).
In the sample wsdl given below the classes generated have signatures as :
package com.example.test;
public interface TestPortType extends java.rmi.Remote {
public void
testInputRequest(com.example.test.TestInputRequestRequestElement1
requestElement1, com.example.test.TestInputRequestRequestElement2
requestElement2, com.example.test.TestInputRequestRequestElement3
requestElement3,
com.example.test.holders.TestOutputResponseResponseElement1Holder
responseElement1,
com.example.test.holders.TestOutputResponseResponseElement2Holder
responseElement2,
com.example.test.holders.TestOutputResponseResponseElement3Holder
responseElement3) throws java.rmi.RemoteException;
}
So the generated web service does not give correct SOAP request and response.
If the name of the request is made not similar to the operation name service
gives correct SOAP request and response.
Here is the sample wsdl.Classes generated with this using WSDL2Java can be used
to replicate the problem.
<WSDL:definitions xmlns:WSDL="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:y="http://new.webservice.namespace"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns="http://example.com/test/"
xmlns:ns1="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://example.com/test/">
<WSDL:types>
<xs:schema targetNamespace="http://example.com/test/"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" elementFormDefault="qualified">
<xs:import
namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<xs:element name="TestInputRequest">
<xs:complexType>
<xs:sequence>
<xs:element
name="RequestElement1">
<xs:complexType>
<xs:sequence>
<xs:element name="RequestSubElement1" type="xs:string"/>
<xs:element name="RequestSubElement2" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element
name="RequestElement2">
<xs:complexType>
<xs:sequence>
<xs:element name="RequestSubElement1" type="xs:string"/>
<xs:element name="RequestSubElement2" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element
name="RequestElement3">
<xs:complexType>
<xs:sequence>
<xs:element name="RequestSubElement1" type="xs:string"/>
<xs:element name="RequestSubElement2" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TestOutputResponse">
<xs:complexType>
<xs:sequence>
<xs:element
name="ResponseElement1">
<xs:complexType>
<xs:sequence>
<xs:element name="ResponseSubElement1" type="xs:string"/>
<xs:element name="ResponseSubElement2" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element
name="ResponseElement2">
<xs:complexType>
<xs:sequence>
<xs:element name="ResponseSubElement1" type="xs:string"/>
<xs:element name="ResponseSubElement2" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element
name="ResponseElement3">
<xs:complexType>
<xs:sequence>
<xs:element name="ResponseSubElement1" type="xs:string"/>
<xs:element name="ResponseSubElement2" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</WSDL:types>
<message name="TestInputRequest">
<part name="parameters" element="ns:TestInputRequest"/>
</message>
<message name="TestOutputResponse">
<part name="parameters" element="ns:TestOutputResponse"/>
</message>
<portType name="TestPortType">
<operation name="TestInputRequest">
<input message="ns:TestInputRequest"/>
<output message="ns:TestOutputResponse"/>
</operation>
</portType>
<binding name="Test" type="ns:TestPortType">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="TestInputRequest">
<soap:operation
soapAction="http://example.com/test/TestInputRequest"/>
<input>
<SOAP:body parts="parameters" use="literal"/>
</input>
<output>
<SOAP:body parts="parameters" use="literal"/>
</output>
</operation>
</binding>
<service name="Test">
<port name="Test" binding="ns:Test">
<soap:address
location="http://localhost:8080/axis/services/Test"/>
</port>
</service>
</WSDL: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]