LR参数输出错误
如下:使用lrs_save_searched_string函数可以获取linkID,但输出该参数时确未得到正确输出值。请高手指教,谢谢!脚本和日志如下:脚本:
lrs_save_searched_string("socket0",NULL,"linkID","LB=<link>","RB=</link>",1,0,-1);
lr_output_message("%s",lr_eval_string("{linkID}"));
日志:
Action.c(92): lrs_save_searched_string(socket0, null, linkID, LB=<link>, RB=</link>, 1, 0, -1)
Action.c(92): callSaveParam: whence: received, socket: socket0, offset: 0, length: -1
Action.c(92): callGetReceivedBuffer: socket: socket0 (288), offset: 0, length: -1
Action.c(92): callGetReceivedBuffer: reading last received buffer
Action.c(92): callGetReceivedBuffer: calculate save string boundaries
Action.c(92): fiCalcSearchedStringOffset: miBufLen=332, LB=<link>, miOrdinal=1
Action.c(92): fiLrsArgsParameterizationOK: mpszIn=LB=<link>
Action.c(92): Warning: The string 'link' with parameter delimiters is not a parameter.
Action.c(92): fiLrsArgsParameterizationOK: mppsfzOut=LB=<link>
Action.c(92): fiLrsBoundaryParseOK: mpsfzParameterizedArg=LB=<link>, miParameterizedArgLen=9
Action.c(92): fiCalcSearchedStringLength: miBufLen=332, RB=</link>, miOffset=140
Action.c(92): fiLrsArgsParameterizationOK: mpszIn=RB=</link>
Action.c(92): Warning: The string '/link' with parameter delimiters is not a parameter.
Action.c(92): fiLrsArgsParameterizationOK: mppsfzOut=RB=</link>
Action.c(92): fiLrsBoundaryParseOK: mpsfzParameterizedArg=RB=</link>, miParameterizedArgLen=10
Action.c(92): callGetReceivedBuffer: translate buffer to ascii
Action.c(92): Notify: Saving Parameter "linkID = cc64b1d1e1dc6a709e65984a7232d8e4"
Action.c(93): {linkID} lr_output_message(lr_eval_string("{linkID}"));试试
谢谢云层
谢谢楼上响应!不过我使用建议操作lr_output_message(lr_eval_string("{linkID}"));尝试失败,结果同上面日志一样。
请教一下:lr_output_message(lr_eval_string("{linkID}"));和lr_output_message("%s",lr_eval_string("{linkID}"));两种表达方式有什么区别吗?
另补充:
上述是使用winsocket单协议。同样脚本当我使用winsocket和webservice多协议时运行正常,可以正确输出linkID参数值。
使用winsocket和webservice多协议时的日志如下:
Action.c(89): callRecv:332 bytes were received
Action.c(92): lrs_save_searched_string(socket0, null, linkID, LB=<link>, RB=</link>, 1, 0, -1)
Action.c(92): callSaveParam: whence: received, socket: socket0, offset: 0, length: -1
Action.c(92): callGetReceivedBuffer: socket: socket0 (528), offset: 0, length: -1
Action.c(92): callGetReceivedBuffer: reading last received buffer
Action.c(92): callGetReceivedBuffer: calculate save string boundaries
Action.c(92): fiCalcSearchedStringOffset: miBufLen=332, LB=<link>, miOrdinal=1
Action.c(92): fiLrsArgsParameterizationOK: mpszIn=LB=<link>
Action.c(92): fiLrsArgsParameterizationOK: mppsfzOut=LB=<link>
Action.c(92): fiLrsBoundaryParseOK: mpsfzParameterizedArg=LB=<link>, miParameterizedArgLen=9
Action.c(92): fiCalcSearchedStringLength: miBufLen=332, RB=</link>, miOffset=140
Action.c(92): fiLrsArgsParameterizationOK: mpszIn=RB=</link>
Action.c(92): fiLrsArgsParameterizationOK: mppsfzOut=RB=</link>
Action.c(92): fiLrsBoundaryParseOK: mpsfzParameterizedArg=RB=</link>, miParameterizedArgLen=10
Action.c(92): callGetReceivedBuffer: translate buffer to ascii
Action.c(92): Notify: Saving Parameter "linkID = 3976aa9d772e9dfaf299a70ae349848f"
Action.c(93): Notify: Parameter Substitution: parameter "linkID" ="3976aa9d772e9dfaf299a70ae349848f"
Action.c(93): 3976aa9d772e9dfaf299a70ae349848f
[ 本帖最后由 龙雨 于 2009-12-22 13:17 编辑 ] 这两种写法没区别的,即然使用多协议可以,那只能说明winsocket协议不支持此函数了
谢谢!
谢谢!从日志上看感觉是 lr_eval_string()函数使用问题。
请问一下,使用winsocket单协议的话,还可以使用什么方法输出LR参数值以用于调试脚本?
已解决
哇,已解决!更改语句为lr_output_message(lr_eval_string("<linkID>"));解决问题。看来帮助文档还是很值得研究!
感谢云层、msnshow两位的响应。 学习一下 谢谢分享
页:
[1]