473,569 Members | 2,698 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3613
Mickel Grönroos <mi****@csc.f i> 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.ServiceProx y, why?

2. Is there a way to use cookie authentificatio n with SOAPpy
(client-side)?
On Tue, 1 Jun 2004, John J. Lee wrote:
Mickel Grönroos <mi****@csc.f i> 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.sourc eforge.net/>. ZSI only required PyXML (0.8.3, from
<http://pyxml.sourcefor ge.net/>) to be available, SOAPpy needed PyXML as
well as fpconst (0.7.0, from
<http://www.analytics.w ashington.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 authentificatio n.

2. Second, I need to upload a local file to a specific place on the server
using the cookie as authentificatio n.

I got the login part working nicely using SOAPpy:
import SOAPpy
server = SOAPpy.WSDL.Pro xy("https://hotpage.csc.fi/log/soap.phtml?wsdl ")
cookie = server.login("m yusername", "secretpass ")

Whereas ZSI failed on a TypeError:
server = ZSI.ServiceProx y('https://hotpage.csc.fi/log/soap.phtml?wsdl ', .... use_wsdl=True) cookie = server.login(us ername='myusern ame', passwd='secretp ass') 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.__nam e__, *args, **kwargs)
File "/usr/local/lib/python2.3/site-packages/ZSI/ServiceProxy.py ", line
83, in _call
nsdict=self._ns dict, soapaction=soap Action, 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((s elf.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 authentificatio n, but I can seem to
find that in the documentation of SOAPpy. So how do I do cookie
authentificatio n 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:xmetho dsInterop')

-> proxy('http://services.xmetho ds.net/soap/servlet/rpcrouter',
cookie_jar => HTTP::Cookies->new(ignore_dis card => 1));

print $soap->echoString('He llo')->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.ServiceProx y, 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 authentificatio n 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 authentificatio n. [...] 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 authentificatio n, but I can seem to
find that in the documentation of SOAPpy. So how do I do cookie
authentificatio n with SOAPpy (or ZSI for that matter)?? [...] -> proxy('http://services.xmetho ds.net/soap/servlet/rpcrouter',
cookie_jar => HTTP::Cookies->new(ignore_dis card => 1));

print $soap->echoString('He llo')->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 authentificatio n 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 authentificatio n 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 "fileconten t") 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.c sc.fi") cookie = loginservice.lo gin("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.encodest ring("the crap to upload")
uploadservice.u pload("/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.na me, aslist=1))
File "/usr/local/lib/python2.3/site-packages/ZSI/client.py", line 143,
in RPC
return self.Receive(re plytype, **kw)
File "/usr/local/lib/python2.3/site-packages/ZSI/client.py", line 286,
in Receive
raise FaultException( msg)
ZSI.FaultExcept ion: 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.Base64St ring object of the base64 encoded string. I have been
reading the docs of ZSI at <http://pywebsvcs.sourc eforge.net/zsi.html> but
can't figure it out. Doing:
base64data = ZSI.TC.Base64St ring("fileconte nt", default=data)
uploadservice.u pload("/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 "fileconten t") on another SOAP server adding the cookieto
the HTTP header being sent with the SOAP message
[...]
import base64
data = base64.encodest ring("the crap to upload")
uploadservice.u pload("/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.S end(None, 'ns1:upload', .... ("/tmp/crap.txt", data),
.... nsdict={'ns1':' urn:Files'})
The success of the command can be tested like this:
try: uploadservice.R eceive() .... 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
7534
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 gets the option to specify the parameters and then 'Invoke' the service). Although, this option is extremely handy, are their any other...
22
1393
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 module do you suggest me to use at all? I'm acutally using Windows Xp but I also use Linux...
2
1866
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. --------------------------------------------------------------------------- The information contained in this message may be privileged and / or...
1
4090
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
2449
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 having much luck. I got them to send me an example of what the bytes on the wire are supposed to look like (attached below), and I got it to "work"...
2
7280
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 datasheet and "cmdFixNSN" which takes a portion of the NSN and puts it in another field then removes all of the dashes. The form loads fine until i add...
0
7698
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8122
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7970
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.