473,413 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Which is the most mature Soap module?

Hi everybody,

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
of the various Soap modules around. Those I have found seem to need a lot
of other third-party modules.

Thanks,

/Mickel

--
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

Jul 18 '05 #1
7 3600
Mickel Grönroos <mi****@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.

Don't take my poor memory as gospel, though, read the recent article
by Uche Ogbuji and Mike Olson that was referenced in a recent weekly
Python-URL.

Or you could just stick with httplib (I'd certainly rather not know
anything about SOAP if I can help it, though).

of the various Soap modules around. Those I have found seem to need a lot
of other third-party modules.

[...]

What third-party modules? PyXML is the only one that comes to mind.
That's only one package.
John
Jul 18 '05 #2
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 <mi****@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 todo
is send base64 encoded files via Soap to this upload service which ison 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/fpconst/>)

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

Jul 18 '05 #3
On Fri, 4 Jun 2004, [ISO-8859-1] Mickel Grönroos wrote:
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?
dunno -- it's a while since I used it. Is that part of the WSDL stuff?
All that (which is common code between ZSI and SOAPpy) was pretty flaky
when I tried it.

2. Is there a way to use cookie authentification with SOAPpy
(client-side)?
Yes, no reason why not to use my ClientCookie package to do that, but I
don't know from memory exactly where you need to insert the required code
in SOAPpy. I'm slightly surprised if SOAP needs cookie handling, but not
entirely, since I know it is required for some XML-RPC services.

[...] 2. Second, I need to upload a local file to a specific place on the server
using the cookie as authentification. [...] 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.


No idea without digging, sorry. As I say, WSDL support is definitely
flaky, so it's always possible you've just hit a bug.

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)?? [...] -> 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!


I might have a look this weekend, but don't promise.
John

Jul 18 '05 #4
On Fri, 4 Jun 2004, John J Lee wrote:
2. Is there a way to use cookie authentification with SOAPpy
(client-side)?
Yes, no reason why not to use my ClientCookie package to do that, but I
don't know from memory exactly where you need to insert the required code
in SOAPpy.


Do you mean subclassing SOAPpy and changing the places where it uses
urllib to talk to the server? (This might be totally off target -- I've
been browsing the code in SOAPpy and I'm getting confused ...)
I'm slightly surprised if SOAP needs cookie handling, but not
entirely, since I know it is required for some XML-RPC services.
I don't think SOAP needs cookies for anything. My problem is that the SOAP
server for upload is only available if I have a certain cookie that I
can send to the web server in the http header, i.e. the web server won't
let me through to the SOAP server unless I can supply the cookie first.
I might have a look this weekend, but don't promise.


If you have the time, that would be much appreciated!

Have a nice weekend,

/Mickel

--
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

Jul 18 '05 #5
On Fri, 4 Jun 2004, [ISO-8859-1] Mickel Grönroos wrote:
On Fri, 4 Jun 2004, John J Lee wrote:
2. Is there a way to use cookie authentification with SOAPpy
(client-side)?


Yes, no reason why not to use my ClientCookie package to do that, but I
don't know from memory exactly where you need to insert the required code
in SOAPpy.


Do you mean subclassing SOAPpy and changing the places where it uses
urllib to talk to the server? (This might be totally off target -- I've
been browsing the code in SOAPpy and I'm getting confused ...)


Something like that.

I'm slightly surprised if SOAP needs cookie handling, but not
entirely, since I know it is required for some XML-RPC services.


I don't think SOAP needs cookies for anything. My problem is that the SOAP
server for upload is only available if I have a certain cookie that I
can send to the web server in the http header, i.e. the web server won't
let me through to the SOAP server unless I can supply the cookie first.

[...]

Right.
John

Jul 18 '05 #6
Hi!

I abandoned trying to use the WSDL descriptions from SOAPpy and went back
to looking at ZSI. I got ZSI to work better when using ZSI.Binding (and
not ZSI.ServerProxy). I have two tasks I need to perform:

1. Run a login function with two string parameters ("username" and
"passwd") on a SOAP server that returns a cookie

2. Run an upload function with two parameters (string "fullpath" and
base64 encoded "filecontent") on another SOAP server adding the cookie to
the HTTP header being sent with the SOAP message

Part 1 works with the following code:
import ZSI, sys
loginservice = ZSI.Binding(url="https://hotpage.csc.fi/log/soap.phtml", .... ssl=True, host="hotpage.csc.fi") cookie = loginservice.login("username", "secretpass")[0]
Now I have the cookie in the unicode string "cookie"

Part 2 almost works with the following code:
import base64
data = base64.encodestring("the crap to upload")
uploadservice.upload("/tmp/crap.txt", data) Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/local/lib/python2.3/site-packages/ZSI/client.py", line 28, in
__call__
requesttypecode=TC.Any(self.name, aslist=1))
File "/usr/local/lib/python2.3/site-packages/ZSI/client.py", line 143,
in RPC
return self.Receive(replytype, **kw)
File "/usr/local/lib/python2.3/site-packages/ZSI/client.py", line 286,
in Receive
raise FaultException(msg)
ZSI.FaultException: Denied access to method (upload) in class (main) at
/usr/lib/perl5/site_perl/5.8.0/SOAP/Lite.pm line 2128.
I reckon the problem is I do not explicitly create a
ZSI.TC.Base64String object of the base64 encoded string. I have been
reading the docs of ZSI at <http://pywebsvcs.sourceforge.net/zsi.html> but
can't figure it out. Doing:
base64data = ZSI.TC.Base64String("filecontent", default=data)
uploadservice.upload("/tmp/crap.txt", base64data)


yields the same error message.

Any ideas? In particular, how do I send base64 encoded data in the SOAP
message?

Cheers,

/Mickel

Jul 18 '05 #7
On Tue, 8 Jun 2004, Mickel Grönroos wrote:
[...]
2. Run an upload function with two parameters (string "fullpath" and
base64 encoded "filecontent") on another SOAP server adding the cookieto
the HTTP header being sent with the SOAP message
[...]
import base64
data = base64.encodestring("the crap to upload")
uploadservice.upload("/tmp/crap.txt", data) Traceback (most recent call last):
[...]


I got this working by using Send() for sending the SOAP message calling
the upload command instead of using upload() directly:
uploadservice.Send(None, 'ns1:upload', .... ("/tmp/crap.txt", data),
.... nsdict={'ns1':'urn:Files'})
The success of the command can be tested like this:
try: uploadservice.Receive() .... except: print "failed"
....
1


The clue that solved the mystery was found here:

<http://www-106.ibm.com/developerworks/webservices/library/ws-pyth8.html>

/Mickel (over and out)

Jul 18 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jonas Hei | last post by:
I've noticed that one can use IE to test web pages (by going on http://hostname/blah/blah.asmx - and then it shows a list of methods supported by the webservice, and on selecting each method once...
22
by: ZioMiP | last post by:
Hi to all... I'm actually using Tkinter for my GUI... but I need to "put a piece of a web-page in a widget" how can I do? which GUI module do you suggest me to use for do that? or which GUI...
2
by: Sells, Fred | last post by:
I need to talk to a vendor side via SOAP, Googling is overwhelming and many hits seem to point to older attempts. Can someone tell me which SOAP module is recommended. I'm using Python 2.4. ...
1
by: jeffbg123 | last post by:
Hey, I am running this code on our production server: <?php $f = scandir("/home"); foreach($f as $val){ echo $val; echo "\n"; } ?>
4
by: thebjorn | last post by:
I've been trying to use SOAPpy and ZSI (with and without the use of wsdl2py) to communicate with a SOAP server (looks like it's a WebLogic server(?) in front of some enterprise java bean) and not...
2
by: jesus4gaveme03 | last post by:
I ceated a automatic split form from a table called "Master NSN List." I then added 2 buttons "cmdShowHide" which toggles between showing and hiding the form section giving more room for the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.