|
2#
楼主 |
发表于 2007-7-13 18:22:33
|
只看该作者
问题解决了,
lr_load_dll( "MD5.dll" );
//lr_rendezvous("LogIn");
web_add_auto_header("SOAPAction", "\"\"");
soap_request("StepName=login",
"URL=http://192.2.104.250:9080/safe/LoginWebService",
"SOAPEnvelope=<?xml version=\"1.0\" encoding=\"zh_cn\" standalone=\""
"no\"?><soap:Envelope xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" "
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:soap=\""
"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Body><login xmlns=\""
"http://www.openuri.org/\"><inParam xmlns=\"java"
":ecsolutions.safe.parameters\"><action xsi:nil=\"true\"/><authHash xsi"
":nil=\"true\"/><funcID xsi:nil=\"true\"/><menuID xsi:nil=\"true\"/>"
"<methodID xsi:nil=\"true\"/><organCode>330000000201</organCode>"
"<sessionID xsi:nil=\"true\"/><sessionIDSSO xsi:nil=\"true\"/><userID"
">QC001</userID><warningCheck xsi:nil=\"true\"/><authList xsi:nil=\""
"true\"/><authListHash xsi:nil=\"true\"/><authMethod xsi:nil=\"true\"/>"
"<password xsi:nil=\"true\"/><sessionStatus>beginSession</sessionStatus"
"><verno xsi:nil=\"true\"/></inParam></login></soap:Body></soap"
":Envelope>",
"Snapshot=t1.inf",
"ResponseParam=response",
LAST);
if (LR_PASS == 1) {
lr_error_message(lr_eval_string("{response}"));
}else{
gvsessionID = lr_xml_get_values("XML={response}",
"FastQuery=/Envelope/Body/loginResponse/loginResult/sessionID",
"ValueParam=sessionID",
LAST);
if (gvsessionID==0) {
lr_error_message(lr_eval_string("{response}"));
}
}
//开始取sessionID之后进行加密操作获取authHash的数值
//lr_output_message(lr_eval_string("{sessionID}"));
strcat(pmd,lr_eval_string("{sessionID}"));//脚本数值转化为c数值
//lr_output_message("**test**%s",pmd);
/*
strcat组合sessionid,unionchar,password需要加密的内容为一个字符串pmd
*/
strcat(pmd,sessionid);
strcat(pmd,unionchar);
strcat(pmd,password);
// 计算字符串的长度保存到len中
len = strlen( pmd );
//pmd加密的结果保存到pmd5
strcat(pmd5,MDString(pmd,len));
//同时保存结果到pmdclientinfo
//lr_output_message("**********MD5--1 authHash*******:%s", pmd5);
//再次加密
strcat(pmd5,unionchar);
itoa(authHashid,authHashchar, 10);
strcat(pmd5,authHashchar);
//lr_output_message("********** authHash*******:%s", pmd5);
ilen = strlen(pmd5);
strcat(authHash,MDString(pmd5,ilen));
//lr_output_message("**********MD5--2 authHash*******:%s",authHash);
lr_save_string(authHash , "authHashvalue" );
//lr_output_message("**********MD5--3 authHash*******:%s",lr_eval_string("{authHashvalue}") );
//结束输出authHashvalue
soap_request("StepName=login_2",
"URL=http://192.2.104.250:9080/safe/LoginWebService",
"SOAPEnvelope=<?xml version=\"1.0\" encoding=\"zh_cn\" standalone=\""
"no\"?><soap:Envelope xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" "
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:soap=\""
"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Body><login xmlns=\""
"http://www.openuri.org/\"><inParam xmlns=\"java"
":ecsolutions.safe.parameters\"><action xsi:nil=\"true\"/><authHash"
">{authHashvalue}</authHash><funcID>2E1</funcID>"
"<menuID xsi:nil=\"true\"/><methodID xsi:nil=\"true\"/><organCode"
">330000000201</organCode><sessionID"
">{sessionID}</sessionID>"
"<sessionIDSSO xsi:nil=\"true\"/><userID>QC001</userID><warningCheck "
"xsi:nil=\"true\"/><authList xsi:nil=\"true\"/><authListHash xsi:nil=\""
"true\"/><authMethod>digest</authMethod><password xsi:nil=\"true\"/>"
"<sessionStatus xsi:nil=\"true\"/><verno>7011</verno></inParam></login>"
"</soap:Body></soap:Envelope>",
"Snapshot=t2.inf",
"ResponseParam=response",
LAST); |
|