英文:
Same data when connection to multiple wsdl clients using zeep
问题
我正在尝试使用zeep连接两个不同的wsdl,并打印操作。
当我连接到第一个客户端并打印时,我获得了正确的响应,但当我然后连接到第二个客户端时,我得到了相同的操作。
from zeep.client import Client
localDPClient = Client("http://localhost/StorageManager/?wsdl")
print([method for method, value in localDPClient.service.__dict__["_operations"].items()])
localDPClient2 = Client("http://localhost/CableBoxManager/?wsdl")
print([method for method, value in localDPClient2.service.__dict__["_operations"].items()])
输出
['ImportArtifacts', 'ImportBundles', 'ExportArtifacts', 'ExportBundles', 'ReadArtifactsFromTypes']
['ImportArtifacts', 'ImportBundles', 'ExportArtifacts', 'ExportBundles', 'ReadArtifactsFromTypes']
期望的输出
['ImportArtifacts', 'ImportBundles', 'ExportArtifacts', 'ExportBundles', 'ReadArtifactsFromTypes']
['IdentifyBox', 'IdentifyCable', 'ReadCable', 'ReadCableDefinition', 'ReadAllCableFeatures', 'ReadBox']
英文:
I'm trying to connect to two different wsdl's using zeep and printing the operations.
When I connect to the first client and print I get the correct respons, but when I then connect to the second I get the same operations.
I can get the data if I connect with one client, then restart the database and skip the first client and connect with the second.
from zeep.client import Client
localDPClient = Client("http://localhost/StorageManager/?wsdl")
print([method for method, value in localDPClient.service.__dict__["_operations"].items()])
localDPClient2 = Client("http://localhost/CableBoxManager/?wsdl")
print([method for method, value in localDPClient2.service.__dict__["_operations"].items()])
Output
['ImportArtifacts', 'ImportBundles', 'ExportArtifacts', 'ExportBundles', 'ReadArtifactsFromTypes']
['ImportArtifacts', 'ImportBundles', 'ExportArtifacts', 'ExportBundles', 'ReadArtifactsFromTypes']
Expected output
['ImportArtifacts', 'ImportBundles', 'ExportArtifacts', 'ExportBundles', 'ReadArtifactsFromTypes'
['IdentifyBox', 'IdentifyCable', 'ReadCable', 'ReadCableDefinition', 'ReadAllCableFeatures', 'ReadBox']
答案1
得分: 1
已解决:通过添加更多参数
localDPClient = Client("http://localhost/StorageManager/?wsdl", service_name="StorageManager", port_name=f"WSHttpBinding_IStorageManager")
localDPClient2 = Client("http://localhost/CableBoxManager/?wsdl", service_name="CableBoxManager", port_name=f"WSHttpBinding_ICableBoxManager")
英文:
Solved it by adding more parameters
localDPClient = Client("http://localhost/StorageManager/?wsdl", service_name="StorageManager", port_name=f"WSHttpBinding_IStorageManager")
localDPClient2 = Client("http://localhost/CableBoxManager/?wsdl", service_name="CableBoxManager", port_name=f"WSHttpBinding_ICableBoxManager")
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论