|
5金钱
C#post提交到dwr页面返回数据错误,抓包的信息是通过httpwatch抓的,在软件中模拟,
返回的数据是
throw 'allowScriptTagRemoting is false.';
//#DWR-REPLY
if (window.dwr) dwr.engine._remoteHandleBatchException({ name:'java.lang.SecurityException', message:'Session Error' });
else if (window.parent.dwr) window.parent.dwr.engine._remoteHandleBatchException({ name:'java.lang.SecurityException', message:'Session Error' });
下面是抓包信息
POST /ilearn/dwr/call/plaincall/lessonStudyData.updateRcoTreeList.dwr HTTP/1.1
Accept: */*
Accept-Language: zh-cn
Referer: https://learning.sinopec.com/ile ... t.jsp?rco_id=149431
Content-Type: text/plain
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727)
Host: learning.sinopec.com
Content-Length: 1492
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: JSESSIONID=7f00000130d54c5b57114ce3499fb71aa5013bcbf830.e34TaN8Qbh8Rc40LbxuRbN0OchuKe6fznA5Pp7ftolbGmkTy; PD-S-SESSION-ID=2_1_DIWZevre5xATMO2GQjDBHsK2Mg16b3UWhlassJVaV0IHbJGJ; PD-ID=VxKfT5YlbkR3UBs/YFeHpJ4vzwUmoK4brHvglw8GOGg1BeZpu+RQgnYyUqpZtDnmq2Wd+FJ4XQkty7s3XUZEQHA6x0kyJZ/whzmP4DVk67xiSy8CHhVeDe4Dn3OLh7Ppkyeua/i99FsBZUSWoPH6XKieIu5Be0WMUnkAut7G6W9oNoz9MPMRy4xD7xp6bUdXHzcvgbOQCTk092TuwB0lRstPL1T2EFubZ2lPr1ZBT9Wy9e4PYlno4O+g/ZuTmMw6NEo12EH3XMNZugfoWoFvVw==; PD_STATEFUL_7d34c2c6-d447-11e3-9010-00155d814c01=%2Filearn; oracle.ila.player=sWoAg5Snutw9tmJ3YX1CWuPSBPP68Pw4tUccSxovf6C6cP56kOToBU+5WXhZeVRd5Jj69T/oxP51%COkgGRRkY7Fp/g$$
callCount=1
page=/ilearn/en/learner/jsp/player/player_left.jsp?rco_id=149431
httpSessionId=7f00000130d54c5b57114ce3499fb71aa5013bcbf830.e34TaN8Qbh8Rc40LbxuRbN0OchuKe6fznA5Pp7ftolbGmkTy
scriptSessionId=BB05C30FAC0C643B7C86EDCC97909DB8636
c0-scriptName=lessonStudyData
c0-methodName=updateRcoTreeList
c0-id=0
c0-e1=string:149431
c0-e2=string:149432
c0-e3=string:149432
c0-e4=string:13582221
c0-e5=string:1225367
c0-e6=string:13611016
c0-e7=string:181
c0-e8=string:incomplete
c0-e9=string:0.0
c0-e10=string:
c0-e11=string:
c0-e12=string:
c0-e13=string:2014-10-16%2014%3A18%3A24
c0-e14=string:2014-10-16%2015%3A25%3A53
c0-e15=string:0.0
c0-e16=string:I
c0-e17=string:
c0-e18=string:
c0-e19=string:33
c0-e20=string:N
c0-e21=string:C
c0-e22=string:Y
c0-param0=Object_Object:{rco_id:reference:c0-e1, pre_rco_id:reference:c0-e2, curr_rco_id:reference:c0-e3, icr_id:reference:c0-e4, user_id:reference:c0-e5, tbc_id:reference:c0-e6, site_id:reference:c0-e7, cmi_core_lesson_status:reference:c0-e8, cmi_core_score_raw:reference:c0-e9, cmi_core_lesson_location:reference:c0-e10, cmi_suspend_data:reference:c0-e11, cmi_core_session_time:reference:c0-e12, start_time:reference:c0-e13, start_study_time:reference:c0-e14, pre_score:reference:c0-e15, pre_status:reference:c0-e16, pre_location:reference:c0-e17, pre_suspend_data:reference:c0-e18, effectivelength:reference:c0-e19, is_lesson_time:reference:c0-e20, tracking_type:reference:c0-e21, attempt_num_flag:reference:c0-e22}
c0-param1=string:U
batchId=5
下面是post代码:
item = new HttpItem()
{
URL = "https://learning.sinopec.com/ilearn/dwr/call/plaincall/lessonStudyData.updateRcoTreeList.dwr",
Method = "POST",
Accept = "*/*",
Referer = "https://learning.sinopec.com/ilearn/en/learner/jsp/player/player_left.jsp?rco_id=149431",
ContentType = "text/plain",//返回类型
Postdata = "callCount=1" +"&" + "page=/ilearn/en/learner/jsp/player/player_left.jsp?rco_id=149431" /
//数据太长, 两个相邻数据用“&”,或者用“\r\n” 换行符
Cookie = Cookies,
};
result = http.GetHtml(item);
Cookies = Utilities.MergerCookies(Cookies, result.Cookie);
retCode = result.Html;
用“&”,或者用“\r\n” 换行符 都试验过。。。。。POST的返回都是
throw 'allowScriptTagRemoting is false.';
//#DWR-REPLY
if (window.dwr) dwr.engine._remoteHandleBatchException({ name:'java.lang.SecurityException', message:'Session Error' });
else if (window.parent.dwr) window.parent.dwr.engine._remoteHandleBatchException({ name:'java.lang.SecurityException', message:'Session Error' });
疑问:1.Postdata 的格式是否正确,如不正确,应该怎么写。
2.POST之前是不是还有别的需要执行的(如JS或者是窗口信息之类的)
|
最佳答案
查看完整内容
好粗心啊!!
上述结果正确吗?
如正确,按以下方法改动:
1.最后POST数据的连接用"\r\n",而非"&"。
2.string KCookies = Utilities.GetMidStr(result.Cookie, "JSESSIONID=", ";"); 而非string KCookies = result.Cookie;
另:你手里有我最新的“C#代码生成器”,你在我的好友里?
|