用winsocket协议录制web应用程序

选择winsocket协议,然后选择WIN32应用程序(别选择internet应用程序),然后找到IE的安装目录,启动IE,在地址栏中输入要测试的页面地址,这样就能用winsocket录制web页面了。。上午一直在用internet应用程序录制,结果一直都录制不成功。。中午的时候换了win32应用程序,通过启动IE来录制。。结果可以录制了。嘻嘻。。终于开始测试服务端程序啦。。以前都没怎么用过winsocket协议。。弄的我好崩溃。录制的时候,先选择在vuser_init中录制,登录成功后,然后再切换到action部分录制。下面贴点录制的时候的数据。 #include "lrs.h" Action() { int rc=1; //建立到服务端的连接 rc = lrs_create_socket("socket1","TCP","RemoteHost=www.53kf.com:80",LrsLastArg); if (rc==0) lr_output_message("Socket 1 was successfully created "); else lr_output_message("An error occurred while creating the socket 1, Error Code: %d", rc); //发送数据 rc = lrs_send("socket1", "buf0", LrsLastArg); if (rc==0) lr_output_message("send successfully "); else lr_output_message("send fail %d", rc); //接受数据 rc=lrs_receive("socket1", "buf1", LrsLastArg); if (rc==0) lr_output_message("receive successfully "); else lr_output_message("receive fail %d", rc); //关闭socket连接 lrs_close_socket("socket1"); return 0; } data.ws中的数据。。这个数据分析了好久。。才把数据收发格式弄清楚了 ;WSRData 2 1 send buf0 218 "POST /sendmsg.jsp HTTP/1.1\r\n" "Content-Type: application/x-www-form-urlencoded\r\n" "Host: www1.53kf.com\r\n" "Content-Length:88\r\n" "\r\n" "cmd=QST&sid=4230005&did=654440805&khid=654440405&dwid=600617&msg=dszz&time=1254289031438" recv buf1 296 "HTTP/1.0 200 OK\r\n" "Server: 53KF\r\n" "Content-Type: text/xml;Charset=utf-8\r\n" "Content-Length: 196\r\n" "X-Cache: MISS from cacheserver\r\n" "Via: 1.0 cacheserver:80 (squid/2.6.STABLE4)\r\n" "Connection: keep-alive\r\n" "\r\n" "<?xml version=\"1.0\" encoding=\"utf-8\"?><Data" " /></Res" "ponse>" -1

 

你可能感兴趣的:(jsp,Web,xml,socket,IE)