Python 使用zeep连接到多个wsdl客户端时使用相同的数据
我正在尝试使用zeep连接到两个不同的wsdl并打印操作。 当我连接到第一个客户端并打印时,我得到了正确的响应,但当我连接到第二个客户端时,我得到了相同的操作 如果我与一个客户机连接,然后重新启动数据库,跳过第一个客户机并与第二个客户机连接,则可以获取数据Python 使用zeep连接到多个wsdl客户端时使用相同的数据,python,wsdl,zeep,Python,Wsdl,Zeep,我正在尝试使用zeep连接到两个不同的wsdl并打印操作。 当我连接到第一个客户端并打印时,我得到了正确的响应,但当我连接到第二个客户端时,我得到了相同的操作 如果我与一个客户机连接,然后重新启动数据库,跳过第一个客户机并与第二个客户机连接,则可以获取数据 from zeep.client import Client localDPClient = Client("http://localhost/StorageManager/?wsdl") print([method for method,
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']
通过添加更多参数解决了此问题
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")