IDLE を開いて suds クライアントをインポートすると、次の方法でクライアントを作成できます。
c = Client('http://blah/Core.svc?wsdl')
その後の呼び出し:
c2 = Client('http://blah/Core.svc?wsdl')
TypeNotFound
wsdlファイルでクラスを指定すると、エラーがスローされます。
私が試してみました:
timeout = 5 # and then waiting
cache = None
しかし、同じエラーが発生します。最初のインスタンスを使用できなくてもかまいませんが、2 番目のインスタンスを取得するにはどうすればよいですか?
私は、PySys の単一のインスタンスによって実行されるテストを作成していますが、個別にはデータを共有しません。
余談ですが、この後に quit() IDLE を実行すると、実行中のプロセスを強制終了するかどうかを尋ねられます。クライアントを作成するとスレッドが起動されると仮定して正しいでしょうか?
私が得るエラーは次のとおりです。
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() と c.last_sent() はどちらも空です。
さらに進んで、IIS のログを調べたところ、Python インスタンスで初めて Client(url) を呼び出すたびに、次のようになることがわかりました。
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
しかし、同じ python インスタンス内からの後続の呼び出しでは、次のようになります。
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
応答のサイズは、特定のファイルが要求されるたびに同じです。