|
回复 1# 云层
基于Http协议绑定的Web Service调用客户端可直接转换为Http+XML,在LR中的脚本可以使用WEB(http/html)协议基于URL方式录制。
脚本如:- Action()
- {
- web_add_header("SOAPAction", "urn:fetchMessage");
- #web_reg_save_param("result", "LB=<?xml version='1.0' encoding='UTF-8'?>", "RB=</soapenv:Envelope>",LAST);
- #web_set_max_html_param_len("4096");
- web_custom_request("MockService",
- "URL=http://10.10.142.215:8090/MockService",
- "Method=POST",
- "Resource=0",
- "Referer=",
- "Snapshot=t1.inf",
- "Mode=HTTP",
- "EncType=text/xml;charset=UTF-8",
- "Body=<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:moc=\"http://test.ws.common.services/mockservice\">"
- "<soapenv:Header/>"
- "<soapenv:Body>"
- "<moc:fetchMessage>"
- "<moc:size>1</moc:size>"
- "<moc:m>100</moc:m>"
- "<moc:data>TEST</moc:data>"
- "</moc:fetchMessage>"
- "</soapenv:Body>"
- "</soapenv:Envelope>",
- LAST);
- #lr_output_message("value : %s", lr_eval_string("{result}"));
- return 0;
- }
复制代码 |
|