0
from suds import WebFault
from suds.client import Client
from cookielib import Cookie
import logging
logging.basicConfig(level=logging.INFO)
logging.getLogger('suds.transport').setLevel(logging.DEBUG)
client = Client(url)
loginResult = client.service.Login(username, password)
print "=========================================="
print client.options.transport.cookiejar
DEBUG:suds.transport.http:sending:
URL:http://127.0.0.1:34014
HEADERS: {'SOAPAction': u'""', 'Content-Type': 'text/xml; charset=utf-8', 'Content-type': 'text/xml; charset=utf-8', 'Soapaction': u'""'}
DEBUG:suds.transport.http:received:
CODE: 200
HEADERS: {
'set-cookie': 'srv=869aa1577003769cbff7962d77641c4ae9134ac4;Domain=...;Path=/;Version=1;Max-Age=3600',
'content-length': '440',
'content-type': 'text/xml; charset=utf-8',
'connection': 'close',
'server': 'soap/1.9'
}
==========================================
<cookielib.CookieJar[]>
==========================================
None
您爲什麼認爲應該有任何cookie? – 2012-02-24 10:03:22
'set-cookie':'srv = 869aa1577003769cbff7962d77641c4ae9134ac4 - 不是Cookie?如何獲得srv的價值? – Azimuth 2012-02-24 10:48:06