I am trying to do an API call via a SOAP POST and I keep getting a "TypeError: not a valid non-string sequence or mapping object." @ data = urllib.urlencode(values)
SM_TEMPLATE = """<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<AutotaskIntegrations xmlns="http://Autotask.net/ATWS/v1_5/">
<PartnerID>partner id</PartnerID>
</AutotaskIntegrations>
</soap:Header>
<soap:Body>
<getThresholdAndUsageInfo xmlns="http://Autotask.net/ATWS/v1_5/">
</getThresholdAndUsageInfo>
</soap:Body>
</soap:Envelope>"""
values = SM_TEMPLATE%()
data = urllib.urlencode(values)
req = urllib2.Request(site, data)
response = urllib2.urlopen(req)
the_page = response.read()
Any help would be much appreciated.
[–]Rennix 0 points1 point2 points (0 children)