soapUI的Mocservice仿真测试问题
作者:网络转载 发布时间:[ 2014/10/27 14:50:26 ] 推荐标签:软件测试工具 soapUI 项目
近做一个项目,使用了WEBService,但是这个接口是别人提供的并且没有完成,但是WSDL给提供了.
想使用SOAPUI的MOCKSERVICE功能模拟一个WEBService.
首先用AXIS做了一个WEBService,用以下代码进行测试OK,但访问SOAPUI做的MOCKSERVICE失败,
想向各位高手确认下,SOAPUI的MOCKSERVICE能做为一WEBService让JAVA程序访问吗?
JAVA WEBclient代码如下:
Java code?123456789101112131415161718192021222324252627 // String endpoint = "http://localhost:8080/axis/Hello.jws?wsdl"; String endpoint = "http://localhost:8088/axis/Hello.jws?WSDL";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(endpoint);
call.setOperationName("hello");
call.setSOAPVersion(SOAPConstants.SOAP11_CONSTANTS);
call.addParameter("name", org.apache.axis.encoding.XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN); // call.addParameter("ToCurrency", org.apache.axis.encoding.XMLType.XSD_STRING, // // javax.xml.rpc.ParameterMode.IN);
call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);
Object result = call.invoke(new Object[]{"JPY"});
System.out.println("result is "+result.toString());
SOAPUI的HTTP LOG如下:
Sun Aug 26 23:18:36 JST 2012:DEBUG:HelloSoapBinding MockService was unable to dispatch mock request
com.eviware.soapui.impl.wsdl.mock.DispatchException: Missing operation for soapAction [] and body element [hello] with SOAP Version [SOAP 1.1]
at com.eviware.soapui.impl.wsdl.support.soap.SoapUtils.findOperationForRequest(SoapUtils.java:353)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchPostRequest(WsdlMockRunner.java:260)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchRequest(WsdlMockRunner.java:383)
at com.eviware.soapui.monitor.JettyMockEngine$ServerHandler.handle(JettyMockEngine.java:701)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Sun Aug 26 23:18:36 JST 2012:ERROR:An error occured [Missing operation for soapAction [] and body element [hello] with SOAP Version [SOAP 1.1]], see error log for details
相关推荐
更新发布
功能测试和接口测试的区别
2023/3/23 14:23:39如何写好测试用例文档
2023/3/22 16:17:39常用的选择回归测试的方式有哪些?
2022/6/14 16:14:27测试流程中需要重点把关几个过程?
2021/10/18 15:37:44性能测试的七种方法
2021/9/17 15:19:29全链路压测优化思路
2021/9/14 15:42:25性能测试流程浅谈
2021/5/28 17:25:47常见的APP性能测试指标
2021/5/8 17:01:11