標籤:調試 reference function inf ror referer ecc size soap
轉:http://blog.csdn.net/liu870915/article/details/52066517
方法一:土辦法是使用LR內建的webservice協議,按照嚮導的提示:匯入wsdl、選擇服務名、形成指令碼的架構、讀懂並設定參數值,參照log返回資訊,調試指令碼,很簡單,這裡就不多講了........
方法二:利用LR的web(http/html)協議內建的web_custom_request()函數,向指定的URL地址POST相應的SOAP協議的HTTP訊息,LR function reference對web_custom_request()函數的解釋和樣本,簡直是悲劇,下面首先給出根據wsdl檔案產生SOAP訊息的方法,然後給出函數樣本:
SOAP協議本身,這裡就不累贅了,根據wsdl檔案產生SOAP訊息可以藉助工具XMLSpy這類的工具,它通過匯入wsdl檔案,建立相應服務的SOAP請求,樣本如下:
http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<m:r11OrderReq xmlns:m="http://service.intf.vsop.bss">
<m:in0>String</m:in0>
</m:r11OrderReq>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
下面給出函數樣本:
http://133.37.51.126:7010/xxxxxx/xxxxxx/xxxxxx", "service");//lc
lr_start_transaction("xxxxxxx");
"URL={service}",
"Method=POST",
"Resource=0",
"RecContentType=text/xml",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
"EncType=text/xml;charset=utf-8",
"Body=<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"< CDATA>10000000000172010-4-13‘>http://service.intf.vsop.bss\"><m:in0><![CDATA[<WorkListFKToVSOPReq><streamingNo>1000000000017</streamingNo><TimeStamp>2010-4-1314:00:01</TimeStamp><OrderId>1200000000000017</OrderId><SystemId>FK</SystemId><ActionType>0</ActionType><ProdSpecCode>CDMA</ProdSpecCode><ProductNo>18982765613</ProductNo><UserState>1</UserState></WorkListFKToVSOPReq>]]></m:in0></m:r11OrderReq></SOAP-ENV:Body></SOAP-ENV:Envelope>",
LAST);
if(strcmp(lr_eval_string("{rspcode}") ,"0")) {
//lr_error_message("xxxxxxx fail:%s", lr_eval_string("{rspcode}" ));
lr_error_message("xxxxxxx fail");
}
ps:在<![CDATA]>標記下,所有的標記、實體引用都被忽略,而被XML處理常式一視同仁地當做字元資料看待。
Loadrunner測試webservice介面