2010-10-18 70 views
0
server = SOAPpy.WSDL.Proxy(wdf) 

Traceback (most recent call last): 
    File "<pyshell#11>", line 1, in <module> 
    server = SOAPpy.WSDL.Proxy(wdf) 
    File "C:\Python27\lib\soapy\SOAPpy\WSDL.py", line 62, in __init__ 
    self.wsdl = reader.loadFromStream(stream, wsdlsource) 
    File "C:\Python27\lib\soapy\SOAPpy\wstools\WSDLTools.py", line 28, in loadFromStream 
    document = DOM.loadDocument(stream) 
    File "C:\Python27\lib\soapy\SOAPpy\wstools\Utility.py", line 572, in loadDocument 
    return xml.dom.minidom.parse(data) 
    File "C:\Python27\lib\xml\dom\minidom.py", line 1911, in parse 
    return expatbuilder.parse(file) 
    File "C:\Python27\lib\xml\dom\expatbuilder.py", line 928, in parse 
    result = builder.parseFile(file) 
    File "C:\Python27\lib\xml\dom\expatbuilder.py", line 207, in parseFile 
    parser.Parse(buffer, 0) 
ExpatError: syntax error: line 1, column 0 
+0

WDF = 'HTTP:// url_to_wsdl' – sfossen 2010-10-20 15:38:11

回答

0

您正在尝试加载的文件可能无效。它具有无效的语法。 以下代码应该适用于保存为wsdl.xml的有效wsdl文件。

from SOAPpy import WSDL 
wsdlFile = open('wsdl.xml') 
server = WSDL.Proxy(wsdlFile) 
2

使用这一个

>>> import SOAPpy 
>>> url = "your wsdl url" 
>>> nameSpc= "your name space" 
>>> client = SOAPpy.SOAPProxy(url,namespace = nameSpc) 
>>> client.config.buildWithNamespacePrefix = 0 // only for callin .net service 
>>> client.config.dumpSOAPIn = 1 // in case to debug 
>>> client.config.dumpSOAPOut = 1 // in case to debug 
>>> result = client.TestPython(name = "ss") // name is the name of the parameter used in 
                in the service method 
>>> print result 
相关问题