SOAPpy

偶尔配置一个开发环境需要使用 SOAPpy,环境为windows2003 +Python,安装的是SOAPpy-0.12.0, python setup.py install会报错,SyntaxError: from __future__ imports must occur at the beginning of the file。

网上搜了半天,很多都提到了这个问题,包括在Ubuntu下安装也会遇到这个问题,经过分析,这个应该是SOAPpy-0.12.0版本的一个bug。

需要修改../SOAPpy-0.12.0/SOAPpy文件夹下的三个文件:
Client.py
Types.py
Server.py
分别将其中的 from __future__ import nested_scopes移到文件的第一行。
然后在命令行中执行python setup.py install, 即可以正确安装。

阅读更多

python webservice: from SOAPpy import WSDL

11-25

我在用SOAPpy.WSDL 时也遇到了这个问题,希望高手路过时指点一下:rnrn>>> from SOAPpy import WSDLrn>>> url = "http://211.137.45.104:9006/LnXxtCpInterface/services/LNXxtSyncService?wsdl"rn>>> server = WSDL.Proxy(url)rn/usr/lib/pymodules/python2.6/SOAPpy/wstools/XMLSchema.py:2871: DeprecationWarning: object.__init__() takes no parametersrn tuple.__init__(self, args)rn>>> server = WSDL.Proxy(url)rn>>> server.methods.keys()rn[u'sendMo', u'syncResponseRpt', u'sendMt', u'syncStaff', u'syncCorp']rn>>> server.methods['sendMt']rnrn>>> server.methods['sendMt'].inparamsrn[]rn>>> server.methods['sendMt'].inparams[0].typern(u'service.global.v1_0.wsdl.protocol.xxt', u'ArrayOf_soapenc_string')rn>>> server.methods['sendMt'].inparams[0].namernu'mtInfo'rn>>> server.methods['sendMt'].outparams[0].namernu'sendMtReturn'rn>>> server.methods['sendMt'].outparams[0].typern(u'http://schemas.xmlsoap.org/soap/encoding/', u'string')rn>>> server.sendMt(['a','b'])rnTraceback (most recent call last):rn File "", line 1, in rn File "/usr/lib/pymodules/python2.6/SOAPpy/Client.py", line 470, in __call__rn return self.__r_call(*args, **kw)rn File "/usr/lib/pymodules/python2.6/SOAPpy/Client.py", line 492, in __r_callrn self.__hd, self.__ma)rn File "/usr/lib/pymodules/python2.6/SOAPpy/Client.py", line 406, in __callrn raise prnSOAPpy.Types.faultType: : 'fault': : 'text': 'SoapHeader is null', 'messageId': 'SEV_0003', 'exceptionName': 'xxt.protocol.obj.v1_0.common.ServiceException', 'hostname': 'ln_xxt_mh01'>rnrn#NOTE:rn我这里只是调用了一下 sendMt() 方法,输入参数在java 中 其实就是一个 String[] , 为什么在 这里会出现这样的错误?rnrnrnrn

没有更多推荐了,返回首页