gpt4 book ai didi

python - 当我使用python消耗wsdl时,得到了xml.parsers.expat.ExpatError

转载 作者:太空宇宙 更新时间:2023-11-03 19:03:04 24 4
gpt4 key购买 nike

我按照these instructions制作了本地wsdl。
我的本地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/">


当我像这样使用python时:

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


我得到错误:

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

最佳答案

当我谷歌basichttpbinding和wshttpbinding时,我得到了Difference between BasicHttpBinding and WsHttpBinding

当我阅读完本文后,便找到了解决方案。

How to: Host a WCF Service in a Managed Windows Service,第十三
您可以在XMLlang文件中用basicHttpBinding替换wshttpBinding。

终于一切顺利

对不起,我的英语不好。

关于python - 当我使用python消耗wsdl时,得到了xml.parsers.expat.ExpatError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15548002/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com