LoadRunner Test WebService interface

Source: Internet
Author: User
Tags cdata soap wsdl

Ext.: http://blog.csdn.net/liu870915/article/details/52066517

Method One: The soil approach is to use the LR comes with the WebService protocol, follow the wizard prompts: Import WSDL, choose a service name, form a script framework, read and set parameter values, reference log return information, Debug script, very simple, here is not much to say ...

Method Two: Use the LR Web (http/html) protocol to bring the Web_custom_request () function to the specified URL address to post the corresponding SOAP protocol HTTP message, LR function reference to Web_ The explanation and example of the Custom_request () function is simply tragic, the following first gives a method for generating a SOAP message based on a WSDL file, and then gives an example of the function:

The SOAP protocol itself, which is not cumbersome here, generates SOAP messages based on a WSDL file with tools such as tool XMLSpy, which creates a SOAP request for the corresponding service by importing a WSDL file, as in the following example:

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>

The following is an example of a function:

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: In <! Under the [cdata]> tag, all tags, entity references are ignored and treated as character data by an XML handler.

LoadRunner Test WebService interface

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.