
January 9th, 2004, 10:11 PM
|
|
Contributing User
|
|
Join Date: Nov 2003
Posts: 35
Time spent in forums: < 1 sec
Reputation Power: 6
|
|
Just noticed in the script you posted to the python list that you had Content Length misspelled. If thats not the problem, heres my best shot ;-)
Ok, I thought I had saved some of the script that I had used, it looks like the only thing I have is an old test script, but IIRC, it should still work. Here's your script modified.
Code:
#!/usr/bin/env python
import httplib
# triple quotes make it a little easier to read
# and also speed it up a wee bit, no concat
soap = """<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<checkPassword
xmlns="EDIT:PUT YOUR NAMESPACE HERE">
<employeeID>XXXXXX</employeeID>
<password>XXXXXX</password>
<accessCode>XXXXX</accessCode>
</checkPassword>
</soap:Body>
</soap:Envelope>"""
# assuming its on port 80
conn = httplib.HTTPConnection('insidecoair5', 80)
# so we can see our debug messages, and the
# actual packet the script will be sending
conn.set_debuglevel(3)
#n = conn.send(data)
conn.request('POST', 'EDIT: PUT YOUR PAGE ACTION HERE', soap,
{'Content-Type':'text/xml; charset=utf-8"',
'Content-Length':str(len(soap)),
'Accept':'text/xml; charset=utf-8',
'SOAPAction':'EDIT: REPLACE THIS WITH YOUR ACTION'})
resp = conn.getresponse()
data = resp.read()
# our returned packet
print data
Lemme know if that helps any. If it doesn't work, post the entire debug output (or PM it to me if its sensitive in nature and you don't want it posted in the forums).
EDIT: Removed some of the page stuff because it put quotes around it. Just replace the EDIT stuff with the logical thing that goes there ;-)
Last edited by oxygenthief : January 9th, 2004 at 10:13 PM.
|