带有Suds的Python SOAP请求:未找到类型错误

时间:2018-06-02 03:34:15

标签: python soap suds

我知道这是一个常见问题,但如果这是可以解决的话,我不能为我的生活做出努力。

wsdl:from suds.client import Client from suds.xsd.doctor import ImportDoctor, Import url = "http://donotcall.gov.au/dncrtelem/rtw/washing.cfc?wsdl" imp = Import('http://schemas.xmlsoap.org/soap/encoding/') client = Client(url, doctor=ImportDoctor(imp)) print(client)

这是我的代码

Suds ( https://fedorahosted.org/suds/ )  version: 0.6

Service ( WashingService ) tns="http://rtw.dncrtelem"
   Prefixes (4)
      ns0 = "http://rpc.xml.coldfusion"
      ns1 = "http://rtw.dncrtelem"
      ns2 = "http://schemas.xmlsoap.org/soap/encoding/"
      ns3 = "http://xml.apache.org/xml-soap"
   Ports (1):
      (washing.cfc)
         Methods (3):
            GetAccountBalance(xs:string TelemarketerId, xs:string WashOnlyUserId, xs:string TelemarketerPassword)
            GetWashResult(xs:string TelemarketerId, xs:string WashOnlyUserId, xs:string TelemarketerPassword, xs:string ClientReferenceId)
            WashNumbers(xs:string TelemarketerId, xs:string WashOnlyUserId, xs:string TelemarketerPassword, xs:string ClientReferenceId, ArrayOf_xsd_anyType NumbersToWash)
         Types (55):
            ns2:Array
            ArrayOfArrayOf_xsd_anyType
            ArrayOf_xsd_anyType
            ArrayOf_xsd_string
            ns0:CFCInvocationException
            ns2:ENTITIES
            ns2:ENTITY
            ns2:ID
            ns2:IDREF
            ns2:IDREFS
            ns3:Map
            ns2:NCName
            ns2:NMTOKEN
            ns2:NMTOKENS
            ns2:NOTATION
            ns2:Name
            ns2:QName
            ns0:QueryBean
            ns2:Struct
            ns2:anyURI
            ns2:arrayCoordinate
            ns2:base64
            ns2:base64Binary
            ns2:boolean
            ns2:byte
            ns2:date
            ns2:dateTime
            ns2:decimal
            ns2:double
            ns2:duration
            ns2:float
            ns2:gDay
            ns2:gMonth
            ns2:gMonthDay
            ns2:gYear
            ns2:gYearMonth
            ns2:hexBinary
            ns2:int
            ns2:integer
            ns2:language
            ns2:long
            ns3:mapItem
            ns2:negativeInteger
            ns2:nonNegativeInteger
            ns2:nonPositiveInteger
            ns2:normalizedString
            ns2:positiveInteger
            ns2:short
            ns2:string
            ns2:time
            ns2:token
            ns2:unsignedByte
            ns2:unsignedInt
            ns2:unsignedLong
            ns2:unsignedShort

正如预期的那样,它会返回所有可用的方法;

response = client.service.WashNumbers()

但是当我运行方法TypeNotFound: Type not found: '(Document, http://xml.apache.org/xml-soap, )'

它返回错误{{1}}

我已经花了好几个小时在下面的链接中解决这个问题;

Python and PHP SOAP server

直接导入xml.apache.org/xml-soap但却无法使其正常工作。

如果有人有任何想法请帮忙! 这可能是wsdl无效的情况,还是我应该使用其他语言来做这个请求呢?

谢谢!

0 个答案:

没有答案