Re: wsdl2py/ZSI and complex types with arrays
On 04Feb2009 15:55, eviljonny h...@about.no.com wrote: | I have been trying to write a web service using ZSI with wsdl2py. I have | read 'The Zolera Soap Infrastructure User’s Guide Release 2.0.0' and some | older guides (a guide by Nortel called Using ZSI with wsdl2py) and am | unable to find any working examples of how to use arrays in complex | types. I have a Request method which takes an array as an argument and | responds with an array. [...] | Can anyone provide me an example (or a link to an example) of how to | populate the arrays in complex types? Even pointing me in the right | direction would be wonderful. I am by no means a ZSI expert. You may do better to join this list: https://lists.sourceforge.net/lists/listinfo/pywebsvcs-talk and ask there. Glancing at some code using ZSI-2.1-a1 here I've got code like this: # MR refers to a complex type with a loginResultList component, # and that contains a list of item elements LRL = MR._loginResultList = MR.new_loginResultList() LRL._item = [] for LI in RQ.get_element_LoginList(): class item: ... fill in some class attributes ... LRL._item.append(item) thus populating the loginResultList with item elements. (item is only a class for the convenience of having _foo attributes easy to assign to). Cheers, -- Cameron Simpson c...@zip.com.au DoD#743 -- http://mail.python.org/mailman/listinfo/python-list
wsdl2py/ZSI and complex types with arrays
Hello all, I have been trying to write a web service using ZSI with wsdl2py. I have read 'The Zolera Soap Infrastructure User’s Guide Release 2.0.0' and some older guides (a guide by Nortel called Using ZSI with wsdl2py) and am unable to find any working examples of how to use arrays in complex types. I have a Request method which takes an array as an argument and responds with an array. Assume I am just trying to write a client at this point. I have tried a lot of variations on this and can get a call made but using a tracefile the element SOIID is always empty no matter what I do. Please excuse me if the code is not fantastic. I am very new to python. #--- from GraphingReporter_services import * from GraphingReporter_services_types import * loc = GraphingReporterLocator() fp = file(/tmp/PYTHON-TRACE,w) port = loc.getGraphingReporterPort(tracefile=fp) request = GraphRequestSOIID() graphRequest = request.new_soiid() graphRequest.Soiid = [123456,123457] request.set_element_soiid(graphRequest) response = port.GetGraphsForSOIID(request) fp.close() #--- The outgoing call in the trace shows #--- SOAP-ENV:Body xmlns:ns1=urn:GraphingReporter ns1:GetGraphsForSOIID soiid/soiid /ns1:GetGraphsForSOIID /SOAP-ENV:Body #--- Can anyone provide me an example (or a link to an example) of how to populate the arrays in complex types? Even pointing me in the right direction would be wonderful. -- EvilJonny -- http://mail.python.org/mailman/listinfo/python-list