|
录制脚本时选择的是多协议: Web (HTTP/HTML), Web Services
现在是我要从返回文件中读取数据,然后参数化
返回文件是XML格式的,代码如下
<?xml version="1.0" encoding="utf-8" ?>
- <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://www.starlims.com/webservices/" xmlns:types="http://www.starlims.com/webservices/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
- <tns:RunActionResponse>
<RunActionResult xsi:type="xsd:int">29001100</RunActionResult>
</tns:RunActionResponse>
</soap:Body>
</soap:Envelope>
我要取29001100这个值,使用注册函数web_reg_save_param_ex(),LR中相关代码如下
web_reg_save_param_ex(
"ParamName=bai",
"LB=<RunActionResult xsi:type=\"xsd:int\">",
"RB=",
"NotFound=error",
SEARCH_FILTERS,
"Scope=ALL",
"ContentType=text/xml",
LAST);
soap_request("StepName=RunAction_24",
"URL=http://192.168.0.56/STARLIMS10.da/services/generic.asmx",
"SOAPEnvelope="
"<?xml version=\"1.0\" encoding=\"GBK\" standalone=\"no\"?>"
"<soap:Envelope xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:types=\"http://www.starlims.com/webservices/encodedTypes\" xmlns:tns=\"http://www.starlims.com/webservices/\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"
"<soap:Body soap:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">"
"<tns:RunAction>"
"<actionID xsi:type=\"xsd:string\">SampleLogin.AddSample</actionID>"
"<parameters href=\"#id1\"></parameters>"
"</tns:RunAction>"
"<soapenc:Array soapenc:arrayType=\"xsd:anyType[1]\" id=\"id1\">"
"<Item xsi:type=\"xsd:string\">131410015</Item>"
"</soapenc:Array>"
"</soap:Body>"
"</soap:Envelope>",
"Snapshot=t182.inf",
"ResponseParam=response",
LAST);
soap_request("StepName=RunAction_24",.....这个是返回我要取值的所在函数,我把注册函数放在了请求函数之前
运行脚本,一直报错,未匹配到记录
Action.c(2062): Error -35061: No match found for the requested parameter "bai". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 256 bytes, use web_set_max_html_param_len to increase the parameter size [MsgId: MERR-35061]
Action.c(2062): web_url("RUNTIME_SUPPORT.GetData.lims_4") highest severity level was "ERROR", 1375 body bytes, 219 header bytes [MsgId: MMSG-26388]
各位高手帮我看看,这个问题困扰我好几天了,多谢啦!!☆⌒(*^-゜) |
|