|
以前都是用Jmeter的xml-rpc request 方式做性能测试,最近想用LR来做做,查到网上说使用web_custom_request来发送请求,照着写了一下代码如下:
- char c_myxml[2000];
- char myxml[]="";
- strcat(myxml," <soap11:Envelope xmlns=\"http://www.derbysoft.com/dswitch/ari\" xmlns:soap11=\"http://schemas.xmlsoap.org/soap/envelope/\">");
- strcat(myxml,"<soap11:Body>");
- strcat(myxml,"<GetChangeRequest Token=\" \">");
- strcat(myxml,"<Contract ChannelCode=\"Bookingcom\" SupplierCode=\"IHG\"/>");
- strcat(myxml,"<RetrieveChangeCriterion>");
- strcat(myxml,"<RetrieveChangeCriteria HotelCode=\"DSIHG109802\" Since=\"2012-04-11T00:00:00\" Type=\"Change\">");
- strcat(myxml,"<DateSpan Start=\"2012-03-01\" End=\"2012-06-01\"/>");
- strcat(myxml,"</RetrieveChangeCriteria>");
- strcat(myxml,"</RetrieveChangeCriterion>");
- strcat(myxml,"</GetChangeRequest>");
- strcat(myxml,"</soap11:Body>");
- strcat(myxml,"</soap11:Envelope>");
- web_custom_request("ihgplugin",
- "Method=POST",
- "RecContentType=text/xml",
- "EncType=text/xml; charset=utf-8",
- "url=http://IP/test/retrieve",
- myxml,
- LAST);
复制代码
在运行时总是提示如下错误:
Action.c(16): Error -27226: The
"<soap11:Envelope xmlns="http://www.derbysoft.com/dswitch/ari" xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/"><soap11:Body><GetChangeRequest Token="ec24db7b-474d-4467-afc8-88e8273be4dc"><Contract ChannelCode="Bookingcom" SupplierCode="IHG"/><RetrieveChangeCriterion><RetrieveChangeCriteria HotelCode="DSIHG109802" Since="2012-04-11T00:00:00" Type="Change"><DateSpan Start="2012-03-01" End="2012-06-01"/></RetrieveChangeCriteria></RetrieveChangeCriterion></GetChangeRequest></soap11:Body></soap11:Envelope>"
argument (number 6) is unrecognized or misplaced [MsgId: MERR-27226]
如果吧myxml 换成如下填写
"Body=<soap11:Envelope xmlns=\"http://www.derbysoft.com/dswitch/ari\" xmlns:soap11=\"http://schemas.xmlsoap.org/soap/envelope/\">"
"<soap11:Body>"
"<GetChangeRequest Token=\"ec24db7b-474d-4467-afc8-88e8273be4dc\">"
"<Contract ChannelCode=\"Bookingcom\" SupplierCode=\"IHG\"/>"
"<RetrieveChangeCriterion>"
"<RetrieveChangeCriteria HotelCode=\"DSIHG109802\" Since=\"2012-04-11T00:00:00\" Type=\"Change\">"
"<DateSpan Start=\"2012-03-01\" End=\"2012-06-01\"/>"
"</RetrieveChangeCriteria>"
"</RetrieveChangeCriterion>"
"</GetChangeRequest>"
"</soap11:Body>"
"</soap11:Envelope>"
是能正常工作的,但是我希望把请求的数据放在外面,这样可以重复利用,便于管理。
请问我最上面的写法哪里不对导致的[MsgId: MERR-27226] 错误,该怎么修改,谢谢。 |
|