SUDS and Changing the Service Port Address
by Itsa Me, Momo!
Hi,
I'm currently working with VTiger and I've noticed that the address in
the service port definition is wrong. I am working with them to see
if we can get that fixed, but in the meantime, is there a way that I
can alter the address of a service port programmatically?
Essentially I need to change the address that
client.service.vtigersoapPort points to when it makes a call.
Thanks!
14 years, 9 months
Re: Hoping someone can help with this error (chris breshears)
by Russell Neufeld
Hi Chris,
I ran into the same problem recent using a different WSDL from
Commission Junction. I'm not a SOAP expert, but apparently their WSDL
is malformed and suds is pretty strict about this stuff. The solution
was to add the following line:
<xsd:import namespace="http://product.domain.cj.com"/>
in two places in the <xsd:schema> block where some of the complex
types were defined. I'd be willing to bet the same type of fix would
fix your problem. If you can send a link to the WSDL I'll try it out
if you can't get it working yourself.
Russ
14 years, 9 months
Hoping someone can help with this error
by chris breshears
I am getting a 'TypeNotFound: Type not found: ' error when trying to
use the web services at CJ. com.. hoping someone can point out what
might be causing it.
I get the client fine, I get a reply from the server, but something
breaks after that. here is the log of what happens:
DEBUG:suds.client:lookup service-method using
"retrieveLatestTransactions"
DEBUG:suds.client:headers = {'SOAPAction': u'""', 'Content-Type':
'text/xml'}
DEBUG:suds.client:sending to (https://rtpubcommission.api.cj.com/services/realtimeCommissionServiceV2
)
message:
<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://api.cj.com
" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<tns:retrieveLatestTransactions>
<tns:developerKey>NOTHING TO SEE HERE</tns:developerKey>
<tns:websiteIds></tns:websiteIds>
<tns:lookBackXHours>16</tns:lookBackXHours>
<tns:advertiserIds></tns:advertiserIds>
<tns:countries></tns:countries>
<tns:adIds></tns:adIds>
<tns:includeDetails></tns:includeDetails>
<tns:sortBy></tns:sortBy>
<tns:sortOrder></tns:sortOrder>
</tns:retrieveLatestTransactions>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
DEBUG:suds.client:http succeeded:
<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:Body><retrieveLatestTransactionsResponse xmlns="http://api.cj.com
"><out xmlns="http://api.cj.com"><count xmlns="http://transaction.service.cj.com
">1</count><transactions xmlns="http://
transaction.service.cj.com"><ns1:RealTimeCommissionDataV2 xmlns:ns1="http://transaction.lucene.service.cj.com
"><adId xmlns="http://transaction.lucene.service.cj.com">10552745</
adId><advertiserId xmlns="http://
transaction.lucene.service.cj.com">2376886</
advertiserId><advertiserName xmlns="http://transaction.lucene.service.cj.com
">magmic games, inc.</advertiserName><commissionAmount xmlns="http://transaction.lucene.service.cj.com
">1.398</commissionAmount><country xmlns="http://transaction.lucene.service.cj.com
"></country><details xmlns="http://transaction.lucene.service.cj.com" /
><eventDate xmlns="http://
transaction.lucene.service.cj.com">2008-12-17T21:20:16-08:00</
eventDate><orderId xmlns="http://
transaction.lucene.service.cj.com">884765</orderId><saleAmount xmlns="http://transaction.lucene.service.cj.com
">6.99</saleAmount><sid xmlns="http://
transaction.lucene.service.cj.com">o4+p4+u1</sid><websiteId xmlns="http://transaction.lucene.service.cj.com
">3244765</websiteId></ns1:RealTimeCommissionDataV2></transactions></
out></retrieveLatestTransactionsResponse></soap:Body></soap:Envelope>
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "build/bdist.macosx-10.5-i386/egg/suds/client.py", line 415,
in __call__
return client.invoke(args)
File "build/bdist.macosx-10.5-i386/egg/suds/client.py", line 468,
in invoke
result = self.send(msg)
File "build/bdist.macosx-10.5-i386/egg/suds/client.py", line 496,
in send
result = self.succeeded(binding, reply)
File "build/bdist.macosx-10.5-i386/egg/suds/client.py", line 553,
in succeeded
r, p = binding.get_reply(self.method, reply)
File "build/bdist.macosx-10.5-i386/egg/suds/bindings/binding.py",
line 150, in get_reply
result = unmarshaller.process(nodes[0], resolved)
File "build/bdist.macosx-10.5-i386/egg/suds/bindings/
unmarshaller.py", line 302, in process
return UMBase.process(self, content)
File "build/bdist.macosx-10.5-i386/egg/suds/bindings/
unmarshaller.py", line 87, in process
data, result = self.append(content)
File "build/bdist.macosx-10.5-i386/egg/suds/bindings/
unmarshaller.py", line 103, in append
self.append_children(content)
File "build/bdist.macosx-10.5-i386/egg/suds/bindings/
unmarshaller.py", line 180, in append_children
cdata, cval = self.append(cont)
File "build/bdist.macosx-10.5-i386/egg/suds/bindings/
unmarshaller.py", line 101, in append
self.start(content)
File "build/bdist.macosx-10.5-i386/egg/suds/bindings/
unmarshaller.py", line 320, in start
found = self.resolver.find(content.node)
File "build/bdist.macosx-10.5-i386/egg/suds/resolver.py", line 362,
in find
pushed = self.push(result)
File "build/bdist.macosx-10.5-i386/egg/suds/resolver.py", line 257,
in push
item = (item, item.resolve())
File "build/bdist.macosx-10.5-i386/egg/suds/xsd/sxbasic.py", line
672, in resolve
raise TypeNotFound(qref)
TypeNotFound: Type not found: '(ArrayOfRealTimeCommissionDataV2, http://transaction.lucene.service.cj.com
, )'
Any help would be appreciated/
Thanks
CB
14 years, 9 months
Suds in Fedora
by Jeff Ortel
Forget to mention, the fedora package name is python-suds.
14 years, 9 months
Suds in Fedora
by Jeff Ortel
All,
FYI, suds is now included in the fedora distribution. Fedora (8,9,10)
users can simply install and update using package install/update tools
like Yum and PackageManager.
Regards,
Jeff
14 years, 9 months
Suds and threads
by Russell Neufeld
Hi all,
I'm wondering if client.service.some_method() is threadsafe. Can I
have several outstanding soap calls at once, or do I need to
instantiate a new client per thread? Is there documentation which
describes best practices for using suds in a mult-threaded environment?
Thanks,
Russ
14 years, 9 months
Suds Exception: Exception: tag (artist), not-found
by Stephen Nesbitt
Hi All:
I am trying to query the SOAP service at the www.lyricwiki.org. The wsdl is
here: http://lyricwiki.org/server.php?wsdl
The query is failing with a general exception with regard to tag not found.
I've run this with log level debug and I am getting a response with the
correct content. So there is something else going on.
Following is the log and the exception. This was a query for getArtist and to
avoid excessive output I used a non-existent artist. The same exception occurs
if a valid artist is used. Thanks in advance for the help.
-steve
c1.service.getArtist("dummy")
DEBUG:suds.xsd.query:TypeQuery:0x2141560, found builtin (string)
DEBUG:suds.bindings.marshaller:processing:
(Content){
tag = "artist"
value = "dummy"
type = <PartElement:0x2141a28 inherited="False" />
}
DEBUG:suds.bindings.marshaller:created - node:
<artist xmlns="urn:LyricWiki" xmlns:ns1="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:string"/>
DEBUG:suds.metrics:message for 'LyricWikiPort:getArtist' created: 1 (ms)
DEBUG:suds.client:sending to (http://lyricwiki.org/server.php)
message:
<SOAP-ENV:Envelope xmlns:ns0="urn:LyricWiki"
xmlns:ns1="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-
ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-
ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<ns0:getArtist>
<artist xsi:type="ns1:string">dummy</artist>
</ns0:getArtist>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
DEBUG:suds.client:headers = {'SOAPAction': u'"urn:LyricWiki#getArtist"',
'Content-Type': 'text/xml'}
DEBUG:suds.transport:sending to (http://lyricwiki.org/server.php)
message:
<SOAP-ENV:Envelope xmlns:ns0="urn:LyricWiki"
xmlns:ns1="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-
ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-
ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<ns0:getArtist>
<artist xsi:type="ns1:string">dummy</artist>
</ns0:getArtist>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
DEBUG:suds.client:http succeeded:
<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope SOAP-
ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-
ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-
ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:si="http://soapinterop.org/xsd" xmlns:tns="urn:LyricWiki"><SOAP-
ENV:Body><ns1:getArtistResponse xmlns:ns1="urn:LyricWiki"><artist
xsi:type="xsd:string">dummy</artist><albums xsi:type="SOAP-ENC:Array" SOAP-
ENC:arrayType="tns:AlbumData[0]"></albums></ns1:getArtistResponse></SOAP-
ENV:Body></SOAP-ENV:Envelope>
DEBUG:suds.metrics:<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-
ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:si="http://soapinterop.org/xsd" xmlns:tns="urn:LyricWiki"><SOAP-
ENV:Body><ns1:getArtistResponse xmlns:ns1="urn:LyricWiki"><artist
xsi:type="xsd:string">dummy</artist><albums xsi:type="SOAP-ENC:Array" SOAP-
ENC:arrayType="tns:AlbumData[0]"></albums></ns1:getArtistResponse></SOAP-
ENV:Body></SOAP-ENV:Envelope>
sax duration: 0 (ms)
DEBUG:suds.xsd.query:TypeQuery:0x21417e8, found builtin (string)
DEBUG:suds.xsd.query:(u'AlbumDataArray', u'urn:LyricWiki'), found as:
<Complex:0x1c4fea8 name="AlbumDataArray" />
---------------------------------------------------------------------------
Exception Traceback (most recent call last)
/home/users/snesbitt/bin/<ipython console> in <module>()
/home/users/snesbitt/lib/python2.5/site-packages/suds-0.3.3-
py2.5.egg/suds/client.py in __call__(self, *args, **kwargs)
225 def __call__(self, *args, **kwargs):
226 target = self.__wrapped__
--> 227 return target.call(*args, **kwargs)
228
229
/home/users/snesbitt/lib/python2.5/site-packages/suds-0.3.3-
py2.5.egg/suds/client.py in call(self, *args, **kwargs)
352 """
353 method = self.resolve(self.name(), strict=False)
--> 354 return method(*args, **kwargs)
355
356
/home/users/snesbitt/lib/python2.5/site-packages/suds-0.3.3-
py2.5.egg/suds/client.py in __call__(self, *args, **kwargs)
225 def __call__(self, *args, **kwargs):
226 target = self.__wrapped__
--> 227 return target.call(*args, **kwargs)
228
229
/home/users/snesbitt/lib/python2.5/site-packages/suds-0.3.3-
py2.5.egg/suds/client.py in call(self, *args, **kwargs)
391 if not self.faults():
392 try:
--> 393 return client.invoke(args, kwargs)
394 except WebFault, e:
395 return (500, e)
/home/users/snesbitt/lib/python2.5/site-packages/suds-0.3.3-
py2.5.egg/suds/client.py in invoke(self, args, kwargs)
453 self.method.qname, timer)
454 timer.start()
--> 455 result = self.send(msg)
456 timer.stop()
457 metrics.log.debug(
/home/users/snesbitt/lib/python2.5/site-packages/suds-0.3.3-
py2.5.egg/suds/client.py in send(self, msg)
478 request.headers = self.headers()
479 reply = transport.send(request)
--> 480 result = self.succeeded(binding, reply)
481 except TransportError, e:
482 if e.httpcode in (202,204):
/home/users/snesbitt/lib/python2.5/site-packages/suds-0.3.3-
py2.5.egg/suds/client.py in succeeded(self, binding, reply)
510 log.debug('http succeeded:\n%s', reply)
511 if len(reply) > 0:
--> 512 r, p = binding.get_reply(self.method, reply)
513 self.last_received(r)
514 if self.options.faults:
/home/users/snesbitt/lib/python2.5/site-packages/suds-0.3.3-
py2.5.egg/suds/bindings/binding.py in get_reply(self, method, reply)
127 return (replyroot, result)
128 if len(nodes) > 1:
--> 129 result = self.reply_composite(rtypes, nodes)
130 return (replyroot, result)
131 if len(nodes) == 1:
/home/users/snesbitt/lib/python2.5/site-packages/suds-0.3.3-
py2.5.egg/suds/bindings/binding.py in reply_composite(self, rtypes, nodes)
175 rt = dictionary.get(tag, None)
176 if rt is None:
--> 177 raise Exception('tag (%s), not-found' % tag)
178 resolved = rt.resolve(nobuiltin=True)
179 sobject = unmarshaller.process(node, resolved)
14 years, 10 months
https client authentification
by Witzel, Stefan
Hello,
looking for a python module for soap client development I also found suds.
My problem: I have to implement a https client authentification for the
client. Is there an (easy) way using suds?
Thanks in advance.
Stefan
14 years, 10 months