[MOBY-dev] More info on SOAP::Lite document/literal

Jason Stewart jason.e.stewart at gmail.com
Wed Sep 10 14:28:16 UTC 2008


Hey Eddie,

So I dug a bit on the server side and this is what I found.

If your server class subclasses from SOAP::Server::Parameters, the
method will get an extra parameter of type SOAP::SOM which gives
access to all the request information. That object contains a lot of
methods for searching the soap envelope - but it converts all the data
it finds into a SOAP::Data instance - which throws away all attributes
not located at the root of the data being returned. For example if the
XML looked like this:

<soap:Body>
  <q0:sayHello xmlns="urn:HelloWorld#">
    <name>Joe Blow</name>
    <givenName middlename="Windy">Joe</givenName>
  </q0:sayHello>
</soap:Body>

and we did a query like $root = $som->dataof('//Body'), then $root
would be the soap:Body and we would see all of the sub-elements but
not their attributes. Only if we do $gn = $som->dataof('//givenName')
do we actually get the givenName element with the middlename attribute
still intact.

But the $som object has all the information in an internal hash table
- both as a hash table representation of the entire message and the
HTTP::Request object with the original XML.

What I don't understand is why when the dataof() method traverses the
internal hash table structure it throws away all the attributes not on
the root element being returned.

Also, I don't understand why there isn't a method that just returns
the content of the soap:Body element as plain XML - this should be the
default behavior for document/literal. I would like to see a call
something like $xml = $som->document();

Any thoughts of how I could make this interface most useful for MOBY
purposes? I will have to alter the internal SOAP::Lite code, and send
the patches to the maintainers.

Cheers, jas.



More information about the MOBY-dev mailing list