Hello,
It appears that the soap envelope namespace is hardcoded to '
http://schemas.xmlsoap.org/soap/envelope/' in binding.py. I'm trying to
talk to a gSOAP based web service that insists the envelope namespace be '
http://www.w3.org/2003/05/soap-envelope'.
Unfortunately, I don't have permission to share the WSDL file.
Any suggestions?
--Chris
Hello,
I would like to use suds to talk to several SOAP services, each using
the same WSDL. The wsdl file is rather large (about 500K) and
translates to about 50M of memory once parsed.
If I do this:
c1 = Client('file:myservice.wsdl)
c1.set_options(location="https://addr1/soap")
c2 = Client('file:myservice.wsdl)
c2.set_options(location="https://addr2/soap")
(etc)
Then each Client instance adds about 50M to my program's memory
footprint. Is there any way to parse the WSDL once and create
several client objects based on the already-parsed file?
A cursory inspection of the Client code suggests I might be able to
create the first Client() and then make new instances of client that
reference the wsdl, factory and sd members of the original, but
contains different Options and possibly it's own ServiceSelector.
Suggestions or comments?
--Chris
I am running a Plone site that makes use of suds (0.36) to handle my SOAP requests which generally works well. Allied to this I also have the same set up in a development instance.
However, on one particular request, the production site produces errors where the dev site works fine.
The following call to a remote service is fine in development but not in production (other calls from the production instance to the same server (ukcolofiniis06) works OK as well):
def testPostTime():
url = 'http://ukcolofiniis06/CMSNet/Time/TimeWS/TimeUtilityService.asmx?wsdl'
client = Client(url)
return client
The error returned is as follows:
Module suds.client, line 106, in __init__
Module suds.wsdl, line 193, in __init__
Module suds.wsdl, line 255, in build_schema
Module suds.xsd.schema, line 90, in load
Module suds.xsd.schema, line 277, in open_imports
Module suds.xsd.sxbasic, line 874, in open
Module suds.xsd.sxbasic, line 892, in download
Module suds.sax.parser, line 134, in parse
Module xml.sax.expatreader, line 107, in parse
Module xml.sax.xmlreader, line 123, in parse
Module xml.sax.expatreader, line 211, in feed
Module xml.sax.handler, line 38, in fatalError
SAXParseException: /tmp/suds/suds-649682136.http:10:2: mismatched tag
Any ideas why there could be a difference?
(For further info the successful output from the same call on my dev instance is as follows:
Suds ( https://fedorahosted.org/suds/ ) version: 0.3.6 GA build: R526-20090624
Service ( TimeUtilityService ) tns="http://cmsopen.com/"
Prefixes (3)
ns0 = "http://cmsopen.com/"
ns1 = "http://cmsopen.com/AbstractTypes"
ns2 = "http://schemas.xmlsoap.org/soap/encoding/"
Ports (2):
(TimeUtilityServiceSoap)
Methods (17):
BatchTimeEntryDelete(ArrayOfInt batch, xs:boolean removeLocks, xs:boolean unrelease, )
BatchTimeEntryPost(ArrayOfInt timeUnos, TimeEntryPostOptions options, )
BatchTimeEntryRelease(ArrayOfTextPackage batch, )
BatchTimeEntrySetPrinted(ArrayOfInt batch, xs:boolean printed, )
BatchTimeEntryUnrelease(ArrayOfInt batch, )
BatchTimersConvert(ArrayOfTimerData batch, )
BatchTimersDelete(ArrayOfInt batch, )
Create(TimeEntryDataCreate data, xs:boolean lockOnCreate, )
Delete(xs:int timeUno, xs:boolean removeLock, xs:boolean unrelease, )
Release(TextPackage tPkg, )
SetPrinted(xs:int timeUno, xs:boolean printed, )
SubmitTimeEntryBatch(ArrayOfTimeEntryWSPackage batch, xs:boolean lockOnCreate, )
SubmitTimersBatch(ArrayOfTimerWSPackage batch, )
Unrelease(xs:int timeUno, )
Update(xs:int timeUno, TimeEntryDataUpdate data, )
UpdateGeneralDefaultTimekeeper(xs:int uno, )
UpdateTimerDefaultTimekeeper(xs:int uno, )
Types (69):
ns2:Array
ArrayOfInt
ArrayOfTextPackage
ArrayOfTimeEntryWSPackage
ArrayOfTimerData
ArrayOfTimerWSPackage
ArrayOfWSReturn
ns2:ENTITIES
ns2:ENTITY
ns2:ID
ns2:IDREF
ns2:IDREFS
ns2:NCName
ns2:NMTOKEN
ns2:NMTOKENS
ns2:NOTATION
ns2:Name
ns2:QName
ns1:StringArray
ns2:Struct
TextPackage
TimeEntryDataBase
TimeEntryDataCreate
TimeEntryDataUpdate
TimeEntryPostOptions
TimeEntryUpdatePkg
TimeEntryWSPackage
TimerData
TimerDataBase
TimerDataCreate
TimerDataUpdate
TimerUpdatePkg
TimerWSPackage
WSReturn
ns2:anyURI
ns2:arrayCoordinate
ns2:base64
ns2:base64Binary
ns2:boolean
ns2:byte
ns2:date
ns2:dateTime
ns2:decimal
ns2:double
ns2:duration
ns2:float
ns2:gDay
ns2:gMonth
ns2:gMonthDay
ns2:gYear
ns2:gYearMonth
ns2:hexBinary
ns2:int
ns2:integer
ns2:language
ns2:long
ns2:negativeInteger
ns2:nonNegativeInteger
ns2:nonPositiveInteger
ns2:normalizedString
ns2:positiveInteger
ns2:short
ns2:string
ns2:time
ns2:token
ns2:unsignedByte
ns2:unsignedInt
ns2:unsignedLong
ns2:unsignedShort
(TimeUtilityServiceSoap12)
Methods (17):
BatchTimeEntryDelete(ArrayOfInt batch, xs:boolean removeLocks, xs:boolean unrelease, )
BatchTimeEntryPost(ArrayOfInt timeUnos, TimeEntryPostOptions options, )
BatchTimeEntryRelease(ArrayOfTextPackage batch, )
BatchTimeEntrySetPrinted(ArrayOfInt batch, xs:boolean printed, )
BatchTimeEntryUnrelease(ArrayOfInt batch, )
BatchTimersConvert(ArrayOfTimerData batch, )
BatchTimersDelete(ArrayOfInt batch, )
Create(TimeEntryDataCreate data, xs:boolean lockOnCreate, )
Delete(xs:int timeUno, xs:boolean removeLock, xs:boolean unrelease, )
Release(TextPackage tPkg, )
SetPrinted(xs:int timeUno, xs:boolean printed, )
SubmitTimeEntryBatch(ArrayOfTimeEntryWSPackage batch, xs:boolean lockOnCreate, )
SubmitTimersBatch(ArrayOfTimerWSPackage batch, )
Unrelease(xs:int timeUno, )
Update(xs:int timeUno, TimeEntryDataUpdate data, )
UpdateGeneralDefaultTimekeeper(xs:int uno, )
UpdateTimerDefaultTimekeeper(xs:int uno, )
Types (69):
ns2:Array
ArrayOfInt
ArrayOfTextPackage
ArrayOfTimeEntryWSPackage
ArrayOfTimerData
ArrayOfTimerWSPackage
ArrayOfWSReturn
ns2:ENTITIES
ns2:ENTITY
ns2:ID
ns2:IDREF
ns2:IDREFS
ns2:NCName
ns2:NMTOKEN
ns2:NMTOKENS
ns2:NOTATION
ns2:Name
ns2:QName
ns1:StringArray
ns2:Struct
TextPackage
TimeEntryDataBase
TimeEntryDataCreate
TimeEntryDataUpdate
TimeEntryPostOptions
TimeEntryUpdatePkg
TimeEntryWSPackage
TimerData
TimerDataBase
TimerDataCreate
TimerDataUpdate
TimerUpdatePkg
TimerWSPackage
WSReturn
ns2:anyURI
ns2:arrayCoordinate
ns2:base64
ns2:base64Binary
ns2:boolean
ns2:byte
ns2:date
ns2:dateTime
ns2:decimal
ns2:double
ns2:duration
ns2:float
ns2:gDay
ns2:gMonth
ns2:gMonthDay
ns2:gYear
ns2:gYearMonth
ns2:hexBinary
ns2:int
ns2:integer
ns2:language
ns2:long
ns2:negativeInteger
ns2:nonNegativeInteger
ns2:nonPositiveInteger
ns2:normalizedString
ns2:positiveInteger
ns2:short
ns2:string
ns2:time
ns2:token
ns2:unsignedByte
ns2:unsignedInt
ns2:unsignedLong
ns2:unsignedShort
Dear suds developers,
I want to convert a perl SOAP client into a python SOAP client. The perl client is initialized like
$url = 'https://host:port/cgi-devel/Service.cgi';
$uri = 'https://host/Service';
my $soap = SOAP::Lite
-> uri($uri)
-> proxy($url);
I tried to replicate this in python 2.4.2 with suds 0.3.6 doing
from suds.client import Client
url="https://host:port/cgi-devel/Service.cgi"
client=Client(url)
However when running this python script I get the error
suds.transport.TransportError: HTTP Error 411: Length Required
Is it because of https or what might be the problem?
Thank you,
Andreas Maier
I am trying to use suds to call teamtrack webservices (wsdl attached)
but am having issues importing the wsdl.
If I create the suds client having disabled the use of a proxy[0] I
can download the wsdl fine but am unable to import
http://schemas.xmlsoap.org/soap/encoding/. If I cancel this creation
attempt (Ctrl+c or just let it timeout), leave the wsdl in the cache,
then enable the proxy and re-create the client everything works.
I have dug through the docs for Doctor and ImportDoctor looking for a
way to disable the downloading of this file by setting the location to
None but have drawn a blank.
Is this even close to being the right way to work round this problem?
When this client goes in to production it will not have internet
access and will therefore be unable to download the imported schema
proxy or no.
Here is the client setup code I am currently using:
from suds.client import Client
from suds.transport.http import HttpTransport
server = "some.internal.hostname"
t = HttpTransport()
proxy = urllib2.ProxyHandler({})
opener = urllib2.build_opener(proxy)
urllib2.install_opener(opener)
t.urlopener = opener
logging.basicConfig(level=logging.DEBUG)
logging.getLogger('suds.client').setLevel(logging.DEBUG)
self.teamtrack = Client("http://%s/gsoap/ttwebservices.wsdl"%server,
transport=t)
self.teamtrack.set_options(
location="http://%s/gsoap/gsoap_ssl.dll?ttwebservices"%server)
Any thoughts or other avenues for investigation are appreciated.
[0] http://blog.finalhaven.org/2009/01/making-suds-not-use-proxy.html
including comments about fixing the import of HttpTransport
--
Peter Ellis <peter.ellis(a)finalhaven.org>
Hi,
I have/had a suds client that always worked just fine using some wsdl
"generated" using turbogears's tgwebservices.
The problem happened when i tried to run this server on windows 7. after
some tweaking everything was running fine (i could access the wsdl and
use the web services using external clients like soapUI or from a C# GUI
i had developed before)
except for the suds client who stopped working. The "client =
Client(url)" line still works. It creates the service and shows the
methods and types available just fine but every method i try to use just
returns the following error:
URLError: <urlopen error (11004, 'getaddrinfo failed')> (this happens
for all client.service."method"() i try to use)
I was wondering if anyone experienced similar problems. All my previous
problems (already resolved) had to do with the windows 7's IPV6 support.
Could it be related?
Some additional info:
I'm using suds 0.3.4 and python 2.5
As for network connections: I have no proxys enabled and i even disabled
the firewall to no avail
Thanks in advance,
Rui Neves
__________ Information from ESET NOD32 Antivirus, version of virus signature database 4434 (20090917) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
Warning: noob here!
I have a test service method defined as
int addComplexType (TwoNumbers input)
Where TwoNumbers is defined in XMDComplexTypes.xsd as
<schema targetNamespace="http://gov.anl.aps.tieman/XDMXomplexTypes"
elementForDefault="quilified" xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://gov.anl.aps.tieman/XMDComplexTypes">
...
<complexType name="TestComplexType">
<sequence>
<element name="X" type="int"></element>
<element name="Y" type="int"></element>
</sequence>
</complexType>
<element name="TwoNumbers" type="tns:TestComplexType"> </element>
...
</schema>
When I create a client from the WSDL and print it, the method
addComplexType is defined as
...
ns1 = "http://XMD.tieman.aps.anl.gov/XDMService"
...
ns6 = "http://gov.anl.aps.tieman/XMDComplexTypes"
...
methods
addComplexType (ns1:input input, )
...
types
ns6:TestComplexType
...
Where does the type ns1:input come from? It's not defined anywhere in
the schema. Do I need to use the ImportDoctor to fix this? How?
Going on, I can then use the factory to create a variable of the correct
type
twoNumbers = client.factor.create ('ns6:TestComplexType')
and use that as an argument
client.service.addComplexType (twoNumbers)
but, of course, it bombs. The error I get is "Invalid element in
gov.anl.aps.tieman.XMD.stubs.AddComplexTypeRequestInput - X'
Any help would be greatly appreciated!
Brian
Hi -
I am new to python and suds. The method I am calling returns a complex type
- an ArrayOfString. How do I deal with this type in python in order to get
my data?
Brett
The version of suds.
- 0.3.6 and 0.3.7 (tried both)
A public link or copy of the WSDL.
- http://sviis15108.ksde.org/kids_data/kids_webservice.asmx?WSDL
A description of the problem including sample code (if possible).
Everything works, however the amount of time that it takes for
client.service.<function>() to return exceeds the transport time by at
least a minute for one function, another ran for an hour before I killed
the process.
I was able to see that transport time from turning on logging, but I
haven't found the right combination of logging to find what is causing
the slowdown after the http request is complete.
The function that takes a minute has about 403 records with 9 elements
each. The one that never returned had 2979 records with 12 elements
each.
client = Client(options.wsdl)
token = client.factory.create('AuthenticationSoapHeader')
token.Username = username
token.Password = b64encode(hashlib.md5(password).digest())
client.set_options(soapheaders=token)
print "Start: %s" % datetime.now()
result = client.service.get_Organizations()
print "End: %s" % datetime.now()
Any help or suggestions would be appreciated.
--
Nicholas Studt <nstudt(a)ku.edu>
Hello! I'm running into a problem with Exchange Web Services where the
wrapper element for a method invocation has a mandatory attribute that
I can't figure out how to twiddle with suds.
More concretely, I'm trying to make a web services call that looks like:
<SOAP-ENV:Body>
<ns1:FindItem Traversal="shallow">
... child elements ....
</ns1:FindItem>
</SOAP-ENV:Body>
and I can't figure out how to make suds generate the xml right. In particular,
getCalendarView = client.service.FindItem(_Traversal='shallow', ...)
does not work.
This looks like an awful lot like ticket 21
(https://fedorahosted.org/suds/ticket/21) I went back into the
changelogs and dove into the source a bit since it was suggested that
there had been a feature enhancement to cover this since; I didn't see
anything promising. suds.bindings.document.Document.param_defs doesn't
return any of the wrapper-element attributes, so it doesn't look like
there's any opportunity for anything upstream of that to affect them.
Is there syntax for this that I'm missing somewhere? This might also
be related to the problem Ceser wrote about a few days ago.
cheers,
tim