|
4#
楼主 |
发表于 2012-11-16 16:04:35
|
只看该作者
修改了脚本,修改UserNo为随机数。加上了一个思考时间。
char *string2;
char *string3;
char *string4;
char *string5;
Action()
{
char string1[] ="";
//1.将3个3位和1个2位的随机数保存在4个变量中
string2 = lr_eval_string("{UserNo}");
string3 = lr_eval_string("{UserNo2}");
string4 = lr_eval_string("{UserNo3}");
string5 = lr_eval_string("{UserNo4}");
//2.拼接4个随机数成为一个11位的随机数
strcat(string1,string2);
strcat(string1,string3);
strcat(string1,string4);
strcat(string1,string5);
//3.保存11位的随机数在一个参数中
lr_save_string(string1, "UserNo5" );
//lr_output_message("the sting is:%s",lr_eval_string("{UserNo4}"));
lr_start_transaction("send");
web_service_call( "StepName=SubmitNLSMSRequest_101",
"SOAPMethod=SearchReqService|SearchReqServiceSoap|SubmitNLSMSRequest",
"ResponseParam=response",
"Service=SearchReqService",
"ExpectedResponse=SoapResult",
"Snapshot=t1353033278.inf",
BEGIN_ARGUMENTS,
"inputXML=<?xml version=\"1.0\" encoding=\"UTF-8\"?><sms-smssearch><id>12345678901234567890123456789012</id><mobileno>{UserNo5}</mobileno><province>031</province><city>310</city><brandid>1</brandid><nettypeid>7</nettypeid><netid>10</netid><smscontent>{UserContent}</smscontent><time>20090208122209</time><extfield1></extfield1><extfield2></extfield2></sms-smssearch>",
END_ARGUMENTS,
BEGIN_RESULT,
END_RESULT,
LAST);
lr_end_transaction("send", LR_AUTO);
lr_think_time(1);
return 0;
}
将controller与agent分开,不幸的是,跑了20分钟,又异常退出了。 |
|