How do I handle a method with element that has 1 or more repititions ?
by Carla Cremers
I am trying to add multiple group members : the wsdl structure is a complex type that looks like this, where the wsdl call accepts 1 or more members. Is there any way to create an array of members ?
Methods (31):
(snip)
addGroupMembers(xs:long id, GroupMembersType member, )
(snip)
SOAPUI description of WSDL :
<v5:addGroupMembers>
<v5:id>19</v5:id>
<v5:member>
<!--1 or more repetitions:-->
<v5:member>12223334466</v5:member>
</v5:member>
</v5:addGroupMembers>
I've found a number of methods that don't work :
1 : creating empty list-using factory to create member and append to list : result : suds.WebFault: Server raised fault: '[Server CodecHandler] Failed to decode
-> Found more elements in the soap envelope than required by WSDL
2 : used factory to create member and then attempted to append member : result : Traceback (most recent call last):
File "s7.py", line 28, in ?
member.member.append = "12223334499"
AttributeError: 'str' object has no attribute 'append'
3 : used factory to create 2 members and append 2nd member to first : result : File "s7.py", line 33, in ?
member_array = member_array.append(member)
AttributeError: GroupMembersType instance has no attribute 'append'
Any clue*4s ?
Thanks, Carla
12 years, 7 months
Sporadic Client Creation
by Craig Kost
Hello,
Python 2.7.1
Suds 0.4
Windows XP SP3
I have been using the suds client (suds.client.Client) for testing some SOAP
interfaces and I have recently come across some unpredictable behaviour.
Basically what is happening is I am *sometimes (more often than not)* unable
to create a client from WSDL source.
I guess an example would better shed light on what I mean.
For example I run the following
>>> from suds.client import Client
>>> client = Client("http://localhost:8000/sms/soap/?wsdl")
and I get this traceback
Traceback (most recent call last):
File "<pyshell#15>", line 1, in <module>
client = Client("http://localhost:8000/sms/soap/?wsdl")
File "build\bdist.win32\egg\suds\client.py", line 112, in __init__
self.wsdl = reader.open(url)
File "build\bdist.win32\egg\suds\reader.py", line 152, in open
d = self.fn(url, self.options)
File "build\bdist.win32\egg\suds\wsdl.py", line 159, in __init__
self.build_schema()
File "build\bdist.win32\egg\suds\wsdl.py", line 220, in build_schema
self.schema = container.load(self.options)
File "build\bdist.win32\egg\suds\xsd\schema.py", line 93, in load
child.open_imports(options)
File "build\bdist.win32\egg\suds\xsd\schema.py", line 305, in open_imports
imported = imp.open(options)
File "build\bdist.win32\egg\suds\xsd\sxbasic.py", line 542, in open
result = self.download(options)
File "build\bdist.win32\egg\suds\xsd\sxbasic.py", line 563, in download
return self.schema.instance(root, url, options)
File "build\bdist.win32\egg\suds\xsd\schema.py", line 397, in instance
return Schema(root, baseurl, options)
File "build\bdist.win32\egg\suds\xsd\schema.py", line 226, in __init__
self.open_imports(options)
File "build\bdist.win32\egg\suds\xsd\schema.py", line 305, in open_imports
imported = imp.open(options)
File "build\bdist.win32\egg\suds\xsd\sxbasic.py", line 542, in open
result = self.download(options)
File "build\bdist.win32\egg\suds\xsd\sxbasic.py", line 560, in download
d = reader.open(url)
File "build\bdist.win32\egg\suds\reader.py", line 79, in open
d = self.download(url)
File "build\bdist.win32\egg\suds\reader.py", line 95, in download
fp = self.options.transport.open(Request(url))
File "build\bdist.win32\egg\suds\transport\https.py", line 60, in open
return HttpTransport.open(self, request)
File "build\bdist.win32\egg\suds\transport\http.py", line 62, in open
return self.u2open(u2request)
File "build\bdist.win32\egg\suds\transport\http.py", line 118, in u2open
return url.open(u2request, timeout=tm)
File "C:\Python27\lib\urllib2.py", line 392, in open
response = self._open(req, data)
File "C:\Python27\lib\urllib2.py", line 410, in _open
'_open', req)
File "C:\Python27\lib\urllib2.py", line 370, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 1186, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "C:\Python27\lib\urllib2.py", line 1157, in do_open
r = h.getresponse(buffering=True)
File "C:\Python27\lib\httplib.py", line 1013, in getresponse
response.begin()
File "C:\Python27\lib\httplib.py", line 402, in begin
version, status, reason = self._read_status()
File "C:\Python27\lib\httplib.py", line 366, in _read_status
raise BadStatusLine(line)
BadStatusLine: ''
I can later call* the same* client creation code and successfully create a
usable client.
One last thing. Is there anyway to speed up the creation of the clients.
Sometimes for a simple WSDL it takes up to 1 minute to create a client...
Thanks,
Craig
12 years, 7 months
Fw: SKL 6VD26/20AL-2
by Mukesh Solanki
Dear Sir,
Please quote for new/used/recon for attached enquiry suitable for SKL 6VD26/20AL-2 with delivery period.
Railway & Marine Eqpt.Co.(1965)
Mumbai-India.
M.G.Solanki.
Ph:0091 22 23525443 Mobile:0091 9819823658 Skype:mukesh.solanki8
12 years, 7 months