Type not found: '(schema, http://www.w3.org/2001/XMLSchema, )
<p>I am using suds-client for soap wsdl services. When i try to setup the suds client for soap service, I get the Type not found error. I search everywhere. There are many unanswered questions with the same error. I am adding the links as <a href="http://stackoverflow.com/questions/33611461/typenotfound-type-not-found-schema-http-www-w3-org-2001-xmlschema">Question1</a>, <a href="http://stackoverflow.com/questions/25619104/suds-typenotfound-type-not-found-http-www-w3-org-2001-xmlschema">Question2</a>, <a href="http://stackoverflow.com/questions/12877583/suds-raise-typenotfoundquery-ref-suds-typenotfound-type-not-found-array-h">Question3</a></p>

<p>Here is my code </p>

<pre><code>from suds.client import Client
wsdlfile = 'http://track.tcs.com.pk/trackingaccount/track.asmx?WSDL'
track_client = Client(TCS_TRACK_URI)
</code></pre>

<p>On the last line,  I got this error </p>

<pre><code>Traceback (most recent call last):
File "&lt;console&gt;", line 1, in &lt;module&gt;
File "/home/adil/Code/mezino/RoyalTag/royal_tag_services/sms_service/tcs_api.py", line 24, in &lt;module&gt;
track_client = Client(TCS_TRACK_URI)
File "/home/adil/Code/mezino/RoyalTag/royalenv/local/lib/python2.7/site-packages/suds/client.py", line 112, in __init__
self.wsdl = reader.open(url)
File "/home/adil/Code/mezino/RoyalTag/royalenv/local/lib/python2.7/site-packages/suds/reader.py", line 152, in open
d = self.fn(url, self.options)
File "/home/adil/Code/mezino/RoyalTag/royalenv/local/lib/python2.7/site-packages/suds/wsdl.py", line 159, in __init__
self.build_schema()
File "/home/adil/Code/mezino/RoyalTag/royalenv/local/lib/python2.7/site-packages/suds/wsdl.py", line 220, in build_schema
self.schema = container.load(self.options)
File "/home/adil/Code/mezino/RoyalTag/royalenv/local/lib/python2.7/site-packages/suds/xsd/schema.py", line 95, in load
child.dereference()
File "/home/adil/Code/mezino/RoyalTag/royalenv/local/lib/python2.7/site-packages/suds/xsd/schema.py", line 323, in dereference
midx, deps = x.dependencies()
File "/home/adil/Code/mezino/RoyalTag/royalenv/local/lib/python2.7/site-packages/suds/xsd/sxbasic.py", line 422, in dependencies
raise TypeNotFound(self.ref)
TypeNotFound: Type not found: '(schema, http://www.w3.org/2001/XMLSchema, )'
</code></pre>

<p>Please help me find a solution ?</p>

<p>I have been searching for the answer and finally I found a solution that solved my problem. </p>

<p>We Just need to add the missing schema to the imports of suds. Below is the code</p>

<pre><code>from suds.xsd.doctor import Import, ImportDoctor
imp=Import('http://www.w3.org/2001/XMLSchema',location='http://www.w3.org/2001/XMLSchema.xsd')
imp.filter.add('http://tempuri.org/')
track_client = Client(TCS_TRACK_URI, doctor=ImportDoctor(imp))
</code></pre>

python python-2.7 soap wsdl suds