From: Joshua B. <JRB...@lb...> - 2004-04-19 22:04:18
|
You'll need to provide the WSDL of this service then I think someone =20 could help you. -josh On Apr 19, 2004, at 10:45 AM, Mike wrote: > Hello, > =A0 > I am having a problem communicating with a SOAP::Lite server. Here is =20= > an example of the response I am trying to interpret. > =A0 > """ > <SOAP-ENV:Body> > =A0=A0=A0 <namesp1:searchResponse = xmlns:namesp1=3D"http://myurl.com/api"> > =A0=A0=A0=A0=A0 <SOAP-ENC:Array = SOAP-ENC:arrayType=3D"namesp2:SOAPStruct[1]" =20 > xsi:type=3D"SOAP-ENC:Array"> > =A0=A0=A0=A0=A0=A0=A0 <item xsi:type=3D"namesp2:SOAPStruct"> > =A0=A0=A0=A0=A0=A0=A0=A0=A0 <username = xsi:type=3D"xsd:string">johndoe</username> > =A0=A0=A0=A0=A0=A0=A0=A0=A0 <firstname = xsi:type=3D"xsd:string">John</firstname> > =A0=A0=A0=A0=A0=A0=A0=A0=A0 <lastname = xsi:type=3D"xsd:string">Doe</lastname> > =A0=A0=A0=A0=A0=A0=A0 </item> > =A0=A0=A0=A0=A0 </SOAP-ENC:Array> > =A0=A0=A0 </namesp1:searchResponse> > </SOAP-ENV:Body> > """ > =A0 > At first, ZSI chokes on the type "SOAPStruct", which isn't a valid =20 > type as far as ZSI is concerned. That error is: > > =A0 > """ > ZSI.EvaluateException: Any can't parse element > [Element trace: =20 > /SOAP-ENV:Envelope/SOAP-ENV:Body/namesp1:searchResponse/SOAP-ENC:=20 > Array/item] > """ > =A0 > I assumed the next approach would be to alias SOAPStruct to TC.Struct =20= > by subclassing that class and defining SOAPStruct.typecode to resemble = =20 > the (username,firstname,lastname) structure. However, I have tried =20 > numerous attempts without any success. > =A0 > Can someone give me an example of some python code to=A0that will = parse =20 > the response into a dictionary of key/value pairs? > =A0 > Thanks in advance! > Mike > =A0 |