When I consume wsdl using python, I get an xml.par

2019-06-03 10:55发布

I followed these instructions to make a local wsdl. Some lines in my local WSDL:

< wsdl:definitions 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"        
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" 
xmlns:tns="http://tempuri.org/" 
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" 
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" 
xmlns:i0="http://Microsoft.ServiceModel.Samples" 
xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" 
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" 
xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" 
xmlns:wsa10="http://www.w3.org/2005/08/addressing" 
xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" 
xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" 
name="CalculatorService" 
targetNamespace="http://tempuri.org/"> 

When I use python like this:

    from SOAPpy import WSDL
    server = WSDL.Proxy('http://114.212.190.58:8000/ServiceModelSamples/service?wsdl')
    server.ADD(a=3,b=4)

I get the error:

xml.parsers.expat.ExpatError: not well-formed(invalid token): line 1, column5.

1条回答
对你真心纯属浪费
2楼-- · 2019-06-03 11:40

when I google basichttpbinding and wshttpbinding,I got Difference between BasicHttpBinding and WsHttpBinding

when I finished reading this article then I found a solution.

In How to: Host a WCF Service in a Managed Windows Service,the thirteenth step.you can replace wshttpBinding with basicHttpBinding in XMLlang file.

Finally everything goes well

Sorry for my poor English.

查看更多
登录 后发表回答