[Xml-compile] Broken RPC/Literal support

Daniel Ruoso daniel at ruoso.com
Sat Apr 4 22:48:36 BST 2009


Hi,

I'm trying to get things working with the latest XML::Compile::SOAP, but
I'm having some trouble.

Considering the attached WSDL, the expected input message for the Greet
operation would look like:

<Envelope
 xmlns="http://schemas.xmlsoap.org/soap/envelope/">
 <Body>
  <Greet xmlns="">
   <hello:who  
    xmlns:hello="http://example.com/hello">World</hello:who>
   <hello:greeting  
    xmlns:hello="http://example.com/hello">Hello</hello:greeting>
  </Greet>
 </Body>
</Envelope>

That's because, as in the SOAP spec

        If the operation style is rpc each part is a parameter or a
        return value and appears inside a wrapper element within the
        body (following Section 7.1 of the SOAP specification). The
        wrapper element is named identically to the operation name and
        its namespace is the value of the namespace attribute. Each
        message part (parameter) appears under the wrapper, represented
        by an accessor named identically to the corresponding parameter
        of the call. Parts are arranged in the same order as the
        parameters of the call.

But XML::Compile is, instead of using the name of the operation as the
wrapper, taking the name of the message associated with that operation.
This is wrong, as the wrapper element is precisely the thing that
identifies which is the currently requested operation, and also makes it
impossible to share the message definition in more than one operation.

I understand some of you might be thinking that I should be using the
SOAPAction header instead, but contrary to general belief, the
SOAPAction attribute is not mandatory and is HTTP-specific (yes, there
are people using SOAP over other transports). As the spec says:

        The soapAction attribute specifies the value of the SOAPAction
        header for this operation. This URI value should be used
        directly as the value for the SOAPAction header; no attempt
        should be made to make a relative URI value absolute when making
        the request. For the HTTP protocol binding of SOAP, this is
        value required (it has no default value). For other SOAP
        protocol bindings, it MUST NOT be specified, and the
        soap:operation element MAY be omitted.

I've made a hack for that to work before, and already mentioned at that
time (I don't remeber where, maybe in a private mail to markov) how this
hack was working. And when XML::Compile::SOAP was upgraded, that hack
stopped working (it's a hack after all), because the options "rpcin" and
"rpcout" no longer exist in the method compileClient for the operation
returned by the WSDL. XML::Compile::SOAP::Client documentation mentions
"encode" and "decode" options, but they are not used by compileClient.

How to fix this?

daniel


daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hello4.wsdl
Type: application/xml
Size: 2090 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/xml-compile/attachments/20090404/f12590bb/hello4.xml


More information about the Xml-compile mailing list