我正在使用SUDS(如SOAP)來測試WSDL文件。這些方法包含鏈接到更多功能的類型。我不知道如何訪問存儲在顯示的類型中的變量。一些示例代碼如下:將參數傳遞到SUDS客戶端語句
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 = ""
參數比輸入簡單值更復雜。
我在下一篇文章中解決了這個問題。 – chrissygormley 2010-01-18 10:02:23
你可以發佈一個鏈接到你的「下一篇文章」? – 2016-04-06 08:47:59