python-zeep
python-zeep copied to clipboard
zeep.exceptions.XMLParseError: No namespace defined for 'tns' ('tns:ArrayOfKeyValueData')
I want to read data from WSDL with zeep in Python. Here's my simple code:
from zeep import Client
client=Client('http://api.netim.com/2.0/api.wsdl')
r = client.service.sessionOpen("username","password",'EN')
x=client.service.domainTldInfo(r,"COM")
print (x)
I get the following error:
"No namespace defined for %r (%r)" % (prefix, value))
zeep.exceptions.XMLParseError: No namespace defined for 'tns' ('tns:ArrayOfKeyValueData')
I thought it is a bug in the WSDL file. But if I check the same operations with php it works perfectly!
<?php
$clientSOAP = new SoapClient("http://api.netim.com/2.0/api.wsdl");
try
{
$idSession = $clientSOAP->sessionOpen("username", "password", "EN");
$StructDomainTldInfo = $clientSOAP->domainTldInfo($idSession, "COM");
echo "<pre>";
print_r($StructDomainTldInfo);
echo "</pre>";
}
catch(SoapFault $fault)
{
echo "Exception : " .$fault->getMessage(). "\n";
}
if(isset($idSession))
{
$clientSOAP->sessionClose($idSession);
}
?>
Any help is appreciated.
I get the same error here... I found out that if the WSDL metadata is hidden then I get that error. Have you got any response/solution to fix this?
The tns prefix is not defined in the wsdl. You should report a bug with them :-)