tags:

views:

407

answers:

2
+1  Q: 

SOAP, Python, suds

Hello everybody!
Please advise library for working with soap in python.
Now, i'm trying to use "suds". And i can't undestand how get http headers from server reply
Code example:

from suds.client import Client
url = "http://10.1.0.36/money_trans/api3.wsdl"
client = Client(url)
login_res = client.service.Login("login", "password")

variable "login_res" contain xml answer and doesnt contain http headers. But i need to get session id from them.

Thank you.

A: 

Soap Library Python

oak
thank you. but there no good documentad libraries.realy i need some article that explain how to use soap library.
iscarface
Did you read the first article?http://diveintopython.org/soap_web_services/
oak
A: 

I think you actually want to look in the Cookie Jar for that.

client = Client(url)
login_res = client.service.Login("login", "password")
for c in client.options.transport.cookiejar:
   if "sess" in str(c).lower():
      print "Session cookie:", c

I'm not sure. I'm still a SUDS noob, myself. But this is what my gut tells me.

Ishpeck