Which is the most mature Soap module?

Mickel Grönroos mickel at csc.fi
Fri Jun 4 13:34:26 CEST 2004


> If you are working with Windows, you can use the excellent WebServices
> support in .NET.

Unfortunately, I need to get the software to work on both Linux and
Windows. Moving to .NET now would lead me into problems in other areas, I
assume ...

I have narrowed down my problem to the HTTP header. I need a way
of accessing the HTTP header of the SOAP message that is sent to the
server from my client. More specifically, I need to add a line such as:

Cookie: hotpageauth=user 1234567890 blablablablabla; path=/; expires=date; domain=.csc.fi; secure;

to the HTTP header. Then the web server will allow access to the soap
server that takes care of parsing and handling the actual SOAP message.

So any ideas on how to fiddle with the HTTP header of a SOAP message being
sent from SOAPpy? The SOAP::Lite module in Perl takes care of that so
nicely ...

/Mickel

>
> To access this from Python, you can use one of the many .NET extensions
> for Python.
>
> http://www.python.org/wiki/pub/PyConChetanGadgil/attachments/PyCON%20Pap
> er%20on%20%22.NET%20for%20Python%22.htm
>
> http://www.zope.org/Members/Brian/PythonNet/index_html
>
>
> With these, you can let everything be done from Python, in .NET, such
> as:
> 1) WSE
> 2) HPPTS
> 3) Transparent client stubs for webservices
>
> If needed, you can search online for Microsoft's documentation for
> webservices from .NET.
>
>
>
> Regards
> Chetan
>
>
> "Contrariwise," continued Tweedledee, "if it was so, it might be, and if
> it were so, it would be; but as it isn't, it ain't.  That's logic!"
>     -- Lewis Carroll, "Through the Looking Glass"
>
>
> > -----Original Message-----
> > From:
> > python-list-bounces+cgadgil_list=cxoindia.dnsalias.com at python.
> > org
> > [mailto:python-list-bounces+cgadgil_list=cxoindia.dnsalias.com
> > @python.org] On Behalf Of Mickel Grönroos
> > Sent: Friday, June 04, 2004 3:57 PM
> > To: John J. Lee
> > Cc: python-list at python.org
> > Subject: Re: Which is the most mature Soap module?
> >
> >
> > The following is a rather long message. Here is a summary of
> > my questions
> > below:
> >
> > 1. ZSI fails on a TypeError when using ZSI.ServiceProxy, why?
> >
> > 2. Is there a way to use cookie authentification with SOAPpy
> > (client-side)?
> >
> >
> > On Tue, 1 Jun 2004, John J. Lee wrote:
> >
> > > Mickel Grönroos <mickel at csc.fi> writes:
> > >
> > > > To the heart of the matter: Which of the available Soap
> > modules is
> > > > best fitted for client side soap messaging? I have an
> > upload service
> > > > (written in Perl) that I want to use from a Python
> > application. What
> > > > I want to do is send base64 encoded files via Soap to this upload
> > > > service which is on a SSL encrypted server. I cannot really grasp
> > > > the current development status
> > >
> > > IIRC, ZSI is.  Certainly there is no solid WSDL implementation.
> >
> > I downloaded and installed both ZSI (1.5) and SOAPpy (0.11.4)
> > both from <http://pywebsvcs.sourceforge.net/>. ZSI only
> > required PyXML (0.8.3, from
> > <http://pyxml.sourceforge.net/>) to be available, SOAPpy
> > needed PyXML as well as fpconst (0.7.0, from
> > <http://www.analytics.washington.edu/statcomp/projects/rzope/f
> > pconst/>)
> >
> > My problem concerns doing two things:
> >
> > 1. First, I need to log in at a secure server. In return I
> > get a cookie that functions as user authentification.
> >
> > 2. Second, I need to upload a local file to a specific place
> > on the server using the cookie as authentification.
> >
> > I got the login part working nicely using SOAPpy:
> >
> > >>> import SOAPpy
> > >>> server =
> > >>> SOAPpy.WSDL.Proxy("https://hotpage.csc.fi/log/soap.phtml?wsdl")
> > >>> cookie = server.login("myusername", "secretpass")
> > >>>
> >
> > Whereas ZSI failed on a TypeError:
> >
> > >>> server =
> > >>> ZSI.ServiceProxy('https://hotpage.csc.fi/log/soap.phtml?wsdl',
> > ... use_wsdl=True)
> > >>> cookie = server.login(username='myusername', passwd='secretpass')
> > Traceback (most recent call last):
> >   File "<stdin>", line 1, in ?
> >   File
> > "/usr/local/lib/python2.3/site-packages/ZSI/ServiceProxy.py",
> > line 278, in __call__
> >     return self.parent()._call(self.__name__, *args, **kwargs)
> >   File
> > "/usr/local/lib/python2.3/site-packages/ZSI/ServiceProxy.py",
> > line 83, in _call
> >     nsdict=self._nsdict, soapaction=soapAction,
> > requesttypecode=request)
> >   File
> > "/usr/local/lib/python2.3/site-packages/ZSI/client.py", line 209,
> > in Send    self.h.connect()
> >   File "/usr/local/lib/python2.3/httplib.py", line 960, in connect
> >     sock.connect((self.host, self.port))
> >   File "<string>", line 1, in connect
> > TypeError: an integer is required
> > >>>
> >
> > Any ideas what this might be? I gather I would need to set
> > the port to 443 somewhere, but I can't find the right place.
> >
> >
> > The second part, i.e. the upload, is trickier. Using
> > SOAP::Lite in Perl, one can specify a cookie to use for
> > authentification, but I can seem to find that in the
> > documentation of SOAPpy. So how do I do cookie
> > authentification with SOAPpy (or ZSI for that matter)??
> >
> > Here is the Perl SOAP::Lite code that does the trick (copied from
> > <http://guide.soaplite.com/>):
> >
> >   use SOAP::Lite;
> >   use HTTP::Cookies;
> >
> >   my $soap = SOAP::Lite
> >     -> uri('urn:xmethodsInterop')
> >
> >     -> proxy('http://services.xmethods.net/soap/servlet/rpcrouter',
> >              cookie_jar => HTTP::Cookies->new(ignore_discard => 1));
> >
> >   print $soap->echoString('Hello')->result;
> >
> > I need something like that 'cookie_jar' parameter in SOAPpy
> > too. Help and thanks!
> >
> > /Mickel
> >
> > --
> > http://mail.python.org/mailman/listinfo/python-list
> >
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>

--
Mickel Grönroos, application specialist, linguistics, Research support, CSC
PL 405 (Tekniikantie 15 a D), 02101 Espoo, Finland, phone +358-9-4572237
CSC is the Finnish IT center for science, www.csc.fi




More information about the Python-list mailing list