在Operation下拉列表中列出了该Service所提供的所有操作接口,而下方提供了该接口的输入/输出结构。
这里我们做一个简单的业务流程,用户首先查询自己所在城市的城市编号,再通过编号查询得到对应城市的天气情况。
方法getSupportCityString提供了对于城市查询返回对应编号的服务,这里选择该Operation,并且在Input Arguments中输入我们需要查询的城市名称“上海”(可以参数化),如图8.25所示。
图8.25 访问getSupportCityString服务
单击OK按钮完成调用,生成对应的代码:
web_service_call( "StepName=getSupportCityString_101", "SOAPMethod=WeatherWS|WeatherWSSoap|getSupportCityString", "ResponseParam=response", "Service=WeatherWS", "ExpectedResponse=SoapResult", "Snapshot=t1320732864.inf", BEGIN_ARGUMENTS, "theRegionCode=上海", END_ARGUMENTS, BEGIN_RESULT, END_RESULT, LAST); |
对于Web_service_call函数,自身就提供了关联返回的功能,该请求的返回会保存在参数response和getSupportCitystring_101_response中。我们启动日志运行该函数检查服务器返回,代码如下:
Action.c(4): Notify: Saving Parameter "getSupportCityString_101_Response = <getSupportCityString><getSupportCityStringResult><string>宝山,2009</string><string>崇明,2012</string><string>奉贤,2063</string><string>嘉定,2011</string><string>金山,3530</string><string>闵行,2008</string><string>南汇,2014</string><string>浦东,2015</string><string>青浦,2061</string><string>上海,2013</string><string>松江,3413</string><string>徐家汇,3643</string></getSupportCityStringResult></getSupportCityString>". Action.c(4): Notify: Saving Parameter "response = <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/ xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:xsd=" |