[Zope] Asking advice on best way to perform an interaction with an external webservice

Marco Bizzarri marco.bizzarri at gmail.com
Sat Aug 2 04:11:10 EDT 2008


Dieter, thanks for your answer.

I've to implement a SOAP client, and I wonder  how to interact with
the external webservice from a transactional point of view: I don't
want to call twice the same service because of ZPublisher redoing
transactions, and this sort of things.

Regards
Marco

On Sat, Aug 2, 2008 at 9:59 AM, Dieter Maurer <dieter at handshake.de> wrote:
> Marco Bizzarri wrote at 2008-8-1 14:57 +0200:
>>I need to implement an interaction with an external web service.
>>
>>The external webservice basically can either provide or accept
>>messages from my zope application. The messages are either produced by
>>my application (and need to be "sent" to the external application via
>>web service) or produced by the external application, and must be
>>processed by mine.
>
> When your application is the client ("sent"), then you
> can use any of Python frameworks (e.g. "ZSI", "soaplib") to
> interface between Python and the webservice (I fear all these
> frameworks by now support only SOAP 1.1, not the current
> SOAP 1.2).
>
> When your application must act as server, you have
> several options (all including some webservice framework)
>
>  * set up an additional (non-Zope) server with the support
>    of the above mentioned frameworks, let it implement
>    the services.
>
>    If the service needs to access ZODB data, it may
>    be implemented as a ZEO client (this means, that
>    you must use ZEO as storage provider for both
>    your Zope and your service).
>
>  * implement WebService demarshalling/marshalling
>    in a Zope object. Then, the demarshalling happens
>    when the Zope object is traversed. Traversal also
>    changes the response to perform the demarshalling
>    of the result.
>
>    This requires some fix of "ZPublisher" (as it stupidly
>    interprets each POST with content-type "text/xml" als
>    an XML-RPC request.
>
>  * implement an SOAP ZServer
>
> The first option is probably the easiest.
>
> We have implemented the second option. The following list
> demonstrates the complexity in terms of lines, words and characters:
>
> newdm: wc *.py
>    189     650    6709 Marshalling.py
>     10      20     197 Permissions.py
>     27      71     745 ReprRpc.py
>    110     393    3727 Response.py
>     47     128    1286 RpcType.py
>    161     613    5097 SoapRpc.py
>    132     517    4593 WsdlRpc.py
>    208     721    6645 XmlRpc.py
>     19      46     464 __init__.py
>     86     322    2667 utils.py
>    989    3481   32130 total
>
>
> The third option is probably the most difficult one.
>
>
>
> --
> Dieter
>



-- 
Marco Bizzarri
http://iliveinpisa.blogspot.com/


More information about the Zope mailing list