suds.TypeNotFound:未找到类型:' Number'

时间:2015-01-22 10:54:40

标签: python soap wsdl suds

我第一次使用最新版本的suds(https://fedorahosted.org/suds/)而且我在第一步停滞不前。

suds.TypeNotFound: Type not found: 'Number'

这里的WSDL文件:https://teenused.elion.ee/external/services/index.php?wsdl

我尝试使用ImportDoctor但它没有帮助我。 你考虑过吗?

from suds.client import Client
from suds.sax.text import Raw
from suds.xsd.doctor import Import, ImportDoctor

tns = "http://teenused.elion.ee/external/services/"
imp = Import('http://schemas.xmlsoap.org/soap/encoding/', 'http://schemas.xmlsoap.org/soap/encoding/')
imp.filter.add(tns)
url = 'https://teenused.elion.ee/external/services/index.php?wsdl'
client = Client(url, plugins=[ImportDoctor(imp)])

raw_request = Raw(***request***)
print client.service.listOwnNumbers(__inject={'msg': raw_request})

请求

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://teenused.elion.ee/external/services/">
 <SOAP-ENV:Header>
  <wsse:Security mustUnderstand="true">
     <wsse:UsernameToken>
        <wsse:Username>P023445433765@elion.ee</wsse:Username>
        <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">*********</wsse:Password>
        <wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">N2Q3YTliYTExMzY2YjQxZTY2YWZjMjY4MWFlYzIxMTY=</wsse:Nonce>
        <wsu:Created>2015-01-20T07:40:47.840077Z</wsu:Created>
     </wsse:UsernameToken>
  </wsse:Security>
 </SOAP-ENV:Header>
 <soapenv:Body>
   <ser:listOwnNumbers/>
</soapenv:Body>
</soapenv:Envelope>

0 个答案:

没有答案