Suds Soap 库中出现 TypeNotFound 错误
TypeNotFound error in Suds Soap library
我正在尝试从荷兰土地登记处调用 SOAP 服务(WSDL here) with the suds library。我首先按如下方式反省 SOAP 服务:
>>> from suds.client import Client
>>> client = Client(url='http://www1.kadaster.nl/1/schemas/kik-inzage/20141101/verzoekTotInformatie-2.1.wsdl')
>>> print client
Suds ( https://fedorahosted.org/suds/ ) version: 0.4 GA build: R699-20100913
Service ( VerzoekTotInformatieService ) tns="http://www.kadaster.nl/schemas/kik-inzage/20141101"
Prefixes (13)
ns0 = "http://www.kadaster.nl/schemas/kik-inzage/20141101"
...
ns9 = "http://www.kadaster.nl/schemas/kik-inzage/kadastraalberichtobject/v20141101"
Ports (1):
(VerzoekTotInformatieSOAP)
Methods (1):
VerzoekTotInformatie(ns3:Aanvraag Aanvraag, ) # <== WE WANT TO CALL THIS
Types (278):
ns10:AN1
ns10:AN10
...
ns3:Aanvraag # <== FOR WHICH WE NEED THIS TYPE
ns10:AlgemeenAfsluiting
ns10:AlgemeenBegin
...
所以我想调用(唯一可用的)方法VerzoekTotInformatie
(这意味着"RequestForInformation")它接受一个Aanvraag
对象("Aanvraag"意味着"Request").如您所见,Aanvraag
类型在类型列表中。所以我尝试将其创建为 suggested in the docs,使用:
>>> Aanvraag = client.factory.create('Aanvraag')
No handlers could be found for logger "suds.resolver"
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Library/Python/2.7/site-packages/suds/client.py", line 234, in create
raise TypeNotFound(name)
TypeNotFound: Type not found: 'Aanvraag'
>>>
有谁知道为什么找不到该类型,即使它清楚地显示在类型列表中?
欢迎所有提示!
您需要添加前缀:
In [9]: Aanvraag = client.factory.create('ns3:Aanvraag')
In [10]: Aanvraag
Out[10]:
(Aanvraag){
berichtversie =
(VersieAanvraagbericht){
value = None
}
klantReferentie = None
productAanduiding = None
Gebruiker =
(Gebruiker){
identificatie = None
}
Ingang = <empty>
}
我正在尝试从荷兰土地登记处调用 SOAP 服务(WSDL here) with the suds library。我首先按如下方式反省 SOAP 服务:
>>> from suds.client import Client
>>> client = Client(url='http://www1.kadaster.nl/1/schemas/kik-inzage/20141101/verzoekTotInformatie-2.1.wsdl')
>>> print client
Suds ( https://fedorahosted.org/suds/ ) version: 0.4 GA build: R699-20100913
Service ( VerzoekTotInformatieService ) tns="http://www.kadaster.nl/schemas/kik-inzage/20141101"
Prefixes (13)
ns0 = "http://www.kadaster.nl/schemas/kik-inzage/20141101"
...
ns9 = "http://www.kadaster.nl/schemas/kik-inzage/kadastraalberichtobject/v20141101"
Ports (1):
(VerzoekTotInformatieSOAP)
Methods (1):
VerzoekTotInformatie(ns3:Aanvraag Aanvraag, ) # <== WE WANT TO CALL THIS
Types (278):
ns10:AN1
ns10:AN10
...
ns3:Aanvraag # <== FOR WHICH WE NEED THIS TYPE
ns10:AlgemeenAfsluiting
ns10:AlgemeenBegin
...
所以我想调用(唯一可用的)方法VerzoekTotInformatie
(这意味着"RequestForInformation")它接受一个Aanvraag
对象("Aanvraag"意味着"Request").如您所见,Aanvraag
类型在类型列表中。所以我尝试将其创建为 suggested in the docs,使用:
>>> Aanvraag = client.factory.create('Aanvraag')
No handlers could be found for logger "suds.resolver"
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Library/Python/2.7/site-packages/suds/client.py", line 234, in create
raise TypeNotFound(name)
TypeNotFound: Type not found: 'Aanvraag'
>>>
有谁知道为什么找不到该类型,即使它清楚地显示在类型列表中?
欢迎所有提示!
您需要添加前缀:
In [9]: Aanvraag = client.factory.create('ns3:Aanvraag')
In [10]: Aanvraag
Out[10]:
(Aanvraag){
berichtversie =
(VersieAanvraagbericht){
value = None
}
klantReferentie = None
productAanduiding = None
Gebruiker =
(Gebruiker){
identificatie = None
}
Ingang = <empty>
}