[MOBY-dev] BioMOBY working with new SOAP:Lite! [was Re: Perl API and BioMOBY Central WSDL: BioMOBY with new "stable" SOAP::Lite broken...]

Pieter Neerincx Pieter.Neerincx at wur.nl
Wed Jun 7 17:24:35 UTC 2006


Hi all,

This is mostly of interest for the Perl Mobifiers on the list. The  
others better skip this...

On 2-Feb-2006, at 6:12 PM, Pieter Neerincx wrote:

>
> On 1-Feb-2006, at 8:47 PM, Mark Wilkinson wrote:
>
>> On Mon, 2006-01-30 at 17:53 +0100, Pieter Neerincx wrote:
>>
>>> No I think you got it right. S::L shouldn't mess it up, but I can
>>> predict that fixing it by changing the prefix in BioMOBY is much
>>> faster than trying to get a fix into the next "stable" release of
>>> S::L.
>>
>> Please go ahead with this change.
>
> Ok I'll change the prefix for that namespace from soap to wsoap then.

I have to admit that didn't happen yet. It wasn't a complete fix  
anyway, but this thread is back and I think I found a way to make the  
BioMOBY modules work with both the old and new versions of S::L and  
hopefully remain compatible with Java/Python/whatever Mobifiers :).  
(It should but I haven't tested that thoroughly yet). It is still  
necessary to change the prefix for that namespace from "soap" to  
something else. Combined with the proposed changes below that should  
make the BioMOBY modules compatible with S::L 0.60+.

>
>>
>> The other problems are a bit more frustrating, and harder to deal
>> with!
>> It isn't just a question of being S::L compatible, it's also a
>> question
>> of doing the right thing, since we have to be compatible with the
>> Java/Python libraries as well.  If S::L is wrong, then we need to  
>> push
>> them to change; if *we* are wrong, then we need to recognize that and
>> fix the message structure.
>>
>> I need to do some more reading to figure out which is the case.
>
> Ok, please let me know what you think. As far as I understand it, the
> problem with that 'anyURI' thing is a S::L bug, but for the one with
> the double encoding I'm not sure. It doesn't really matter who
> encodes the string as long as not both the BioMOBY Perl modules and
> S::L try to do it...

After a lot of digging in the code I think that the 'anyURI' and the  
double encoding problem are not easily classifiable. Some will call  
it a bug (for us it is!), but for others it might be a feature. The  
best way to get rid off both problems is not to rely on the S::L  
autotyper and send "raw" xml to S::L. If we do the encoding ourselves  
(like we did before) and use S::L *only* to transfer the data and not  
to encode it, it works fine. My problem was how to get that done as  
the documentation on how to do that is rather limited. Attached to  
this e-mail you will find a zipped archive with a patched:
MOBY::Central.pm,
MOBY::CommonSubs.pm,
MOBY::Client::Central.pm and
MOBY::Client::Service.pm

The big picture:
Everywhere where a SOAP call is made I've changed the code to do  
something like this:

   #
   # Encode content & create SOAP::Data object of type 'xml'.
   # We do the encoding ourselves and send raw XML using SOAP::Lite.
   # By sending raw XML, we don't have to rely on the SOAP::Lite  
autotyper,
   # which automatically messes-up in SOAP::Lite versions > 0.60.
   #
   my $xml_object_ref = MOBY::CommonSubs::makeSoapDataObject($data);
   my @payload = $connect->call( $method => $xml_object_ref )- 
 >paramsall;

Where data is returned it is now something like this:

   my $xml_object_ref = MOBY::CommonSubs::makeSoapDataObject($message);
   return $xml_object_ref;

MOBY::CommonSubs::makeSoapDataObject creates a SOAP::Data object of  
type (raw) 'xml':

   sub makeSoapDataObject {

     my ($xml) = @_;

     #
     # Encode content.
     # We do the encoding ourselves and send raw XML using SOAP::Lite.
     # By sending raw XML, we don't have to rely on the SOAP::Lite  
autotyper,
     # which automatically messes-up in SOAP::Lite versions > 0.60.
     #
     $xml =~ s"&"&"g;
     $xml =~ s"\<"&lt;"g;
     $xml =~ s"\]\]\>"\]\]&gt;"g;

     # Specify the data type 'xml' to send raw XML and bypass the  
SOAP::Lite autotyper.
     $xml = SOAP::Data->type('xml' => $xml);

     # Return a reference to the SOAP::Data object.
     # It is essential to return a ref and not the object itself,
     # as the latter will fail for objects of type 'xml'.
     return \$xml;

   }

I changed some other small bits as well. Since these changes have an  
effect on all the messaging (service/object registration, service/ 
object discovery and service execution) I didn't dare to commit this  
to the CVS yet. If I overlooked something and it breaks, it messes up  
really bad :(. Could other Perl Mobifiers please have look at it and  
give it a try? Please let me know if it works for you or not and  
which version of S::L you used...

Thanks,

Pi

-------------- next part --------------
A non-text attachment was scrubbed...
Name: MOBY.zip
Type: application/zip
Size: 66119 bytes
Desc: not available
URL: <http://lists.open-bio.org/pipermail/moby-dev/attachments/20060607/4355d985/attachment-0002.zip>
-------------- next part --------------


>
> Pi
>
>
>> M
>>
>>
>> -- 
>> --
>> ...his last words were 'Hey guys!  Watch this!'
>> --
>> Mark Wilkinson
>> Asst. Professor
>> Dept. of Medical Genetics
>> University of British Columbia
>> PI in Bioinformatics
>> iCAPTURE Centre
>> St. Paul's Hospital
>> Rm. 166, 1081 Burrard St.
>> Vancouver, BC, V6Z 1Y6
>> tel: 604 682 2344 x62129
>> fax: 604 806 9274
>>
>> "For most of this century we have viewed communications as a conduit,
>>        a pipe between physical locations on the planet.
>> What's happened now is that the conduit has become so big and
>> interesting
>>       that communication has become more than a conduit,
>>        it has become a destination in its own right..."
>>
>>                 Paul Saffo - Director, Institute for the Future
>>
>> _______________________________________________
>> MOBY-dev mailing list
>> MOBY-dev at biomoby.org
>> http://biomoby.org/mailman/listinfo/moby-dev
>
>
> Wageningen University and Research centre (WUR)
> Laboratory of Bioinformatics
> Transitorium (building 312) room 1034
> Dreijenlaan 3
> 6703 HA Wageningen
> The Netherlands
> phone: 0317-483 060
> fax: 0317-483 584
> mobile: 06-143 66 783
> pieter.neerincx at wur.nl
>
>
>
> _______________________________________________
> MOBY-dev mailing list
> MOBY-dev at biomoby.org
> http://biomoby.org/mailman/listinfo/moby-dev


Wageningen University and Research centre (WUR)
Laboratory of Bioinformatics
Transitorium (building 312) room 1034
Dreijenlaan 3
6703 HA Wageningen
The Netherlands
phone: 0317-483 060
fax: 0317-483 584
mobile: 06-143 66 783
pieter.neerincx at wur.nl





More information about the MOBY-dev mailing list