Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

Ticket #81 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

the latest experimental doc/lit support creates few problems with rpc/encoded services

Reported by: nahi Assigned to: nahi
Priority: high Milestone: 1.5.4
Component: soap4r Version: 1.5
Keywords: Cc:

Description

Perhaps I missed something, but it looks that the latest experimental doc/lit support creates few problems with rpc/encoded services.

Specifically, the method name passsed in rpc/encoded messages looks wrong. It appears that the the doc/lit schema of determining the operation is used for rpc/services too.

Consider the following rpc/encoded wsdl (explanation after the the wsdl):

<?xml version='1.0' encoding='UTF-8'?>
<!--generated by GLUE Standard 4.0.1 on Wed Mar 09 10:20:07 GMT-08:00
2005-->
<wsdl:definitions name='Calculator'
targetNamespace='http://www.themindelectric.com/wsdl/Calculator/'
    xmlns:tns='http://www.themindelectric.com/wsdl/Calculator/'
    xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
    xmlns:http='http://schemas.xmlsoap.org/wsdl/http/'
    xmlns:mime='http://schemas.xmlsoap.org/wsdl/mime/'
    xmlns:xsd='http://www.w3.org/2001/XMLSchema'
    xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/'
    xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
    xmlns:tme='http://www.themindelectric.com/'>
    <wsdl:message name='add0In'>
        <wsdl:part name='x' type='xsd:float'/>
        <wsdl:part name='y' type='xsd:float'/>
    </wsdl:message>
    <wsdl:message name='add0Out'>
        <wsdl:part name='Result' type='xsd:float'/>
    </wsdl:message>
    <wsdl:message name='divide1In'>
        <wsdl:part name='numerator' type='xsd:float'/>
        <wsdl:part name='denominator' type='xsd:float'/>
    </wsdl:message>
    <wsdl:message name='divide1Out'>
        <wsdl:part name='Result' type='xsd:float'/>
    </wsdl:message>
    <wsdl:message name='multiply2In'>
        <wsdl:part name='x' type='xsd:float'/>
        <wsdl:part name='y' type='xsd:float'/>
    </wsdl:message>
    <wsdl:message name='multiply2Out'>
        <wsdl:part name='Result' type='xsd:float'/>
    </wsdl:message>
    <wsdl:message name='subtract3In'>
        <wsdl:part name='x' type='xsd:float'/>
        <wsdl:part name='y' type='xsd:float'/>
    </wsdl:message>
    <wsdl:message name='subtract3Out'>
        <wsdl:part name='Result' type='xsd:float'/>
    </wsdl:message>
    <wsdl:portType name='ICalculator'>
        <wsdl:operation name='add' parameterOrder='x y'>
            <wsdl:input name='add0In' message='tns:add0In'/>
            <wsdl:output name='add0Out' message='tns:add0Out'/>
        </wsdl:operation>
        <wsdl:operation name='divide' parameterOrder='numerator
denominator'>
            <wsdl:input name='divide1In' message='tns:divide1In'/>
            <wsdl:output name='divide1Out' message='tns:divide1Out'/>
        </wsdl:operation>
        <wsdl:operation name='multiply' parameterOrder='x y'>
            <wsdl:input name='multiply2In' message='tns:multiply2In'/>
            <wsdl:output name='multiply2Out'
message='tns:multiply2Out'/>
        </wsdl:operation>
        <wsdl:operation name='subtract' parameterOrder='x y'>
            <wsdl:input name='subtract3In' message='tns:subtract3In'/>
            <wsdl:output name='subtract3Out'
message='tns:subtract3Out'/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name='ICalculator' type='tns:ICalculator'>
        <soap:binding style='rpc'
transport='http://schemas.xmlsoap.org/soap/http'/>
        <wsdl:operation name='add'>
            <soap:operation soapAction='add' style='rpc'/>
            <wsdl:input name='add0In'>
                <soap:body use='encoded'
namespace='http://www.fred.com'
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
            </wsdl:input>
            <wsdl:output name='add0Out'>
                <soap:body use='encoded'
namespace='http://www.fred.com'
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name='divide'>
            <soap:operation soapAction='divide' style='rpc'/>
            <wsdl:input name='divide1In'>
                <soap:body use='encoded'
namespace='http://www.fred.com'
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
            </wsdl:input>
            <wsdl:output name='divide1Out'>
                <soap:body use='encoded'
namespace='http://www.fred.com'
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name='multiply'>
            <soap:operation soapAction='multiply' style='rpc'/>
            <wsdl:input name='multiply2In'>
                <soap:body use='encoded'
namespace='http://www.fred.com'
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
            </wsdl:input>
            <wsdl:output name='multiply2Out'>
                <soap:body use='encoded'
namespace='http://www.fred.com'
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name='subtract'>
            <soap:operation soapAction='subtract' style='rpc'/>
            <wsdl:input name='subtract3In'>
                <soap:body use='encoded'
namespace='http://www.fred.com'
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
            </wsdl:input>
            <wsdl:output name='subtract3Out'>
                <soap:body use='encoded'
namespace='http://www.fred.com'
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name='Calculator'>
        <wsdl:documentation>calculator service</wsdl:documentation>
        <wsdl:port name='ICalculator' binding='tns:ICalculator'>
            <soap:address
location='http://ukulele:8080/calcapp/services/calculator'/>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>

The method name passed (first element of the body) is 'add0In', while ot should be 'add'. The add0In is the input message, and that usually corresponds to what the doc/lit services expect as a method name.

If I switch to WSDLDriverFactory#createDriver, there is a runtime error with number of arguments to constructor Mapping::WSDLEncodedRegistry in wsdlDriver.rb@275.

If I fix the constructor invocation (there is the expected constructor argument there - @rpc_decode_typemap), then the service invocation works, with the deprecated warning.

Here is the patch for the reference:

@@ -272,7 +272,7 @@
       @rpc_decode_typemap = @wsdl_types +
        @wsdl.soap_rpc_complextypes(port.find_binding)
       @wsdl_mapping_registry = Mapping::WSDLEncodedRegistry.new(
-        @rpc_decode_typemap, @wsdl_elements)
+        @rpc_decode_typemap)
       @doc_mapper = Mapping::WSDLLiteralRegistry.new(
         @wsdl_types, @wsdl_elements)
       endpoint_url = @port.soap_address.location

Best Regards,

Emil

Change History

04/14/05 18:07:52 changed by nahi

  • status changed from new to closed.
  • resolution set to fixed.

[1465] fixes this ticket.