Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old December 30th, 2003, 12:43 PM
ragabash ragabash is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Yuma,AZ
Posts: 11 ragabash User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to ragabash Send a message via Yahoo to ragabash
Python And Soap

Because I'm sleeping entirely too much lately, I've decided to pick up a new skill and code some worthless Python modules while I'm at it (I'm picking a semi interesting Perl module off of CPAN and implementing it in Python. PyPI needs to grow).

Are there any decent Python SOAP modules out there? I know PythonWare used to have one but they don't have it on there page any more.

I'd prefer one that is at least relatively stable. No Pre-Alpha (which seemed to be all I could find when I googled around for it)

-rag

Reply With Quote
  #2  
Old December 30th, 2003, 05:09 PM
oxygenthief oxygenthief is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 35 oxygenthief User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Theres an article on IBM Developerworks covering a few implementations, PySOAP is one, SOAPpy another. I think 4Suite has one.

One of the more robust and I believe commonly used implemenations has a SF page (sf.net is down, and I can't recall the URL--I think its the pywsdl project?), but when I looked at it a while back I found code in CVS to be confusing, as the project merged a few SOAP related projects into one recently, I believe. To be honest, I couldn't make heads nor tails of it with a quick 15 minute glance through the repository, much of the documentation seemed to be out of date or lacking, though I'm certain they've probably changed much of that since I last looked at it (months, admittedly).

I did see a link to this in the Python mailing list a while back: http://interview-machine.com/soap/. I've looked at it just a wee bit but it seemed more straightforward to me.

Reply With Quote
  #3  
Old January 2nd, 2004, 11:57 AM
Strike Strike is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2001
Location: Houston, TX
Posts: 383 Strike User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 41 m 27 sec
Reputation Power: 7
Send a message via ICQ to Strike Send a message via AIM to Strike Send a message via Yahoo to Strike
I don't remember where we got our SOAP module from, but the IRC bot project that I code on has its SOAP.py in CVS and can be seen here.
__________________
Debian - because life's too short for worrying.
Best. (Python.) IRC bot. ever.

Reply With Quote
  #4  
Old January 2nd, 2004, 01:49 PM
TheBlackMamba TheBlackMamba is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 25 TheBlackMamba User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to TheBlackMamba Send a message via Yahoo to TheBlackMamba
I was reading over the python cookbook and remembered that OSE (http://ose.sourceforge.net/) provides a rather easy SOAP API. Good Luck.

Reply With Quote
  #5  
Old January 2nd, 2004, 04:10 PM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,529 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 17 h 19 m 5 sec
Reputation Power: 63
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
Using SOAP from Python you've gotta like the SOAPy project. Its small, and seems to be very easy to use (but i havn't done much with it yet), definatly worth a look though

http://sourceforge.net/projects/soapy

Theres a pretty nice SOAP module that comes with PyGoogle although i'm not sure if this is the one from pythonware.com or another project?

Mark.
__________________
programming language development: www.netytan.com Hula


Reply With Quote
  #6  
Old January 5th, 2004, 06:24 PM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,529 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 17 h 19 m 5 sec
Reputation Power: 63
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
a little info for anyone interested in this subject.. anyway theres a nice little article on OnLamp that shows just how powerful mixing python and SOAP can be!!!!

http://www.onlamp.com/pub/a/python/.../14/pysoap.html

Mark.

Reply With Quote
  #7  
Old January 6th, 2004, 03:59 PM
JuiceMan JuiceMan is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 10 JuiceMan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,

Are there any good resources on how to write your own soap module?

I would use modules that are already written but i want to learn exactly how it works.

Thanks!

Reply With Quote
  #8  
Old January 6th, 2004, 04:20 PM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,529 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 17 h 19 m 5 sec
Reputation Power: 63
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
Not that i know of... your best bet would be to look at how SOAP works in general and of course download some of the existing modules and picking though their code!

Mark.

Reply With Quote
  #9  
Old January 6th, 2004, 05:09 PM
oxygenthief oxygenthief is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 35 oxygenthief User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Quote:
Originally posted by JuiceMan
Hi,

Are there any good resources on how to write your own soap module?

I would use modules that are already written but i want to learn exactly how it works.

Thanks!

Starting with the SOAP spec would be your best bet: http://www.w3.org/2000/xp/Group/

If you can make it through that, you'll see why there are a few unfinished or incomplete SOAP modules floating around ;-)

Reply With Quote
  #10  
Old January 7th, 2004, 11:07 AM
JuiceMan JuiceMan is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 10 JuiceMan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Cant you just send a HTTP request using Python's internet API to send the soap server the header and body?

Like using:
req = HTTP("***")
req.putrequest("POST", ****")
req.putheader("Accept", "text/xml; charset=utf-8")
req.putheader("Content-Legth", str(len(postdata)))
req.putheade("SOAPAction", "*****")
req.endheaders()

then sending off the xml body?

To me, it seems like that would work but i guess there are a lot more to it.

Gotta go read up on some more soap...

Reply With Quote
  #11  
Old January 7th, 2004, 11:46 AM
oxygenthief oxygenthief is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 35 oxygenthief User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Yeah, you can do that. I've done this for one project we worked on that just needed a single call to a JMS server. Rather than mess around with an XML library as well, we used string formatting to create the packet. It made the code *much* shorter.

Its just not as "pretty" or as usable as a module would be though. Writing a module that conforms to all ofthe SOAP specs and handles stuff like WSDL is a little bit harder.

Reply With Quote
  #12  
Old January 7th, 2004, 12:52 PM
JuiceMan JuiceMan is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 10 JuiceMan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
does that body have to be encoded in some way or can you just send off a variable with string formatted.

req.send(postdata)

i just assigned the long string(which is the xml in soap's envelop) to "postdata" and sent it off as above. I received a response but had an "The root element is missing" error.

Thanks!

Reply With Quote
  #13  
Old January 8th, 2004, 10:40 AM
JuiceMan JuiceMan is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 10 JuiceMan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
any help would be much appreciated, oxygenthief.

Reply With Quote
  #14  
Old January 8th, 2004, 12:02 PM
JuiceMan JuiceMan is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 10 JuiceMan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
i used "req.send(postdata)" to send off my body, is that what you used to send off the SOAP message?? I think i might be wrong on that one...postdata is my soap message.



# Send SOAP body
req.send(postdata)


ec, em, h = req.getreply()
print "\n*************************** HTTP RESPONSE **********************************"
print ec, em

print "\n*************************** HTTP HEADER RESPONSE ***************************"
print h

# get file-like object from HTTP response
# and print received HTML to screen
fd = req.getfile()
textlines = fd.read()
fd.close()

print "\n************************** INCOMING SOAP ***********************************"
print textlines

Reply With Quote
  #15  
Old January 9th, 2004, 01:06 PM
oxygenthief oxygenthief is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 35 oxygenthief User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
I'm not sure what context req is being used in exactly. The project I worked on, we used httplib and created our own header file, and contents. Lemme see if I can dig it up and give you an example. Sorry for the late reply, I just formatted my primary computer and put slackware on it. Finally got mail working and saw this thread had some movement.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > Python And Soap


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread