0

Opening up IDLE and importing the suds Client, I can create a client by:

c = Client('http://blah/Core.svc?wsdl')

Subsequently calling:

c2 = Client('http://blah/Core.svc?wsdl')

will get me a TypeNotFound error being thrown, naming a class in the wsdl file.

I have tried:

timeout = 5 # and then waiting
cache = None

But the same error occurs. I don't mind if I cannot use the first instance, but how do I get hold of the 2nd?

I am writing tests, which will be run by a single instance of PySys, but which individually don't share data.

As an aside, when I quit() IDLE after this, it asks if I want to kill the running process, so am I correct in assuming creating a Client fires off a thread?

The error I get is:

Traceback (most recent call last):
  File "<pyshell#9>", line 1, in <module>
    c1 = Client('http://localhost:8090/Service/Core.svc?wsdl')
  File "build\bdist.win-amd64\egg\suds\client.py", line 119, in __init__
    sd = ServiceDefinition(self.wsdl, s)
  File "build\bdist.win-amd64\egg\suds\servicedefinition.py", line 58, in __init__
    self.paramtypes()
  File "build\bdist.win-amd64\egg\suds\servicedefinition.py", line 137, in paramtypes
    item = (pd[1], pd[1].resolve())
  File "build\bdist.win-amd64\egg\suds\xsd\sxbasic.py", line 63, in resolve
    raise TypeNotFound(qref)
TypeNotFound: Type not found: '(ClassName, http://schemas.datacontract.org/4004/07/Class.Namespace, )'

c.last_received() and c.last_sent() both are empty.

Going further, I looked at the log of my IIS and found that, whenever I call Client(url) for the first time in a python instance, I get:

GET /Service/Core.svc   wsdl    8090    -   ::1 Python-urllib/2.6   
GET /Service/Core.svc   xsd=xsd0    8090    -   ::1 Python-urllib/2.6   
GET /Service/Core.svc   xsd=xsd2    8090    -   ::1 Python-urllib/2.6   
GET /Service/Core.svc   xsd=xsd1    8090    -   ::1 Python-urllib/2.6   
GET /Service/Core.svc   xsd=xsd3    8090    -   ::1 Python-urllib/2.6   
GET /Service/Core.svc   xsd=xsd2    8090    -   ::1 Python-urllib/2.6   
GET /Service/Core.svc   xsd=xsd1    8090    -   ::1 Python-urllib/2.6   
GET /Service/Core.svc   xsd=xsd3    8090    -   ::1 Python-urllib/2.6   
GET /Service/Core.svc   xsd=xsd2    8090    -   ::1 Python-urllib/2.6   
GET /Service/Core.svc   xsd=xsd1    8090    -   ::1 Python-urllib/2.6   
GET /Service/Core.svc   xsd=xsd3    8090    -   ::1 Python-urllib/2.6   
GET /Service/Core.svc   xsd=xsd2    8090    -   ::1 Python-urllib/2.6   
GET /Service/Core.svc   xsd=xsd3    8090    -   ::1 Python-urllib/2.6   
GET /Service/Core.svc   xsd=xsd1    8090    -   ::1 Python-urllib/2.6   
GET /Service/Core.svc   xsd=xsd2    8090    -   ::1 Python-urllib/2.6   
GET /Service/Core.svc   xsd=xsd3    8090    -   ::1 Python-urllib/2.6   

But subsequent calls from within the same python instance give me:

GET /Service/Core.svc   wsdl    8090    -   ::1 Python-urllib/2.6
GET /Service/Core.svc   xsd=xsd0    8090    -   ::1 Python-urllib/2.6
GET /Service/Core.svc   xsd=xsd2    8090    -   ::1 Python-urllib/2.6
GET /Service/Core.svc   xsd=xsd3    8090    -   ::1 Python-urllib/2.6
GET /Service/Core.svc   xsd=xsd1    8090    -   ::1 Python-urllib/2.6
GET /Service/Core.svc   xsd=xsd2    8090    -   ::1 Python-urllib/2.6
GET /Service/Core.svc   xsd=xsd3    8090    -   ::1 Python-urllib/2.6

The size of the response is the same each time a certain file is requested.

Peter
  • 1,381
  • 2
  • 13
  • 24
  • this error certainly implies that the second call to your service is not returning the same wsdl. – olly_uk Sep 11 '12 at 09:14
  • If I get a client, restart the IDLE shell and get the client again, everything is fine. The issue only occurs when the called twice from the same shell. – Peter Sep 11 '12 at 10:32

2 Answers2

1

This may be an issue elsewhere (i.e. with the service providing the WSDL) as i can not reproduce either in IDLE or python command shell or script (i am using windows) when using a SOAP service.

could you provide the exact error, the version of suds and the actual URL to the WSDL in question?

The below output is the same regardless of how i try.

>>> from suds.client import Client
>>> c1 = Client('http://vocab.nerc.ac.uk/vocab2.wsdl')
>>> c2 = Client('http://vocab.nerc.ac.uk/vocab2.wsdl')
>>> c1
<suds.client.Client object at 0x022AE230>
>>> c2
<suds.client.Client object at 0x022CCDB0>
>>>

EDIT:

with regard to the notice on quitting IDLE that occurs even if you have run no code in IDLE and then type quit() to close

EDIT 2:

Try debugging this by using some of the techniques mentioned here (both last_sent and logging)

Community
  • 1
  • 1
olly_uk
  • 11,559
  • 3
  • 39
  • 45
  • I'm having a hard time tracking down issues with the wsdl file. Is there any way to wipe all of the persistence from the first client created? – Peter Sep 11 '12 at 10:25
  • i'm not %100 sure but i think the only caching is stopped when you apply `c1 = Client('wsdl_url', cache=None)` when creating the client – olly_uk Sep 11 '12 at 10:44
0

This error does not arise in the suds default. This appear after apply this patch below:

recurselevel-schema.py.patch https://github.com/sandersnewmedia/suds/blob/master/suds/xsd/recurselevel-schema.py.patch

in the file /suds/xsd/schema.py

This patch solve the "recursive level schema error" but cause error when do you need to work with multiple suds clients pointing to the same wsdl.

Wagner Cipriano
  • 1,337
  • 1
  • 12
  • 13