2

I'm trying to create Python client for Textbroker API, but having troubles accessing their SOAP interface. I can access Login Service ( https://api.textbroker.com/Budget/loginService.php?wsdl ) just fine, but when I try to access Budget Check Service ( https://api.textbroker.com/Budget/budgetCheckService.php?wsdl ), I get the following error message:

suds.TypeNotFound: Type not found: '(Struct, http://www.w3.org/2001/XMLSchema, )'

As far as I understood reading other similar questions, I need to use ImportDoctor to fix this issue. I tried the following:

    class BaseService:
        password = None
        wsdl = None
        client = None

        def __init__(self):
            imp = Import('http://www.w3.org/2001/XMLSchema')
            imp.filter.add("urn:loginService")
            self.client = Client(self.wsdl, doctor=ImportDoctor(imp), cache=None)

But unfortunately I still get the same error message. I'm almost sure I need to use ImportDoctor to fix this problem, I just do it wrong.

Pradeep Pati
  • 5,779
  • 3
  • 29
  • 43
  • I'm trying to use textbroker's API as well, and got to the same problem, but I can't figue out how to use accepted answer (replacing the Import by what it gives didn't do the trick for me). Could you post what's working for you, here or by mp? – BriceP Oct 03 '16 at 10:27
  • Accepted answer didn't work for me either, I ended up using PHP for it. – Vladimir Kadalashvili Oct 25 '16 at 20:41
  • Ok, thanks Vladimir. I'll have to find another way. – BriceP Oct 28 '16 at 11:10

1 Answers1

2

As per this answer: SOAP suds and the dreaded schema Type Not Found error you probably need to add a specific location to Import()

imp = Import('http://www.w3.org/2001/XMLSchema',
              location='http://www.w3.org/2001/XMLSchema.xsd')
Community
  • 1
  • 1
hecvd
  • 659
  • 1
  • 8
  • 24