Resolving Operation at dispatcher using local name of the first Element in a
soapbody when the style is Doc/Lit
----------------------------------------------------------------------------------------------------------------
Key: AXIS2-156
URL: http://issues.apache.org/jira/browse/AXIS2-156
Project: Apache Axis 2.0 (Axis2)
Type: Improvement
Components: core
Versions: 0.92
Reporter: Gayan Asanka
Dispatcher should be able to resolve the operation in folowing conditions
When
1. The soap action is same for all the operations in service
2. Local name of the first child is not equal to the operation name (since
style is Doc/Lit)
3. Local name of the first child is equal to the shema-element name
Dispatcher can use element name that is the local name of first child and also
mentioned in the schema, to resolve the operation .
A sample WSDL and a relevent Soap messages are as follows:
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://soapinterop.org/WSDLInteropTestDocLit"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsd1="http://soapinterop.org/xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
name="WSDLInteropTestDocLitService"
targetNamespace="http://soapinterop.org/WSDLInteropTestDocLit">
<types>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://soapinterop.org/xsd" elementFormDefault="qualified">
<complexType name="ArrayOfstring_literal">
<sequence>
<element maxOccurs="unbounded" minOccurs="1" name="string"
type="xsd:string"/>
</sequence>
</complexType>
<complexType name="SOAPStruct">
<all>
<element name="varFloat" type="xsd:float"/>
<element name="varInt" type="xsd:int"/>
<element name="varString" type="xsd:string"/>
</all>
</complexType>
<element name="echoStringParam" type="xsd:string"/>
<element name="echoStringReturn" type="xsd:string"/>
<element name="echoStringArrayParam"
type="xsd1:ArrayOfstring_literal"/>
<element name="echoStringArrayReturn"
type="xsd1:ArrayOfstring_literal"/>
<element name="echoStructParam" type="xsd1:SOAPStruct"/>
<element name="echoStructReturn" type="xsd1:SOAPStruct"/>
</schema>
</types>
<message name="echoString">
<part element="xsd1:echoStringParam" name="a"/>
</message>
<message name="echoStringResponse">
<part element="xsd1:echoStringReturn" name="result"/>
</message>
<message name="echoStringArray">
<part element="xsd1:echoStringArrayParam" name="a"/>
</message>
<message name="echoStringArrayResponse">
<part element="xsd1:echoStringArrayReturn" name="result"/>
</message>
<message name="echoStruct">
<part element="xsd1:echoStructParam" name="a"/>
</message>
<message name="echoStructResponse">
<part element="xsd1:echoStructReturn" name="result"/>
</message>
<message name="echoVoid"/>
<message name="echoVoidResponse"/>
<portType name="WSDLInteropTestDocLitPortType">
<operation name="echoString">
<input message="tns:echoString" name="echoString"/>
<output message="tns:echoStringResponse" name="echoStringResponse"/>
</operation>
<operation name="echoStringArray">
<input message="tns:echoStringArray" name="echoStringArray"/>
<output message="tns:echoStringArrayResponse"
name="echoStringArrayResponse"/>
</operation>
<operation name="echoStruct">
<input message="tns:echoStruct" name="echoStruct"/>
<output message="tns:echoStructResponse" name="echoStructResponse"/>
</operation>
<operation name="echoVoid">
<input message="tns:echoVoid" name="echoVoid"/>
<output message="tns:echoVoidResponse" name="echoVoidResponse"/>
</operation>
</portType>
<binding name="WSDLInteropTestDocLitPortBinding"
type="tns:WSDLInteropTestDocLitPortType">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="echoString">
<soap:operation soapAction="http://soapinterop.org/"
style="document"/>
<input name="echoString">
<soap:body
namespace="http://soapinterop.org/WSDLInteropTestDocLit" use="literal"/>
</input>
<output name="echoStringResponse">
<soap:body
namespace="http://soapinterop.org/WSDLInteropTestDocLit" use="literal"/>
</output>
</operation>
<operation name="echoStringArray">
<soap:operation soapAction="http://soapinterop.org/"
style="document"/>
<input name="echoStringArray">
<soap:body
namespace="http://soapinterop.org/WSDLInteropTestDocLit" use="literal"/>
</input>
<output name="echoStringArrayResponse">
<soap:body
namespace="http://soapinterop.org/WSDLInteropTestDocLit" use="literal"/>
</output>
</operation>
<operation name="echoStruct">
<soap:operation soapAction="http://soapinterop.org/"
style="document"/>
<input name="echoStruct">
<soap:body
namespace="http://soapinterop.org/WSDLInteropTestDocLit" use="literal"/>
</input>
<output name="echoStructResponse">
<soap:body
namespace="http://soapinterop.org/WSDLInteropTestDocLit" use="literal"/>
</output>
</operation>
<operation name="echoVoid">
<soap:operation soapAction="http://soapinterop.org/"
style="document"/>
<input name="echoVoid">
<soap:body
namespace="http://soapinterop.org/WSDLInteropTestDocLit" use="literal"/>
</input>
<output name="echoVoidResponse">
<soap:body
namespace="http://soapinterop.org/WSDLInteropTestDocLit" use="literal"/>
</output>
</operation>
</binding>
<service name="WSDLInteropTestDocLitService">
<port binding="tns:WSDLInteropTestDocLitPortBinding"
name="WSDLInteropTestDocLitPort">
<soap:address xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
location=""/>
</port>
</service>
</definitions>
Request Soap for EchoString Oparation:
POST /round3/groupd/doclit HTTP/1.1
User-Agent: Axis/2.0
SOAPAction: http://soapinterop.org/
Connection: Keep-Alive
Host: soapinterop.java.sun.com
Content-Length: 411
Content-Type: text/xml; charset=utf-8
<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsa:To
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">http://localhost:8010/round3/groupd/doclit</wsa:To>
</soapenv:Header>
<soapenv:Body>
<echoStringParam xmlns="http://soapinterop.org/xsd">this is a String
parameter</echoStringParam>
</soapenv:Body>
</soapenv:Envelope>
Response soap:
HTTP/1.1 200 OK
SOAPAction: ""
Content-Type: text/xml; charset="utf-8"
Transfer-Encoding: chunked
Date: Wed, 17 Aug 2005 12:20:37 GMT
Server: Apache Coyote/1.0
196
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns0="http://soapinterop.org/xsd">
<env:Body>
<ns0:echoStringReturn>this is a String parameter</ns0:echoStringReturn>
</env:Body>
</env:Envelope>
0
Requst Soap for EchoStruct operation:
POST /round3/groupd/doclit HTTP/1.1
User-Agent: Axis/2.0
SOAPAction: http://soapinterop.org/
Connection: Keep-Alive
Host: soapinterop.java.sun.com
Content-Length: 485
Content-Type: text/xml; charset=utf-8
<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsa:To
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">http://localhost:8010/round3/groupd/doclit</wsa:To>
</soapenv:Header>
<soapenv:Body>
<echoStructParam xmlns="http://soapinterop.org/xsd">
<varFloat>456.321</varFloat>
<varInt>456987</varInt>
<varString>this is a String parameter</varString>
</echoStructParam>
</soapenv:Body>
</soapenv:Envelope>
response saop for echoStruct operation
HTTP/1.1 200 OK
SOAPAction: ""
Content-Type: text/xml; charset="utf-8"
Transfer-Encoding: chunked
Date: Wed, 17 Aug 2005 12:54:39 GMT
Server: Apache Coyote/1.0
1f8
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns0="http://soapinterop.org/xsd">
<env:Body>
<ns0:echoStructReturn>
<ns0:varFloat>456.321</ns0:varFloat>
<ns0:varInt>456987</ns0:varInt>
<ns0:varString>this is a String parameter</ns0:varString>
</ns0:echoStructReturn>
</env:Body>
</env:Envelope>
0
--
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