Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 使用zeep连接到多个wsdl客户端时使用相同的数据_Python_Wsdl_Zeep - Fatal编程技术网

Python 使用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,

我正在尝试使用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']


通过添加更多参数解决了此问题

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")