|
在性能测试过程中,录制脚本选的协议是Web Service,在运行脚本时总是出现下面的错误, 崩溃中......:(,请高手指点啊。:)
Error: server returned an incorrectly formatted SOAP response
我用的是第二种手动指定Wsdl文件的方法来录制脚本的,上面的错误是在脚本初始化时出现的,我上网查的资料上说,需要安装两个补丁:LR80WebServicesFP1_setup.exe和lrunner_web_services_patch_1.exe,我也安装了,但是还存在这个问题。
初始化的脚本如下:
vuser_init()
{
web_service_call( "StepName=submitInfo_101",
"SOAPMethod=InfoWSService.InfoWS.submitInfo",
"ResponseParam=response",
"WSDL=D:/out/InfoWS.wsdl",
"UseWSDLCopy=1",
"Snapshot=t1187317947.inf",
BEGIN_ARGUMENTS,
"strParam=auto string",
END_ARGUMENTS,
BEGIN_RESULT,
END_RESULT,
LAST);
lr_think_time(3);
return 0;
}
录制的Action脚本:
Action()
{
web_add_header("SOAPAction",
"\"\"");
web_add_header("Content-Type", "text/xml; charset=UTF-8");
soap_request("StepName=apply",
"URL=http://172.16.24.72:8080/ac/services/AuthWS",
"SOAPEnvelope=<?xml version='1.0' encoding=\"GB2312\" ?>\n<SOAP-ENV"
":Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\""
" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://"
"www.w3.org/2001/XMLSchema-instance\">\n<SOAP-ENV:Body>\n<ns1:apply "
"xmlns:ns1=\"http://ws.ac.ch2000.com.cn\">\n<ns1:strParam"
">007000111923020956975001</ns1:strParam>\n</ns1:apply>\n</SOAP-ENV"
":Body>\n</SOAP-ENV:Envelope>\n\n",
"Snapshot=t1.inf",
"ResponseParam=response",
LAST);
return 0;
}
但是,如果我用第一种Record Client Appliation录制方法,则没有上面的问题,可以正常运行,这两种录制方法有什么不同吗?为什么第一种方法行,而第二种就不行了呢?
第一种录制方法录制的脚本如下:
Action()
{
web_add_header("SOAPAction",
"\"\"");
web_add_header("Content-Type", "text/xml; charset=UTF-8");
web_service_call("StepName=apply",
"SOAPMethod=AuthWSService.AuthWS.apply",
"WSDL=D:/out/AuthWS.wsdl",
"UseWSDLCopy=1",
"Snapshot=t1.inf",
RecordedBuffer1,
"ResponseParam=response",
BEGIN_ARGUMENTS,
"strParam={sn1}",
END_ARGUMENTS,
BEGIN_RESULT,
END_RESULT,
LAST);
return 0;
}
是不是服务器端的配置有问题?还是Wsdl的方法有问题?哪位高手可否帮我看一下?
Wsdl文件内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://ws.ac.ch2000.com.cn" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://ws.ac.ch2000.com.cn" xmlns:intf="http://ws.ac.ch2000.com.cn" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.3
Built on Oct 05, 2005 (05:23:37 EDT)-->
<wsdl:types>
<schema elementFormDefault="qualified" targetNamespace="http://ws.ac.ch2000.com.cn" xmlns="http://www.w3.org/2001/XMLSchema">
<element name="apply">
<complexType>
<sequence>
<element name="strParam" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="applyResponse">
<complexType>
<sequence>
<element name="applyReturn" type="xsd:string"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>
<wsdl:message name="applyRequest">
<wsdl:part element="impl:apply" name="parameters"/>
</wsdl:message>
<wsdl:message name="applyResponse">
<wsdl:part element="impl:applyResponse" name="parameters"/>
</wsdl:message>
<wsdl:portType name="AuthWS">
<wsdl:operation name="apply">
<wsdl:input message="impl:applyRequest" name="applyRequest"/>
<wsdl:output message="impl:applyResponse" name="applyResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="AuthWSSoapBinding" type="impl:AuthWS">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="apply">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="applyRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="applyResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="AuthWSService">
<wsdl:port binding="impl:AuthWSSoapBinding" name="AuthWS">
<wsdlsoap:address location="http://172.16.24.72:8080/ac/services/AuthWS"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
[ 本帖最后由 kangge 于 2007-9-14 10:49 编辑 ] |
|