Xarx123
14 years agoOccasional Contributor
Invalid requests & responses with rpc-binding
Hello,
I have a very basic WSDL that contains both a document-style and a rpc-style binding. The presence of a rpc-style binding causes corruption of the generated request and the generated response from the mock service for the document-style binding! When I comment out the rpc-style binding, the generated request and response for the document-style binding get fixed.
The (almost, see viewtopic.php?f=13&t=12000) correct request for document-style binding without any rpc-style binding present:
The incorrectly generated request for the same document-style binding with a rpc-style binding present:
(The <hel:getGreeting> element is superfluous.) The sample request and response for the rpc-style binding are generated correctly, though.
The XSD looks like this:
and the WSDL is like this:
I use SoapUI 4.0.1, Build dist-134-2011-09-14, Build Date 2011/09/14 13:06.
I have a very basic WSDL that contains both a document-style and a rpc-style binding. The presence of a rpc-style binding causes corruption of the generated request and the generated response from the mock service for the document-style binding! When I comment out the rpc-style binding, the generated request and response for the document-style binding get fixed.
The (almost, see viewtopic.php?f=13&t=12000) correct request for document-style binding without any rpc-style binding present:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:exam="http://www.example.com/">
<soapenv:Header/>
<soapenv:Body>
<exam:EgetGreeting>
<!--Optional:-->
<name>?</name>
</exam:EgetGreeting>
</soapenv:Body>
</soapenv:Envelope>
The incorrectly generated request for the same document-style binding with a rpc-style binding present:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hel="http://www.example.com/HelloWorld.wsdl" xmlns:exam="http://www.example.com/">
<soapenv:Header/>
<soapenv:Body>
<hel:getGreeting>
<exam:EgetGreeting>
<!--Optional:-->
<name>?</name>
</exam:EgetGreeting>
</hel:getGreeting>
</soapenv:Body>
</soapenv:Envelope>
(The <hel:getGreeting> element is superfluous.) The sample request and response for the rpc-style binding are generated correctly, though.
The XSD looks like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema version="1.0" targetNamespace="http://www.example.com/" xmlns:tns="http://www.example.com/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="xgetGreeting" type="tns:TgetGreeting"/>
<xs:element name="getGreetingResponse" type="tns:getGreetingResponse"/>
<xs:complexType name="TgetGreeting">
<xs:sequence>
<xs:element name="name" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="getGreetingResponse">
<xs:sequence>
<xs:element name="return" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
and the WSDL is like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Oracle JAX-WS 2.1.5. -->
<definitions targetNamespace="http://www.example.com/HelloWorld.wsdl" name="HelloWorldService" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.example.com/HelloWorld.wsdl" xmlns:dns="http://www.example.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<types>
<xsd:schema>
<xsd:import namespace="http://www.example.com/" schemaLocation="HelloWorldService_schema1.xsd"/>
</xsd:schema>
</types>
<message name="getGreeting">
<part name="parameters" element="dns:xgetGreeting"/>
</message>
<message name="getGreetingResponse">
<part name="parameters" element="dns:getGreetingResponse"/>
</message>
<message name="getGreetingRPC">
<part name="parameters" type="dns:TgetGreeting"/>
</message>
<message name="getGreetingRPCResponse">
<part name="parameters" type="dns:getGreetingResponse"/>
</message>
<portType name="HelloWorldPortType">
<operation name="getGreeting">
<input message="tns:getGreeting"/>
<output message="tns:getGreetingResponse"/>
</operation>
</portType>
<portType name="HelloWorldRPCPortType">
<operation name="getGreeting">
<input message="tns:getGreetingRPC"/>
<output message="tns:getGreetingRPCResponse"/>
</operation>
</portType>
<binding name="HelloWorldSoapPortBinding" type="tns:HelloWorldPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="getGreeting">
<soap:operation soapAction="http://www.example.com/HelloWorld.wsdl#getGreeting"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<binding name="HelloWorldSoapRPCPortBinding" type="tns:HelloWorldRPCPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
<operation name="getGreeting">
<soap:operation soapAction="http://www.example.com/HelloWorld.wsdl#getGreetingRPC"/>
<input>
<soap:body use="literal" namespace="http://www.example.com/"/>
</input>
<output>
<soap:body use="literal" namespace="http://www.example.com/"/>
</output>
</operation>
</binding>
<service name="HelloWorldService">
<port name="HelloWorldBottomUpSoapPort" binding="tns:HelloWorldSoapPortBinding">
<soap:address location="http://localhost:7001/business/hello/HelloWorldService"/>
</port>
<port name="HelloWorldTopDownSoapPort" binding="tns:HelloWorldSoapRPCPortBinding">
<soap:address location="http://localhost:7001/business/hello/HelloWorldRPCService"/>
</port>
</service>
</definitions>
I use SoapUI 4.0.1, Build dist-134-2011-09-14, Build Date 2011/09/14 13:06.