Web service 参数的问题
当前要做一个项目的压力测试,工具选用的是 LR 9.51项目架构是
C/s Client + Web Service + Sql Server
项目的做法是,在客户端将需要操作的对象组装好,然后将对像发到App Server,
录入,回放均正常,现在又个参数化得问题,请大家指教
问题:
对象是在客户端组装的,比如说(客户:电话,姓名),组装的对象,如何参数化后发送到app server
为谢 脚本发一下 Insert 的脚本
web_service_call( "StepName=Execute_15",
"SOAPMethod=Dispatch|DispatchSoap|Execute",
"ResponseParam=response",
"Service=Dispatch",
"ExpectedResponse=SoapResult",
"Snapshot=t37.inf",
BEGIN_ARGUMENTS,
"assemblyName=ETalk.CRM.Dealer.Server",
"className=ETalk.CRM.Dealer.BLL.DealerBO",
"methodName=Insert",
"xml:inputParam="
"<inputParam base64Mode=\"file\">WSDL\\@Base64RecordedFiles\\0.bin</inputParam>",
"xml:AuthenHeaderValue="
"<AuthenHeaderValue>"
"<Sessionid>6c72de7e-0f83-48f3-b41b-8eacbbca6ff1</Sessionid>"
"<Username>admin</Username>"
"<Password>admin</Password>"
"</AuthenHeaderValue>",
END_ARGUMENTS,
BEGIN_RESULT,
END_RESULT,
LAST);
update 的脚本
web_service_call( "StepName=Execute_18",
"SOAPMethod=Dispatch|DispatchSoap|Execute",
"ResponseParam=response",
"Service=Dispatch",
"Snapshot=t40.inf",
BEGIN_ARGUMENTS,
"assemblyName=ETalk.CRM.Dealer.Server",
"className=ETalk.CRM.Dealer.BLL.DealerBO",
"methodName=Update",
"xml:inputParam="
"<inputParam base64Mode=\"file\">WSDL\\@Base64RecordedFiles\\1.bin</inputParam>",
"xml:AuthenHeaderValue="
"<AuthenHeaderValue>"
"<Sessionid>6c72de7e-0f83-48f3-b41b-8eacbbca6ff1</Sessionid>"
"<Username>admin</Username>"
"<Password>admin</Password>"
"</AuthenHeaderValue>",
END_ARGUMENTS,
BEGIN_RESULT,
END_RESULT,
LAST);
delete 的脚本
web_service_call( "StepName=Execute_29",
"SOAPMethod=Dispatch|DispatchSoap|Execute",
"ResponseParam=response",
"Service=Dispatch",
"Snapshot=t51.inf",
BEGIN_ARGUMENTS,
"assemblyName=ETalk.CRM.Dealer.Server",
"className=ETalk.CRM.Dealer.BLL.DealerBO",
"methodName=LogicalDelete",
"xml:inputParam="
"<inputParam base64Mode=\"encoded\">AAEAAAD/////AQAAAAAAAAAQAQAAAAEAAAAICDBOclML</inputParam>",
"xml:AuthenHeaderValue="
"<AuthenHeaderValue>"
"<Sessionid>6c72de7e-0f83-48f3-b41b-8eacbbca6ff1</Sessionid>"
"<Username>admin</Username>"
"<Password>admin</Password>"
"</AuthenHeaderValue>",
END_ARGUMENTS,
BEGIN_RESULT,
END_RESULT,
LAST); UP 具体要参数什么内容?不懂你最后一句话的意思。另外,你这个脚本是不是不全啊 脚本是不全 我只截取了新增,修改,和删除的脚本
Web Service 暴露了execute 接口 ,需要四个参数 (AssemblyName,className,methodName,inputParam)
"assemblyName=ETalk.CRM.Dealer.Server",
"className=ETalk.CRM.Dealer.BLL.DealerBO",
"methodName=Update",
"xml:inputParam="
"<inputParam base64Mode=\"file\">WSDL\\@Base64RecordedFiles\\1.bin</inputParam>",
"xml:AuthenHeaderValue="
"<AuthenHeaderValue>"
"<Sessionid>6c72de7e-0f83-48f3-b41b-8eacbbca6ff1</Sessionid>"
"<Username>admin</Username>"
"<Password>admin</Password>"
"</AuthenHeaderValue>",
从上述脚本,可以看出前三个参数都是明文,关键是最后一个参数,我在客户端是一个对象(比如说是客户,包括姓名,年龄,电话),然后在客户端序列化之后,传到Service,在此,我们可以看到,inputParam 是指向一个文件 WSDL\\@Base64RecordedFiles\\1.bin, 这个文件应该是我的客户对象,就像如何对客户这个对象的参数(客户姓名,客户年龄,客户电话)能够参数化,在运行的时候,自动生成,谢谢
页:
[1]