Action ()
{
char * position;
char * STR;
int offset;
char * search_str = "ERROR";
Web_set_sockets_option ("Initial_basic_auth", "1");
Web_set_user ("21652362", "zxcv!123", "g1u2367.austin.hp.com:8020");
Lr_start_transaction ("MPO_LP");
Soap_request ("Stepname=soap request",
"url=http://g1u2367.austin.hp.com:8020/sap/bc/srt/rfc/sap/zmpo_lp?sap-client=445",
"url=http://g1u2367.austin.hp.com:8020/sap/bc/srt/rfc/sap/zmpo_lp?sap-client=445&wsdl=1.1",
"Soapenvelope="
"<soapenv:envelope xmlns:soapenv=\" http://schemas.xmlsoap.org/soap/envelope/\ "xmlns:urn=\" urn:sap-com: Document:sap:soap:functions:mc-style\ ">"
"<soapenv:Header></soapenv:Header>"
"<soapenv:Body>"
"<urn:Z9pMpoPriceRfc>"
"<PriceRecord>"
"<item>"
"<Product>{Product}</Product>"
"<ProdOption></ProdOption>"
"<PriceGeo>{PriceGeo}</PriceGeo>"
"<Currency>USD</Currency>"
"<PriceListType></PriceListType>"
"<Incoterm>DDP</Incoterm>"
"<EndDate>2014-12-31</EndDate>"
"<StartQuantity>1</StartQuantity>"
"<StartDate>2014-08-30</StartDate>"
"<Amount>50</Amount>"
"<Uom>EA</Uom>"
"<ScaleFlag></ScaleFlag>"
"<DeleteFlag></DeleteFlag>"
"<PrsPubStPk>{PrsPubStPk}</PrsPubStPk>"
"</item>"
"</PriceRecord>"
"</urn:Z9pMpoPriceRfc>"
"</soapenv:Body>"
"</soapenv:Envelope>",
"Soapaction=sendbympo",
"Responseparam=response",
"Snapshot=t1409203819.inf",
last);
Str= lr_eval_string ("{response}");
Position = (char *) strstr (str, SEARCH_STR);
if (position = = NULL) {
Lr_end_transaction ("Mpo_lp", Lr_pass);
}
Else
Lr_end_transaction ("Mpo_lp", Lr_fail);
Lr_message ("*****************");
Lr_message ("message returned as:%s", lr_eval_string ("{response}"));
Lr_message ("*****************");
return 0;
}
LoadRunner test Web service which need username and password