2013-03-21 2 views
1

Я следовал these instructions, чтобы создать локальный wsdl. Некоторые строки в моем локальном WSDL:Когда я использую wsdl с помощью python, я получаю xml.parsers.expat.ExpatError

< 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/"> 

Когда я использую питон так:

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. 

ответ

1

, когда Google BasicHttpBinding и WsHttpBinding, Я получил Difference between BasicHttpBinding and WsHttpBinding

Когда я закончил читать эту статью, я нашел решение.

В How to: Host a WCF Service in a Managed Windows Service, тринадцатый step.you может заменить WsHttpBinding с BasicHttpBinding в XMLlang файле.

Наконец, все идет хорошо

Извините за мой плохой английский.