Skip to content

Commit

Permalink
Warning: API incompatible change. class SoapClient now takes a object…
Browse files Browse the repository at this point in the history
… (EnvelopeBuilder) in stead of a XML message string. Also, msg_type has been removed.
  • Loading branch information
Rune Hansen committed Feb 13, 2012
1 parent b636e8b commit 1a717ad
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pswinclient.py
Expand Up @@ -136,21 +136,20 @@ def xml(self):
class SOAPClient(object):
"""Sets up SOAP communication"""

def __init__(self, host, path, msg, agent="RL-PythonPSWinComSOAP", msg_type='single'):
def __init__(self, host, path, msg, agent="RL-PythonPSWinComSOAP"):
"""Initialize communication
keyword arguments:
host -- your.soap.host
path -- /path/to/SOAP/handler
msg -- <soapxx:Envelope>..</soap>
agent -- Useragent string
msg_type -- single|multi soap enveople messages
"""
self.host = host
self.path = path
self.msg = msg
self.msg = msg.xml
self.agent = agent
self.msg_type = msg_type
self.msg_type = 'single' if not msg.multi else 'multi'
self.__set_headers()

def __set_headers(self):
Expand Down Expand Up @@ -211,7 +210,7 @@ def main(args):
et.dump(doc)
return(0,0)
else:
soap_client = SOAPClient('sms.pswin.com','/SOAP/SMS.asmx', sms_message.xml)
soap_client = SOAPClient('sms.pswin.com','/SOAP/SMS.asmx', sms_message)
statuscode, envelope_response = soap_client.send()
return(statuscode, envelope_response)

Expand Down

0 comments on commit 1a717ad

Please sign in to comment.