From: Michael Pelz-S. <mpe...@ya...> - 2007-09-29 20:23:41
|
Hi! I'm new to python web services and trying to learn ZSI from the documentation here: http://pywebsvcs.sourceforge.net/zsi.html ... on Mac OS X 10.4 using python python2.4. Unfortunately I am having trouble running the simple server/client examples on this page. Here is the simple client example code from the web page: ============== from ZSI.client import Binding fp = open('debug.out', 'a') b = Binding(url='/cgi-bin/simple-test', tracefile=fp) fp.close() a = b.average(range(1,11)) assert a == 5 print b.hello() ============== First off, I had to move the "fp.close()" call to the end of the script, otherwise I get "ValueError: I/O operation on closed file". Having corrected this, I still get the following error when running the example: File "./simple_soap_client.py", line 6, in ? a = b.average(range(1,11)) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/ZSI/client.py", line 28, in __call__ requesttypecode=TC.Any(self.name, aslist=1)) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/ZSI/client.py", line 143, in RPC return self.Receive(replytype, **kw) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/ZSI/client.py", line 287, in Receive raise FaultException(msg) ZSI.FaultException: Processing Failure Here is my debug.out file: ===================== _________________________________ Sat Sep 29 16:20:52 2007 REQUEST: <?xml version="1.0" encoding="utf-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ZSI="http://www.zolera.com/schemas/ZSI/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" > <SOAP-ENV:Body> <average> <Eo10735d0 SOAP-ENC:arrayType="xsd:anyType[10]"> <element xsi:type="xsd:integer">1</element> <element xsi:type="xsd:integer">2</element> <element xsi:type="xsd:integer">3</element> <element xsi:type="xsd:integer">4</element> <element xsi:type="xsd:integer">5</element> <element xsi:type="xsd:integer">6</element> <element xsi:type="xsd:integer">7</element> <element xsi:type="xsd:integer">8</element> <element xsi:type="xsd:integer">9</element> <element xsi:type="xsd:integer">10</element> </Eo10735d0> </average> </SOAP-ENV:Body> </SOAP-ENV:Envelope> _________________________________ Sat Sep 29 16:20:52 2007 RESPONSE: Date: Sat, 29 Sep 2007 20:20:52 GMT Server: Apache/2.0.59 (Unix) PHP/5.2.1 DAV/2 mod_ssl/2.0.59 OpenSSL/ 0.9.7l Content-Length: 893 Connection: close Content-Type: text/xml; charset="utf-8" <?xml version="1.0" encoding="utf-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ZSI="http://www.zolera.com/schemas/ZSI/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" > <SOAP-ENV:Body> <SOAP-ENV:Fault> <faultcode>SOAP-ENV:Server</faultcode> <faultstring>Processing Failure</faultstring> <detail> <ZSI:FaultDetail> <ZSI:string>unsupported operand type(s) for +=: 'int' and 'list'</ ZSI:string> <ZSI:trace> /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages/ZSI/dispatch.py:66:_Dispatch /Applications/MAMP/cgi-bin/zsitest.py:12:average</ZSI:trace> </ZSI:FaultDetail> </detail> </SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelope> ============================================= Any help with this would be most appreciated! Thanks, - Michael |