[MOBY-dev] gbrowse_moby and bioMoby Python webservices

Yan Wong ywong at infobiogen.fr
Mon Dec 13 09:56:45 UTC 2004


The best way maybe it is to add another class in the TCBioMoby file:

class body(Body):
    pass

but then when you return the MobyContent to the client you should add:

from bioMoby.webservice import TCBioMoby

mobyContentToBeReturned=MobyContent(ResultsOfTheTreatments)
mobyContentToBeReturned.typecode=TCBioMoby.body() #tell how ZSI should 
serialize mobyContentToBeReturned

return mc

Mark Fiers wrote:

> Thank you very much!!!!!
>
> It almost works. I had to make one small change (after some 
> searching); The Body class you've written is identified by a getattr 
> in the module in question. This does not work since the <body> tag 
> send by gbrowse_moby is in lowercase. I've worked aroud this by 
> changing 'class Body:' to 'class body:'.  (is it possible to define 
> __getattr__() on module level??? That would be a nice way to 
> circumvent this problem)
>
> Concerning Mark's question if gbrowse_moby sends incorrectly formatted 
> messages? The <body> tag is as far as I understand not a valid soap 
> tag and apparantly also not part of bioMoby XML. So, I would say that 
> it is still open for discussion, I'm not an expert on the subject.
>
> Cheers
> Mark
>
>
>
>
> Yan Wong wrote:
>
>>
>> I've solved the problem and posted corrections to the CVS.
>>
>> See changelog for listed modifications.
>>
>> Here are the following steps to do to update your bioMoby Python 
>> server API:
>>
>> In your bioMoby python package directory:
>>
>> -First update your ZSI library with the ZSI library provided by this 
>> package:
>> cd packages
>> tar jxvf ZSI-1.5.0-patched-2
>> cd ZSI-1.5.0-patched-2
>> python setup.py install (with your fancy options if you have)
>>
>> -Update your bioMoby Python library
>> python setup.py install  (with options)
>>
>> -Update your scripts by applying the rules:
>> however, you'll have to change some things in your script:
>>
>> BEFORE:
>>
>> from ZSI import dispatch
>> dispatch.AsCGI()
>>
>> NOW:
>>
>> from ZSI import dispatch
>> from bioMoby.webservice import TCBioMoby
>>
>> dispatch.AsCGI(typesmodule=TCBioMoby)
>>
>> or with mod_python:
>>
>> dispatch.AsHandler(modules=myModule,), request=req, 
>> typesmodule=TCBioMoby)
>>
>> TCBioMoby contains a class that serialize/deserialize the content 
>> inside the tag Body  into a MobyContent Object.
>>
>> This will allow a Python webservice to deal with gbrowse_moby.
>>
>>
>> _______________________________________________
>> MOBY-dev mailing list
>> MOBY-dev at biomoby.org
>> http://www.biomoby.org/mailman/listinfo/moby-dev
>>
>
> _______________________________________________
> MOBY-dev mailing list
> MOBY-dev at biomoby.org
> http://www.biomoby.org/mailman/listinfo/moby-dev
>





More information about the MOBY-dev mailing list