[Soap-Python] couple questions for getting started

Matthew Lenz matthew at nocturnal.org
Tue Jun 9 17:07:40 CEST 2015


Which version should I be using?  The version on python package index?  I
am using 1.16 currently and attempting to implement the following:

http://cnx.test.dat.com:9280/wsdl/TfmiFreightMatching.wsdl

A login attempt is successful hooray!

response = client.Login(
    loginOperation = {
        'loginId': r'xxxxx',
        'password': r'xxxxx',
        'thirdPartyId': r'SampleClient',
    }
);

.... but pysimplesoap throws an exception because it doesn't find the defs
for loginSuccessData.

DEBUG:pysimplesoap.client:Parsing wsdl url:
http://cnx.test.dat.com:9280/wsdl/TfmiFreightMatching.wsdl
DEBUG:pysimplesoap.client:Unpickle file
cache/4d4952e172d281c57e33a925f49d1329.pkl
INFO:pysimplesoap.client:POST http://cnx.test.dat.com:9280/TfmiRequest
DEBUG:pysimplesoap.client:SOAPAction: "/Login"
Content-length: 703
Content-type: text/xml; charset="UTF-8"
DEBUG:pysimplesoap.client:<?xml version="1.0"
encoding="UTF-8"?><soap:Envelope xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="
http://www.w3.org/2001/XMLSchema" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance">
<soap:Header/>
<soap:Body>
    <loginRequest xmlns="http://www.tcore.com/TfmiFreightMatching.xsd">
    <loginOperation
xmlns="http://www.tcore.com/TfmiFreightMatching.xsd"><loginId
xmlns="http://www.tcore.com/TfmiFreightMatching.xsd">XXXXX</loginId><password
xmlns="http://www.tcore.com/TfmiFreightMatching.xsd">XXXXXX</password><thirdPartyId
xmlns="http://www.tcore.com/TfmiFreightMatching.xsd
">SampleClient</thirdPartyId></loginOperation></loginRequest>
</soap:Body>
</soap:Envelope>
DEBUG:pysimplesoap.client:date: Tue, 09 Jun 2015 14:54:29 GMT
status: 200
content-length: 684
content-type: text/xml;charset=utf-8
server: Apache-Coyote/1.1
DEBUG:pysimplesoap.client:<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header/><soapenv:Body><tfm:loginResponse
xmlns:tfm="http://www.tcore.com/TfmiFreightMatching.xsd"><tfm:loginResult><tfm:loginSuccessData><tfm:token><tcor:primary
xmlns:tcor="http://www.tcore.com/TcoreTypes.xsd">XXXXXXXXXXXXXXXXXXXXX</tcor:primary><tcor:secondary
xmlns:tcor="http://www.tcore.com/TcoreTypes.xsd
">XXXXXXXXXXXXXXXX</tcor:secondary></tfm:token><tfm:expiration>2015-06-10T02:54:29.250Z</tfm:expiration></tfm:loginSuccessData></tfm:loginResult></tfm:loginResponse></soapenv:Body></soapenv:Envelope>

Traceback (most recent call last):
  File "./trascore.py", line 27, in <module>
    'thirdPartyId': r'SampleClient',
  File "/usr/local/lib/python2.7/dist-packages/pysimplesoap/client.py",
line 181, in <lambda>
    return lambda *args, **kwargs: self.wsdl_call(attr, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pysimplesoap/client.py",
line 346, in wsdl_call
    return self.wsdl_call_with_args(method, args, kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pysimplesoap/client.py",
line 372, in wsdl_call_with_args
    resp = response('Body', ns=soap_uri).children().unmarshall(output)
  File "/usr/local/lib/python2.7/dist-packages/pysimplesoap/simplexml.py",
line 433, in unmarshall
    value = children and children.unmarshall(fn, strict)
  File "/usr/local/lib/python2.7/dist-packages/pysimplesoap/simplexml.py",
line 433, in unmarshall
    value = children and children.unmarshall(fn, strict)
  File "/usr/local/lib/python2.7/dist-packages/pysimplesoap/simplexml.py",
line 380, in unmarshall
    raise TypeError("Tag: %s invalid (type not found)" % (name,))
TypeError: Tag: loginSuccessData invalid (type not found)

loginSuccessData is based off of type SuccessData which is based off of
type 'data'.  All of it seems to be laid out correctly in the xsd files.  I
did see something that might be the reason?

<xs:element name="loginSuccessData" type="tfmi:LoginSuccessData"
substitutionGroup="types:data"/>

I saw a recent post on a help site about pysimplesoap not supporting
substitution groups? (no idea what that is, completely new to this).  Is
that possibly the problem?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/soap/attachments/20150609/de1ad0cf/attachment.html>


More information about the Soap mailing list