gpt4 book ai didi

python - 将参数传递到 SUDS 客户端语句

转载 作者:太空宇宙 更新时间:2023-11-03 23:50:15 25 4
gpt4 key购买 nike

我正在使用 SUDS(类似于 SOAP)来测试 WSDL 文件。这些方法包含链接到更多功能的类型。我不确定如何访问存储在所显示类型中的变量。一些示例代码如下:

from suds.client import Client
client=Client('http://eample.wsdl')
print client

响应是:

 Ports (1):
(PTZ)
Methods (4):
AbsoluteMove(ns4:ReferenceToken ProfileToken, ns4:PTZVector Destination, ns4:PTZSpeed Speed, )
Types (303):
ns4:PTZSpeed

我能够访问这些功能。我找不到任何关于如何在 SUDS 中测试功能的文档。我想测试看看函数是否工作并检查它们的返回值。有谁知道如何做到这一点?

我使用下面的命令来显示所有子函数。

client.factory.create('AbsoluteMove.PTZSpeed.Speed.PanTilt')

我的主要问题基本上是将值传递给函数并获取返回值。

我已尝试传递参数,但参数具有存储在属性中的属性。下面显示了我尝试访问的参数结构的布局。

(AbsoluteMove){
ProfileToken = None
Destination =
(PTZVector){
PanTilt =
(Vector2D){
_x = ""
_y = ""
_space = ""
}
Zoom =
(Vector1D){
_x = ""
_space = ""
}
}
Speed =
(PTZSpeed){
PanTilt =
(Vector2D){
_x = ""
_y = ""
_space = ""
}
Zoom =
(Vector1D){
_x = ""
_space = ""

参数比仅输入简单值更复杂。

最佳答案

尝试调用服务上的方法:

from suds.client import Client
client=Client('http://eample.wsdl')
res = client.service.AbsoluteMove(profile_token, destination, speed)
print res

您需要确定为 AbsoluteMove 方法的这些参数输入什么值。

关于python - 将参数传递到 SUDS 客户端语句,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2065088/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com