Re: Web_submit_data OR web_custom_request doesnt work! (344 Views)
Reply
Occasional Contributor
Posts: 3
Registered: ‎04-18-2014
Message 1 of 3 (418 Views)

Web_submit_data OR web_custom_request doesnt work!

[ Edited ]

I tried use Fidder and Postman to send a post request, and i get HTTP 201, but when I put these into Loadrunner, using HTTP protocal, and use neither web_submit_data or web_custom_request,  when I wrote Method=POST, it would return http415, but I wrote Method=PUT, it would return http500. dont know why??

Action()

{

 

int nHttpRetCode;

web_set_sockets_option("IGNORE_PREMATURE_SHUTDOWN","1");

 

 

web_reg_find("Text=Exception","Fail=Found",LAST);

 

 

web_custom_request("xxxxxx",

"URL=http://XX.XX.XX.XX:10246/XXXXXX/data/XXXX/list?schema=1.0.1&form=json",

"Method=POST",

"Resource=0",

"RecContentType=application/json",

"Mode=HTML",

"Body={\"$xmlns\": \"id\": \"99999952491\",\"updated\": 1340719562000,\"added\": 1340719562000,\"ownerId\": \"http://XXXXX/data/Account/7568814\",\"addedByUserId\": \"http://XXXXX/idm/data/User/mps/7572451\",\"updatedByUserId\": \"http://XXXX/idm/data/User/mps/7572451\",\"di$identityId\": \"T0100075144\",\"di$packageKey\": \"12\",\"di$cn\": \"T0100075144\",\"di$conCert\": \"12\",\"di$conHash\": \"1\",\"di$conKey\": \"1\",\"di$conKeyCtIv\": \"1\",\"di$conKeyPub\": \"1\",\"di$conKeyPubHash\": \"1\",\"di$intCert\": \"1\",\"di$intHash\": \"1\",\"di$intKey\": \"1\",\"di$intKeyCtIv\": \"1\",\"di$intKeyPub\": \"1\",\"di$intKeyPubHash\": \"1\",\"di$taCert\": \"1\",\"di$taKeyPub\": \"1\",\"di$taKeyPubHash\": \"1\",\"di$tdCert\": \"1\",\"di$tdKeyPub\": \"1\",\"di$tdKeyPubHash\": \"1\",\"di$tlsCert\": \"1\",\"di$tlsHash\": \"1\",\"di$tlsKey\": \"1\",\"di$tlsKeyCtIv\": \"1\",\"di$tlsKeyPub\": \"1\",\"di$tlsKeyPubHash\": \"1\",\"di$trustStatusCert\": \"1\",\"di$trustTaCert\": \"1\"};"

LAST);

 

nHttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE);

 

if (nHttpRetCode == 200)

{

lr_log_message("PUT was successful.");

lr_end_transaction("DS_LocationWS_SessionDS2_PUT", LR_PASS);

}

else

{

lr_log_message("PUT was unsuccessful");

lr_end_transaction("DS_LocationWS_SessionDS2_PUT", LR_FAIL);

}

 

 

return 0;

}

 

 

P.S. This thread has been moved from Performance Center Support and News Forum to LoadRunner Support Forum. -HP Forum Moderator

HP Expert
Posts: 126
Registered: ‎08-11-2011
Message 2 of 3 (355 Views)

Re: Web_submit_data OR web_custom_request doesnt work!

You can compare the raw HTTP data sent by VuGen and Fiddler.

 

In VuGen, after replay the script, you can see the sent data in replay snapshot view.

 

Fiddler should also have similar inteface to view the traffic data.

 

After you got the data, you can copy them to a diff utility, like winmerge, to check whether there're difference.

Occasional Contributor
Posts: 3
Registered: ‎04-18-2014
Message 3 of 3 (344 Views)

Re: Web_submit_data OR web_custom_request doesnt work!

Thanks! I change the body, put which I get from fidder, the response from the server, it works!

 

 

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.