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

José María Fernández González jmfernandez at cnio.es
Wed Sep 10 15:06:50 UTC 2008


Hi Jason,
	when we were developing the Perl MOBY::Async libraries we had the same 
problem (we needed to access to the full input message), and we solved it 
using custom deserializers fom WSRF::Lite package. Next sentences set-up them:

my $server = new SOAP::Transport::HTTP::CGI;
$server->serializer(WSRF::Serializer->new);
$server->deserializer(WSRF::Deserializer->new);

	WSRF::Serializer and WSRF::Deserializer are subclasses of SOAP::Serializer 
and SOAP::Deserializer, respectively. SOAP::Deserializer translates input SOAP 
message into a SOAP::SOM instance. WSRF::Deserializer translates input SOAP 
message into a WSRF::SOM instance, which is a SOAP::SOM instance plus a new 
method called 'raw_xml'. This method returns the raw input message, which can 
be parsed with XML::LibXML (for instance).

	Hope this helps,
		José María

Jason Stewart wrote:
> 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.
> _______________________________________________
> MOBY-dev mailing list
> MOBY-dev at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/moby-dev
> 

-- 
"There is no reason why anybody would want a computer in their home" -
	Ken Olson, founder of DEC 1977
"640K ought to be enough for anybody" - Bill Gates, 1981
"Nobody will ever outgrow a 20Mb hard drive." - ???

"Premature optimization is the root of all evil." - Donald Knuth

José María Fernández González
Tlfn: (+34) 91 732 80 00 / 91 224 69 00 (ext 3061)
e-mail: jmfernandez at cnio.es		Fax: (+34) 91 224 69 76
Unidad del Instituto Nacional de Bioinformática
Biología Estructural y Biocomputación	Structural Biology and Biocomputing
Centro Nacional de Investigaciones Oncológicas
C.P.: 28029				Zip Code: 28029
C/. Melchor Fernández Almagro, 3	Madrid (Spain)

**NOTA DE CONFIDENCIALIDAD** Este correo electrónico, y en su caso los ficheros adjuntos, pueden contener información protegida para el uso exclusivo de su destinatario. Se prohíbe la distribución, reproducción o cualquier otro tipo de transmisión por parte de otra persona que no sea el destinatario. Si usted recibe por error este correo, se ruega comunicarlo al remitente y borrar el mensaje recibido.
**CONFIDENTIALITY NOTICE** This email communication and any attachments may contain confidential and privileged information for the sole use of the designated recipient named above. Distribution, reproduction or any other use of this transmission by any party other than the intended recipient is prohibited. If you are not the intended recipient please contact the sender and delete all copies.




More information about the MOBY-dev mailing list