diff options
author | (no author) <(no author)@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-09-15 14:47:07 +0000 |
---|---|---|
committer | (no author) <(no author)@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-09-15 14:47:07 +0000 |
commit | caf6ad3a760f4fb0a27bb8e483f3f6ad9de707f0 (patch) | |
tree | 7eb17be0ca672f580224b641611a99ddc8e9b897 /test/wsdl/rpc | |
parent | b8bc87839d722c8cf89b6fbfbb8b4a59c8f6b6a9 (diff) |
This commit was manufactured by cvs2svn to create branch 'ruby_1_8'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/wsdl/rpc')
-rw-r--r-- | test/wsdl/rpc/test-rpc-lit.wsdl | 364 | ||||
-rw-r--r-- | test/wsdl/rpc/test-rpc-lit12.wsdl | 455 | ||||
-rw-r--r-- | test/wsdl/rpc/test_rpc_lit.rb | 399 |
3 files changed, 1218 insertions, 0 deletions
diff --git a/test/wsdl/rpc/test-rpc-lit.wsdl b/test/wsdl/rpc/test-rpc-lit.wsdl new file mode 100644 index 0000000000..72de747e36 --- /dev/null +++ b/test/wsdl/rpc/test-rpc-lit.wsdl @@ -0,0 +1,364 @@ +<?xml version="1.0"?> + +<definitions name="RPC-Literal-TestDefinitions" + targetNamespace="http://whitemesa.net/wsdl/rpc-lit-test" + xmlns="http://schemas.xmlsoap.org/wsdl/" + xmlns:soap11="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:tns="http://whitemesa.net/wsdl/rpc-lit-test" + xmlns:types="http://soapbuilders.org/rpc-lit-test/types" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <types> + <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapbuilders.org/rpc-lit-test/types"> + + <element name="stringItem" type="xsd:string" /> + <complexType name="ArrayOfstring"> + <sequence> + <element ref="types:stringItem" minOccurs="0" maxOccurs="unbounded"/> + </sequence> + </complexType> + + <complexType name="ArrayOfstringInline"> + <sequence> + <element name="stringItem" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/> + </sequence> + </complexType> + + <complexType name="ArrayOfint"> + <sequence> + <element name="integer" type="xsd:int" minOccurs="0" maxOccurs="unbounded"/> + </sequence> + </complexType> + + <element name="structItem" type="types:SOAPStruct" /> + <complexType name="SOAPStruct"> + <all> + <element name="varString" type="xsd:string"/> + <element name="varInt" type="xsd:int"/> + <element name="varFloat" type="xsd:float"/> + </all> + </complexType> + + <complexType name="ArrayOfSOAPStruct"> + <sequence> + <element ref="types:structItem" minOccurs="0" maxOccurs="unbounded"/> + </sequence> + </complexType> + + <complexType name="SOAPStructStruct"> + <all> + <element name="varString" type="xsd:string"/> + <element name="varInt" type="xsd:int"/> + <element name="varFloat" type="xsd:float"/> + <element ref="types:structItem" /> + </all> + </complexType> + + <complexType name="SOAPArrayStruct"> + <all> + <element name="varString" type="xsd:string"/> + <element name="varInt" type="xsd:int"/> + <element name="varFloat" type="xsd:float"/> + <element name="varArray" type="types:ArrayOfstring"/> + </all> + </complexType> + + </schema> + + </types> + + <!-- echoStruct rpc operation --> + <message name="echoStructRequest"> + <part name="inputStruct" type="types:SOAPStruct"/> + </message> + <message name="echoStructResponse"> + <part name="return" type="types:SOAPStruct"/> + </message> + + <!-- echoStructArray rpc operation --> + <message name="echoStructArrayRequest"> + <part name="inputStructArray" type="types:ArrayOfSOAPStruct"/> + </message> + <message name="echoStructArrayResponse"> + <part name="return" type="types:ArrayOfSOAPStruct"/> + </message> + + <!-- echoStructAsSimpleTypes rpc operation --> + <message name="echoStructAsSimpleTypesRequest"> + <part name="inputStruct" type="types:SOAPStruct"/> + </message> + <message name="echoStructAsSimpleTypesResponse"> + <part name="outputString" type="xsd:string"/> + <part name="outputInteger" type="xsd:int"/> + <part name="outputFloat" type="xsd:float"/> + </message> + + <!-- echoSimpleTypesAsStruct rpc operation --> + <message name="echoSimpleTypesAsStructRequest"> + <part name="inputString" type="xsd:string"/> + <part name="inputInteger" type="xsd:int"/> + <part name="inputFloat" type="xsd:float"/> + </message> + <message name="echoSimpleTypesAsStructResponse"> + <part name="return" type="types:SOAPStruct"/> + </message> + + <!-- echoNestedStruct rpc operation --> + <message name="echoNestedStructRequest"> + <part name="inputStruct" type="types:SOAPStructStruct"/> + </message> + <message name="echoNestedStructResponse"> + <part name="return" type="types:SOAPStructStruct"/> + </message> + + <!-- echoNestedArray rpc operation --> + <message name="echoNestedArrayRequest"> + <part name="inputStruct" type="types:SOAPArrayStruct"/> + </message> + <message name="echoNestedArrayResponse"> + <part name="return" type="types:SOAPArrayStruct"/> + </message> + + <!-- echoStringArray rpc operation --> + <message name="echoStringArrayRequest"> + <part name="inputStringArray" type="types:ArrayOfstring"/> + </message> + <message name="echoStringArrayResponse"> + <part name="return" type="types:ArrayOfstring"/> + </message> + + <message name="echoStringArrayInlineRequest"> + <part name="inputStringArray" type="types:ArrayOfstringInline"/> + </message> + <message name="echoStringArrayInlineResponse"> + <part name="return" type="types:ArrayOfstringInline"/> + </message> + + <!-- echoIntegerArray rpc operation --> + <message name="echoIntegerArrayRequest"> + <part name="inputIntegerArray" type="types:ArrayOfint"/> + </message> + <message name="echoIntegerArrayResponse"> + <part name="return" type="types:ArrayOfint"/> + </message> + + <!-- echoBoolean rpc operation --> + <message name="echoBooleanRequest"> + <part name="inputBoolean" type="xsd:boolean"/> + </message> + <message name="echoBooleanResponse"> + <part name="return" type="xsd:boolean"/> + </message> + + <!-- echoString rpc operation --> + <message name="echoStringRequest"> + <part name="inputString" type="xsd:string"/> + </message> + <message name="echoStringResponse"> + <part name="return" type="xsd:string"/> + </message> + + + <portType name="SoapTestPortTypeRpc"> + + <!-- echoStruct rpc operation --> + <operation name="echoStruct" parameterOrder="inputStruct"> + <input message="tns:echoStructRequest"/> + <output message="tns:echoStructResponse"/> + </operation> + + <!-- echoStructArray rpc operation --> + <operation name="echoStructArray" parameterOrder="inputStructArray"> + <input message="tns:echoStructArrayRequest"/> + <output message="tns:echoStructArrayResponse"/> + </operation> + + <!-- echoStructAsSimpleTypes rpc operation --> + <operation name="echoStructAsSimpleTypes" parameterOrder="inputStruct outputString outputInteger outputFloat"> + <input message="tns:echoStructAsSimpleTypesRequest"/> + <output message="tns:echoStructAsSimpleTypesResponse"/> + </operation> + + <!-- echoSimpleTypesAsStruct rpc operation --> + <operation name="echoSimpleTypesAsStruct" parameterOrder="inputString inputInteger inputFloat"> + <input message="tns:echoSimpleTypesAsStructRequest"/> + <output message="tns:echoSimpleTypesAsStructResponse"/> + </operation> + + <!-- echoNestedStruct rpc operation --> + <operation name="echoNestedStruct" parameterOrder="inputStruct"> + <input message="tns:echoNestedStructRequest"/> + <output message="tns:echoNestedStructResponse"/> + </operation> + + <!-- echoNestedArray rpc operation --> + <operation name="echoNestedArray" parameterOrder="inputStruct"> + <input message="tns:echoNestedArrayRequest"/> + <output message="tns:echoNestedArrayResponse"/> + </operation> + + <!-- echoStringArray rpc operation --> + <operation name="echoStringArray" parameterOrder="inputStringArray"> + <input message="tns:echoStringArrayRequest"/> + <output message="tns:echoStringArrayResponse"/> + </operation> + + <operation name="echoStringArrayInline" parameterOrder="inputStringArray"> + <input message="tns:echoStringArrayInlineRequest"/> + <output message="tns:echoStringArrayInlineResponse"/> + </operation> + + <!-- echoIntegerArray rpc operation --> + <operation name="echoIntegerArray" parameterOrder="inputIntegerArray"> + <input message="tns:echoIntegerArrayRequest"/> + <output message="tns:echoIntegerArrayResponse"/> + </operation> + + <!-- echoBoolean rpc operation --> + <operation name="echoBoolean" parameterOrder="inputBoolean"> + <input message="tns:echoBooleanRequest"/> + <output message="tns:echoBooleanResponse"/> + </operation> + + <!-- echoString rpc operation --> + <operation name="echoString" parameterOrder="inputString"> + <input message="tns:echoStringRequest"/> + <output message="tns:echoStringResponse"/> + </operation> + + </portType> + + <binding name="Soap11TestRpcLitBinding" type="tns:SoapTestPortTypeRpc"> + <soap11:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> + + <!-- echoStruct rpc operation --> + <operation name="echoStruct"> + <soap11:operation soapAction="http://soapinterop.org/"/> + <input> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </input> + <output> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </output> + </operation> + + <!-- echoStructArray rpc operation --> + <operation name="echoStructArray"> + <soap11:operation soapAction="http://soapinterop.org/"/> + <input> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </input> + <output> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </output> + </operation> + + <!-- echoStructAsSimpleTypes rpc operation --> + <operation name="echoStructAsSimpleTypes"> + <soap11:operation soapAction="http://soapinterop.org/"/> + <input> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </input> + <output> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </output> + </operation> + + <!-- echoSimpleTypesAsStruct rpc operation --> + <operation name="echoSimpleTypesAsStruct"> + <soap11:operation soapAction="http://soapinterop.org/"/> + <input> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </input> + <output> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </output> + </operation> + + <!-- echoNestedStruct rpc operation --> + <operation name="echoNestedStruct"> + <soap11:operation soapAction="http://soapinterop.org/"/> + <input> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </input> + <output> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </output> + </operation> + + <!-- echoNestedArray rpc operation --> + <operation name="echoNestedArray"> + <soap11:operation soapAction="http://soapinterop.org/"/> + <input> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </input> + <output> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </output> + </operation> + + <!-- echoStringArray rpc operation --> + <operation name="echoStringArray"> + <soap11:operation soapAction="http://soapinterop.org/"/> + <input> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </input> + <output> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </output> + </operation> + + <operation name="echoStringArrayInline"> + <soap11:operation soapAction="http://soapinterop.org/"/> + <input> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </input> + <output> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </output> + </operation> + + <!-- echoIntegerArray rpc operation --> + <operation name="echoIntegerArray"> + <soap11:operation soapAction="http://soapinterop.org/"/> + <input> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </input> + <output> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </output> + </operation> + + <!-- echoBoolean rpc operation --> + <operation name="echoBoolean"> + <soap11:operation soapAction="http://soapinterop.org/"/> + <input> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </input> + <output> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </output> + </operation> + + <!-- echoString rpc operation --> + <operation name="echoString"> + <soap11:operation soapAction="http://soapinterop.org/"/> + <input> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </input> + <output> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </output> + </operation> + + </binding> + + <service name="WhiteMesaSoapRpcLitTestSvc"> + + <port name="Soap11TestRpcLitPort" binding="tns:Soap11TestRpcLitBinding"> + <soap11:address location="http://www.whitemesa.net/test-rpc-lit"/> + </port> + + </service> + +</definitions> diff --git a/test/wsdl/rpc/test-rpc-lit12.wsdl b/test/wsdl/rpc/test-rpc-lit12.wsdl new file mode 100644 index 0000000000..901cde6f9c --- /dev/null +++ b/test/wsdl/rpc/test-rpc-lit12.wsdl @@ -0,0 +1,455 @@ +<?xml version="1.0"?> + +<definitions name="RPC-Literal-TestDefinitions" + targetNamespace="http://whitemesa.net/wsdl/rpc-lit-test" + xmlns="http://schemas.xmlsoap.org/wsdl/" + xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" + xmlns:soap11="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:tns="http://whitemesa.net/wsdl/rpc-lit-test" + xmlns:types="http://soapbuilders.org/rpc-lit-test/types" + xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> + <types> + <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapbuilders.org/rpc-lit-test/types"> + + <element name="stringItem" type="xsd:string" /> + <complexType name="ArrayOfstring"> + <sequence> + <element ref="types:stringItem" minOccurs="0" maxOccurs="unbounded"/> + </sequence> + </complexType> + + <complexType name="ArrayOfint"> + <sequence> + <element name="integer" type="xsd:int" minOccurs="0" maxOccurs="unbounded"/> + </sequence> + </complexType> + + <element name="structItem" type="types:SOAPStruct" /> + <complexType name="SOAPStruct"> + <all> + <element name="varString" type="xsd:string"/> + <element name="varInt" type="xsd:int"/> + <element name="varFloat" type="xsd:float"/> + </all> + </complexType> + + <complexType name="ArrayOfSOAPStruct"> + <sequence> + <element ref="types:structItem" minOccurs="0" maxOccurs="unbounded"/> + </sequence> + </complexType> + + <complexType name="SOAPStructStruct"> + <all> + <element name="varString" type="xsd:string"/> + <element name="varInt" type="xsd:int"/> + <element name="varFloat" type="xsd:float"/> + <element ref="types:structItem" /> + </all> + </complexType> + + <complexType name="SOAPArrayStruct"> + <all> + <element name="varString" type="xsd:string"/> + <element name="varInt" type="xsd:int"/> + <element name="varFloat" type="xsd:float"/> + <element name="varArray" type="types:ArrayOfstring"/> + </all> + </complexType> + + </schema> + + </types> + + <!-- echoStruct rpc operation --> + <message name="echoStructRequest"> + <part name="inputStruct" type="types:SOAPStruct"/> + </message> + <message name="echoStructResponse"> + <part name="return" type="types:SOAPStruct"/> + </message> + + <!-- echoStructArray rpc operation --> + <message name="echoStructArrayRequest"> + <part name="inputStructArray" type="types:ArrayOfSOAPStruct"/> + </message> + <message name="echoStructArrayResponse"> + <part name="return" type="types:ArrayOfSOAPStruct"/> + </message> + + <!-- echoStructAsSimpleTypes rpc operation --> + <message name="echoStructAsSimpleTypesRequest"> + <part name="inputStruct" type="types:SOAPStruct"/> + </message> + <message name="echoStructAsSimpleTypesResponse"> + <part name="outputString" type="xsd:string"/> + <part name="outputInteger" type="xsd:int"/> + <part name="outputFloat" type="xsd:float"/> + </message> + + <!-- echoSimpleTypesAsStruct rpc operation --> + <message name="echoSimpleTypesAsStructRequest"> + <part name="inputString" type="xsd:string"/> + <part name="inputInteger" type="xsd:int"/> + <part name="inputFloat" type="xsd:float"/> + </message> + <message name="echoSimpleTypesAsStructResponse"> + <part name="return" type="types:SOAPStruct"/> + </message> + + <!-- echoNestedStruct rpc operation --> + <message name="echoNestedStructRequest"> + <part name="inputStruct" type="types:SOAPStructStruct"/> + </message> + <message name="echoNestedStructResponse"> + <part name="return" type="types:SOAPStructStruct"/> + </message> + + <!-- echoNestedArray rpc operation --> + <message name="echoNestedArrayRequest"> + <part name="inputStruct" type="types:SOAPArrayStruct"/> + </message> + <message name="echoNestedArrayResponse"> + <part name="return" type="types:SOAPArrayStruct"/> + </message> + + <!-- echoStringArray rpc operation --> + <message name="echoStringArrayRequest"> + <part name="inputStringArray" type="types:ArrayOfstring"/> + </message> + <message name="echoStringArrayResponse"> + <part name="return" type="types:ArrayOfstring"/> + </message> + + <!-- echoIntegerArray rpc operation --> + <message name="echoIntegerArrayRequest"> + <part name="inputIntegerArray" type="types:ArrayOfint"/> + </message> + <message name="echoIntegerArrayResponse"> + <part name="return" type="types:ArrayOfint"/> + </message> + + <!-- echoBoolean rpc operation --> + <message name="echoBooleanRequest"> + <part name="inputBoolean" type="xsd:boolean"/> + </message> + <message name="echoBooleanResponse"> + <part name="return" type="xsd:boolean"/> + </message> + + <!-- echoString rpc operation --> + <message name="echoStringRequest"> + <part name="inputString" type="xsd:string"/> + </message> + <message name="echoStringResponse"> + <part name="return" type="xsd:string"/> + </message> + + + <portType name="SoapTestPortTypeRpc"> + + <!-- echoStruct rpc operation --> + <operation name="echoStruct" parameterOrder="inputStruct"> + <input message="tns:echoStructRequest"/> + <output message="tns:echoStructResponse"/> + </operation> + + <!-- echoStructArray rpc operation --> + <operation name="echoStructArray" parameterOrder="inputStructArray"> + <input message="tns:echoStructArrayRequest"/> + <output message="tns:echoStructArrayResponse"/> + </operation> + + <!-- echoStructAsSimpleTypes rpc operation --> + <operation name="echoStructAsSimpleTypes" parameterOrder="inputStruct outputString outputInteger outputFloat"> + <input message="tns:echoStructAsSimpleTypesRequest"/> + <output message="tns:echoStructAsSimpleTypesResponse"/> + </operation> + + <!-- echoSimpleTypesAsStruct rpc operation --> + <operation name="echoSimpleTypesAsStruct" parameterOrder="inputString inputInteger inputFloat"> + <input message="tns:echoSimpleTypesAsStructRequest"/> + <output message="tns:echoSimpleTypesAsStructResponse"/> + </operation> + + <!-- echoNestedStruct rpc operation --> + <operation name="echoNestedStruct" parameterOrder="inputStruct"> + <input message="tns:echoNestedStructRequest"/> + <output message="tns:echoNestedStructResponse"/> + </operation> + + <!-- echoNestedArray rpc operation --> + <operation name="echoNestedArray" parameterOrder="inputStruct"> + <input message="tns:echoNestedArrayRequest"/> + <output message="tns:echoNestedArrayResponse"/> + </operation> + + <!-- echoStringArray rpc operation --> + <operation name="echoStringArray" parameterOrder="inputStringArray"> + <input message="tns:echoStringArrayRequest"/> + <output message="tns:echoStringArrayResponse"/> + </operation> + + <!-- echoIntegerArray rpc operation --> + <operation name="echoIntegerArray" parameterOrder="inputIntegerArray"> + <input message="tns:echoIntegerArrayRequest"/> + <output message="tns:echoIntegerArrayResponse"/> + </operation> + + <!-- echoBoolean rpc operation --> + <operation name="echoBoolean" parameterOrder="inputBoolean"> + <input message="tns:echoBooleanRequest"/> + <output message="tns:echoBooleanResponse"/> + </operation> + + <!-- echoString rpc operation --> + <operation name="echoString" parameterOrder="inputString"> + <input message="tns:echoStringRequest"/> + <output message="tns:echoStringResponse"/> + </operation> + + </portType> + + <binding name="Soap11TestRpcLitBinding" type="tns:SoapTestPortTypeRpc"> + <soap11:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> + + <!-- echoStruct rpc operation --> + <operation name="echoStruct"> + <soap11:operation soapAction="http://soapinterop.org/"/> + <input> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </input> + <output> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </output> + </operation> + + <!-- echoStructArray rpc operation --> + <operation name="echoStructArray"> + <soap11:operation soapAction="http://soapinterop.org/"/> + <input> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </input> + <output> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </output> + </operation> + + <!-- echoStructAsSimpleTypes rpc operation --> + <operation name="echoStructAsSimpleTypes"> + <soap11:operation soapAction="http://soapinterop.org/"/> + <input> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </input> + <output> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </output> + </operation> + + <!-- echoSimpleTypesAsStruct rpc operation --> + <operation name="echoSimpleTypesAsStruct"> + <soap11:operation soapAction="http://soapinterop.org/"/> + <input> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </input> + <output> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </output> + </operation> + + <!-- echoNestedStruct rpc operation --> + <operation name="echoNestedStruct"> + <soap11:operation soapAction="http://soapinterop.org/"/> + <input> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </input> + <output> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </output> + </operation> + + <!-- echoNestedArray rpc operation --> + <operation name="echoNestedArray"> + <soap11:operation soapAction="http://soapinterop.org/"/> + <input> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </input> + <output> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </output> + </operation> + + <!-- echoStringArray rpc operation --> + <operation name="echoStringArray"> + <soap11:operation soapAction="http://soapinterop.org/"/> + <input> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </input> + <output> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </output> + </operation> + + <!-- echoIntegerArray rpc operation --> + <operation name="echoIntegerArray"> + <soap11:operation soapAction="http://soapinterop.org/"/> + <input> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </input> + <output> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </output> + </operation> + + <!-- echoBoolean rpc operation --> + <operation name="echoBoolean"> + <soap11:operation soapAction="http://soapinterop.org/"/> + <input> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </input> + <output> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </output> + </operation> + + <!-- echoString rpc operation --> + <operation name="echoString"> + <soap11:operation soapAction="http://soapinterop.org/"/> + <input> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </input> + <output> + <soap11:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </output> + </operation> + + </binding> + + <binding name="Soap12TestRpcLitBinding" type="tns:SoapTestPortTypeRpc"> + <soap12:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> + + <!-- echoStruct rpc operation --> + <operation name="echoStruct"> + <soap12:operation/> + <input> + <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </input> + <output> + <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </output> + </operation> + + <!-- echoStructArray rpc operation --> + <operation name="echoStructArray"> + <soap12:operation/> + <input> + <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </input> + <output> + <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </output> + </operation> + + <!-- echoStructAsSimpleTypes rpc operation --> + <operation name="echoStructAsSimpleTypes"> + <soap12:operation/> + <input> + <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </input> + <output> + <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </output> + </operation> + + <!-- echoSimpleTypesAsStruct rpc operation --> + <operation name="echoSimpleTypesAsStruct"> + <soap12:operation/> + <input> + <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </input> + <output> + <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </output> + </operation> + + <!-- echoNestedStruct rpc operation --> + <operation name="echoNestedStruct"> + <soap12:operation/> + <input> + <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </input> + <output> + <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </output> + </operation> + + <!-- echoNestedArray rpc operation --> + <operation name="echoNestedArray"> + <soap12:operation/> + <input> + <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </input> + <output> + <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </output> + </operation> + + <!-- echoStringArray rpc operation --> + <operation name="echoStringArray"> + <soap12:operation/> + <input> + <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </input> + <output> + <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </output> + </operation> + + <!-- echoIntegerArray rpc operation --> + <operation name="echoIntegerArray"> + <soap12:operation/> + <input> + <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </input> + <output> + <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </output> + </operation> + + <!-- echoBoolean rpc operation --> + <operation name="echoBoolean"> + <soap12:operation/> + <input> + <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </input> + <output> + <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </output> + </operation> + + <!-- echoString rpc operation --> + <operation name="echoString"> + <soap12:operation/> + <input> + <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </input> + <output> + <soap12:body use="literal" namespace="http://soapbuilders.org/rpc-lit-test" /> + </output> + </operation> + + </binding> + + <service name="WhiteMesaSoapRpcLitTestSvc"> + + <port name="Soap12TestRpcLitPort" binding="tns:Soap12TestRpcLitBinding"> + <soap12:address location="http://www.whitemesa.net/soap12/test-rpc-lit"/> + </port> + <port name="Soap11TestRpcLitPort" binding="tns:Soap11TestRpcLitBinding"> + <soap11:address location="http://www.whitemesa.net/test-rpc-lit"/> + </port> + + </service> + +</definitions> diff --git a/test/wsdl/rpc/test_rpc_lit.rb b/test/wsdl/rpc/test_rpc_lit.rb new file mode 100644 index 0000000000..080dbb82cf --- /dev/null +++ b/test/wsdl/rpc/test_rpc_lit.rb @@ -0,0 +1,399 @@ +require 'test/unit' +require 'wsdl/soap/wsdl2ruby' +require 'soap/rpc/standaloneServer' +require 'soap/wsdlDriver' + +if defined?(HTTPAccess2) and defined?(OpenSSL) + +module WSDL; module RPC + + +class TestRPCLIT < Test::Unit::TestCase + class Server < ::SOAP::RPC::StandaloneServer + Namespace = "http://soapbuilders.org/rpc-lit-test" + + def on_init + self.generate_explicit_type = false + add_rpc_operation(self, + XSD::QName.new(Namespace, 'echoStringArray'), + nil, + 'echoStringArray', [ + ['in', 'inputStringArray', nil], + ['retval', 'return', nil] + ], + { + :request_style => :rpc, + :request_use => :literal, + :response_style => :rpc, + :response_use => :literal + } + ) + add_rpc_operation(self, + XSD::QName.new(Namespace, 'echoStringArrayInline'), + nil, + 'echoStringArrayInline', [ + ['in', 'inputStringArray', nil], + ['retval', 'return', nil] + ], + { + :request_style => :rpc, + :request_use => :literal, + :response_style => :rpc, + :response_use => :literal + } + ) + add_rpc_operation(self, + XSD::QName.new(Namespace, 'echoNestedStruct'), + nil, + 'echoNestedStruct', [ + ['in', 'inputNestedStruct', nil], + ['retval', 'return', nil] + ], + { + :request_style => :rpc, + :request_use => :literal, + :response_style => :rpc, + :response_use => :literal + } + ) + add_rpc_operation(self, + XSD::QName.new(Namespace, 'echoStructArray'), + nil, + 'echoStructArray', [ + ['in', 'inputStructArray', nil], + ['retval', 'return', nil] + ], + { + :request_style => :rpc, + :request_use => :literal, + :response_style => :rpc, + :response_use => :literal + } + ) + end + + def echoStringArray(strings) + # strings.stringItem => Array + ArrayOfstring[*strings.stringItem] + end + + def echoStringArrayInline(strings) + ArrayOfstringInline[*strings.stringItem] + end + + def echoNestedStruct(struct) + struct + end + + def echoStructArray(ary) + ary + end + end + + DIR = File.dirname(File.expand_path(__FILE__)) + + Port = 17171 + + def setup + setup_server + setup_classdef + @client = nil + end + + def teardown + teardown_server + unless $DEBUG + File.unlink(pathname('RPC-Literal-TestDefinitions.rb')) + File.unlink(pathname('RPC-Literal-TestDefinitionsDriver.rb')) + end + @client.reset_stream if @client + end + + def setup_server + @server = Server.new('Test', Server::Namespace, '0.0.0.0', Port) + @server.level = Logger::Severity::ERROR + @server_thread = start_server_thread(@server) + end + + def setup_classdef + gen = WSDL::SOAP::WSDL2Ruby.new + gen.location = pathname("test-rpc-lit.wsdl") + gen.basedir = DIR + gen.logger.level = Logger::FATAL + gen.opt['classdef'] = nil + gen.opt['driver'] = nil + gen.opt['force'] = true + gen.run + backupdir = Dir.pwd + begin + Dir.chdir(DIR) + require pathname('RPC-Literal-TestDefinitions.rb') + require pathname('RPC-Literal-TestDefinitionsDriver.rb') + ensure + Dir.chdir(backupdir) + end + end + + def teardown_server + @server.shutdown + @server_thread.kill + @server_thread.join + end + + def start_server_thread(server) + t = Thread.new { + Thread.current.abort_on_exception = true + server.start + } + t + end + + def pathname(filename) + File.join(DIR, filename) + end + + def test_wsdl_echoStringArray + wsdl = pathname('test-rpc-lit.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = STDOUT if $DEBUG + # response contains only 1 part. + result = @client.echoStringArray(ArrayOfstring["a", "b", "c"])[0] + assert_equal(["a", "b", "c"], result.stringItem) + end + + ECHO_STRING_ARRAY_REQUEST = +%q[<?xml version="1.0" encoding="utf-8" ?> +<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <env:Body> + <n1:echoStringArray xmlns:n1="http://soapbuilders.org/rpc-lit-test"> + <inputStringArray xmlns:n2="http://soapbuilders.org/rpc-lit-test/types"> + <n2:stringItem>a</n2:stringItem> + <n2:stringItem>b</n2:stringItem> + <n2:stringItem>c</n2:stringItem> + </inputStringArray> + </n1:echoStringArray> + </env:Body> +</env:Envelope>] + + ECHO_STRING_ARRAY_RESPONSE = +%q[<?xml version="1.0" encoding="utf-8" ?> +<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <env:Body> + <n1:echoStringArrayResponse xmlns:n1="http://soapbuilders.org/rpc-lit-test"> + <return xmlns:n2="http://soapbuilders.org/rpc-lit-test/types"> + <n2:stringItem>a</n2:stringItem> + <n2:stringItem>b</n2:stringItem> + <n2:stringItem>c</n2:stringItem> + </return> + </n1:echoStringArrayResponse> + </env:Body> +</env:Envelope>] + + def test_stub_echoStringArray + drv = SoapTestPortTypeRpc.new("http://localhost:#{Port}/") + drv.wiredump_dev = str = '' + # response contains only 1 part. + result = drv.echoStringArray(ArrayOfstring["a", "b", "c"])[0] + assert_equal(["a", "b", "c"], result.stringItem) + assert_equal(ECHO_STRING_ARRAY_REQUEST, parse_requestxml(str)) + assert_equal(ECHO_STRING_ARRAY_RESPONSE, parse_responsexml(str)) + end + + ECHO_STRING_ARRAY_INLINE_REQUEST = +%q[<?xml version="1.0" encoding="utf-8" ?> +<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <env:Body> + <n1:echoStringArrayInline xmlns:n1="http://soapbuilders.org/rpc-lit-test"> + <inputStringArray> + <stringItem>a</stringItem> + <stringItem>b</stringItem> + <stringItem>c</stringItem> + </inputStringArray> + </n1:echoStringArrayInline> + </env:Body> +</env:Envelope>] + + ECHO_STRING_ARRAY_INLINE_RESPONSE = +%q[<?xml version="1.0" encoding="utf-8" ?> +<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <env:Body> + <n1:echoStringArrayInlineResponse xmlns:n1="http://soapbuilders.org/rpc-lit-test"> + <return> + <stringItem>a</stringItem> + <stringItem>b</stringItem> + <stringItem>c</stringItem> + </return> + </n1:echoStringArrayInlineResponse> + </env:Body> +</env:Envelope>] + + def test_stub_echoStringArrayInline + drv = SoapTestPortTypeRpc.new("http://localhost:#{Port}/") + drv.wiredump_dev = str = '' + # response contains only 1 part. + result = drv.echoStringArrayInline(ArrayOfstringInline["a", "b", "c"])[0] + assert_equal(["a", "b", "c"], result.stringItem) + assert_equal(ECHO_STRING_ARRAY_INLINE_REQUEST, parse_requestxml(str)) + assert_equal(ECHO_STRING_ARRAY_INLINE_RESPONSE, parse_responsexml(str)) + end + + ECHO_NESTED_STRUCT_REQUEST = +%q[<?xml version="1.0" encoding="utf-8" ?> +<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <env:Body> + <n1:echoNestedStruct xmlns:n1="http://soapbuilders.org/rpc-lit-test"> + <inputStruct xmlns:n2="http://soapbuilders.org/rpc-lit-test/types"> + <varString>str</varString> + <varInt>1</varInt> + <varFloat>+1</varFloat> + <n2:structItem> + <varString>str</varString> + <varInt>1</varInt> + <varFloat>+1</varFloat> + </n2:structItem> + </inputStruct> + </n1:echoNestedStruct> + </env:Body> +</env:Envelope>] + + ECHO_NESTED_STRUCT_RESPONSE = +%q[<?xml version="1.0" encoding="utf-8" ?> +<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <env:Body> + <n1:echoNestedStructResponse xmlns:n1="http://soapbuilders.org/rpc-lit-test"> + <return xmlns:n2="http://soapbuilders.org/rpc-lit-test/types"> + <varString>str</varString> + <varInt>1</varInt> + <varFloat>+1</varFloat> + <n2:structItem> + <varString>str</varString> + <varInt>1</varInt> + <varFloat>+1</varFloat> + </n2:structItem> + </return> + </n1:echoNestedStructResponse> + </env:Body> +</env:Envelope>] + + def test_wsdl_echoNestedStruct + wsdl = pathname('test-rpc-lit.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = str = '' + # response contains only 1 part. + result = @client.echoNestedStruct(SOAPStructStruct.new("str", 1, 1.0, SOAPStruct.new("str", 1, 1.0)))[0] + assert_equal('str', result.varString) + assert_equal('1', result.varInt) + assert_equal('+1', result.varFloat) + assert_equal('str', result.structItem.varString) + assert_equal('1', result.structItem.varInt) + assert_equal('+1', result.structItem.varFloat) + assert_equal(ECHO_NESTED_STRUCT_REQUEST, parse_requestxml(str)) + assert_equal(ECHO_NESTED_STRUCT_RESPONSE, parse_responsexml(str)) + end + + def test_stub_echoNestedStruct + drv = SoapTestPortTypeRpc.new("http://localhost:#{Port}/") + drv.wiredump_dev = str = '' + # response contains only 1 part. + result = drv.echoNestedStruct(SOAPStructStruct.new("str", 1, 1.0, SOAPStruct.new("str", 1, 1.0)))[0] + assert_equal('str', result.varString) + assert_equal('1', result.varInt) + assert_equal('+1', result.varFloat) + assert_equal('str', result.structItem.varString) + assert_equal('1', result.structItem.varInt) + assert_equal('+1', result.structItem.varFloat) + assert_equal(ECHO_NESTED_STRUCT_REQUEST, parse_requestxml(str)) + assert_equal(ECHO_NESTED_STRUCT_RESPONSE, parse_responsexml(str)) + end + + ECHO_STRUCT_ARRAY_REQUEST = +%q[<?xml version="1.0" encoding="utf-8" ?> +<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <env:Body> + <n1:echoStructArray xmlns:n1="http://soapbuilders.org/rpc-lit-test"> + <inputStructArray xmlns:n2="http://soapbuilders.org/rpc-lit-test/types"> + <n2:structItem> + <varString>str</varString> + <varInt>2</varInt> + <varFloat>+2.1</varFloat> + </n2:structItem> + <n2:structItem> + <varString>str</varString> + <varInt>2</varInt> + <varFloat>+2.1</varFloat> + </n2:structItem> + </inputStructArray> + </n1:echoStructArray> + </env:Body> +</env:Envelope>] + + ECHO_STRUCT_ARRAY_RESPONSE = +%q[<?xml version="1.0" encoding="utf-8" ?> +<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <env:Body> + <n1:echoStructArrayResponse xmlns:n1="http://soapbuilders.org/rpc-lit-test"> + <return xmlns:n2="http://soapbuilders.org/rpc-lit-test/types"> + <n2:structItem> + <varString>str</varString> + <varInt>2</varInt> + <varFloat>+2.1</varFloat> + </n2:structItem> + <n2:structItem> + <varString>str</varString> + <varInt>2</varInt> + <varFloat>+2.1</varFloat> + </n2:structItem> + </return> + </n1:echoStructArrayResponse> + </env:Body> +</env:Envelope>] + + def test_wsdl_echoStructArray + wsdl = pathname('test-rpc-lit.wsdl') + @client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver + @client.endpoint_url = "http://localhost:#{Port}/" + @client.wiredump_dev = str = '' + # response contains only 1 part. + e = SOAPStruct.new("str", 2, 2.1) + result = @client.echoStructArray(ArrayOfSOAPStruct[e, e]) + assert_equal(ECHO_STRUCT_ARRAY_REQUEST, parse_requestxml(str)) + assert_equal(ECHO_STRUCT_ARRAY_RESPONSE, parse_responsexml(str)) + end + + def test_stub_echoStructArray + drv = SoapTestPortTypeRpc.new("http://localhost:#{Port}/") + drv.wiredump_dev = str = '' + # response contains only 1 part. + e = SOAPStruct.new("str", 2, 2.1) + result = drv.echoStructArray(ArrayOfSOAPStruct[e, e]) + assert_equal(ECHO_STRUCT_ARRAY_REQUEST, parse_requestxml(str)) + assert_equal(ECHO_STRUCT_ARRAY_RESPONSE, parse_responsexml(str)) + end + + def parse_requestxml(str) + str.split(/\r?\n\r?\n/)[3] + end + + def parse_responsexml(str) + str.split(/\r?\n\r?\n/)[6] + end +end + + +end; end + +end |