Reputation: 806
I'm trying to take the first step in creating a SOAP client with SUDS, Python, and no success.
The WSDL is here: https://login.keyinvoice.com/API3_ws.php?wsdl
The code:
from suds.client import Client
from suds.xsd.doctor import Import, ImportDoctor
imp = Import("http://schemas.xmlsoap.org/soap/encoding/", location="http://schemas.xmlsoap.org/soap/encoding/")
imp.filter.add("http://login.keyinvoice.com/soap/KI_API3")
client = Client("https://login.keyinvoice.com/API3_ws.php?wsdl", doctor=ImportDoctor(imp))
The error:
suds.TypeNotFound: Type not found: '(Array, http://www.w3.org/2001/XMLSchema, )'
I've tried, with no success:
Then I tried a Node lib, and it simply works, but I can't use it.
Is it the WSDL that is broken? Is it bad parameters to ImportDoctor? SUDS bug?
(Python 3.8.2, suds-community==0.8.5)
Thanks!
Upvotes: 0
Views: 215
Reputation: 806
It seems that the WSDL has 2 different ways of referring Arrays. One is xsd:array and the other is SOAP-ENC:Array.
The xsd is defined as xmlns:xsd="http://www.w3.org/2001/XMLSchema" and SOAP-ENC as xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/". I do find the array in the last one and not on the first one but I'm not a expert on SOAP.
So replacing every occurrence of xsd:Array by SOAP-ENC:Array solves it in a way.. I still don't know what is wrong: the WSDL or SUDS library.
Upvotes: 0