1

Environment : CentOS 6.4 64bit, Python 2.6.6, Magento 1.7, Magento Core API, Suds 0.4.1

Python Code:

client = Client(http://   /figol/api/soap/?wsdl)
client.service.login('figol', 'figol123')

Error Detail: TypeNotFound: Type not found: '(Array, http://schemas.xmlsoap.org/soap/encoding/, )

But PHP Code:

$client = new SoapClient(http://    /figol/api/soap/?wsdl);
$session = $client->login('figol', 'figol123');

Works Perfectly.

I have tried many way(SOAP suds and the dreaded schema Type Not Found error), but there is no luck. Any help is very appreciated. Thanks.

Community
  • 1
  • 1
figol
  • 11
  • 2

1 Answers1

0

Don't know how PHP works fine but I've encounter the same error when use suds in Python. This is due to broken wsdl/xsd. See this post here.

Using suds's 'doctor' module solves this issue. Here is my code used to patch the broken wsdl definition I used to connect Magento api

from suds.client import Client
from suds.xsd.doctor import ImportDoctor, Import

imp = Import('http://schemas.xmlsoap.org/soap/encoding/')
imp.filter.add('urn:Magento')
d = ImportDoctor(imp)
client = Client(self.url, doctor=d)
Jacob CUI
  • 1,327
  • 15
  • 11