【转】SoapUI5.0创建WebService接口模拟服务端
原文:http://blog.csdn.net/a19881029/article/details/26348627
使用SoapUI创建WebService接口模拟服务端需要接口描述文件
MathUtil.wsdl:
- <?xml version="1.0" encoding="UTF-8"?>
- <wsdl:definitions targetNamespace="http://sean.com"
- xmlns:apachesoap="http://xml.apache.org/xml-soap"
- xmlns:impl="http://sean.com"
- xmlns:intf="http://sean.com"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <wsdl:types>
- <schema elementFormDefault="qualified"
- targetNamespace="http://sean.com"
- xmlns="http://www.w3.org/2001/XMLSchema">
- <element name="add">
- <complexType>
- <sequence>
- <element name="x" type="xsd:int"/>
- <element name="y" type="xsd:int"/>
- </sequence>
- </complexType>
- </element>
- <element name="addResponse">
- <complexType>
- <sequence>
- <element name="addReturn" type="xsd:int"/>
- </sequence>
- </complexType>
- </element>
- </schema>
- </wsdl:types>
- <wsdl:message name="addResponse">
- <wsdl:part element="impl:addResponse" name="parameters">
- </wsdl:part>
- </wsdl:message>
- <wsdl:message name="addRequest">
- <wsdl:part element="impl:add" name="parameters">
- </wsdl:part>
- </wsdl:message>
- <wsdl:portType name="MathUtil">
- <wsdl:operation name="add">
- <wsdl:input message="impl:addRequest" name="addRequest">
- </wsdl:input>
- <wsdl:output message="impl:addResponse" name="addResponse">
- </wsdl:output>
- </wsdl:operation>
- </wsdl:portType>
- <wsdl:binding name="MathUtilSoapBinding" type="impl:MathUtil">
- <wsdlsoap:binding style="document"
- transport="http://schemas.xmlsoap.org/soap/http"/>
- <wsdl:operation name="add">
- <wsdlsoap:operation soapAction=""/>
- <wsdl:input name="addRequest">
- <wsdlsoap:body use="literal"/>
- </wsdl:input>
- <wsdl:output name="addResponse">
- <wsdlsoap:body use="literal"/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:service name="MathUtilService">
- <wsdl:port binding="impl:MathUtilSoapBinding" name="MathUtil">
- <wsdlsoap:address
- location="http://localhost:8080/webservice_create/services/MathUtil"/>
- </wsdl:port>
- </wsdl:service>
- </wsdl:definitions>
通过MathUtil.wsdl文件在SoapUI中创建一个SOAP项目:
确认后,会在新建的SOAP项目下自动生成模拟客户端
在模拟客户端的基础上创建一个接口模拟服务端(Mock Service):
双击Response1可以设置接口服务端返回值:
返回值默认为"?",一定要进行修改,否则调用该接口时会报错
- AxisFault
- faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
- faultSubcode:
- faultString: java.lang.NumberFormatException: For input string: "?"
- faultActor:
- faultNode:
- faultDetail:
- {http://xml.apache.org/axis/}stackTrace:java.lang.NumberFormatException: For input string: "?"
双击创建的接口模拟服务端:
修改接口模拟服务端配置:
配置完成后,启动模拟服务端:
此时模拟服务端已经启动,可以使用了:
下载:
5.2.0版本:http://sourceforge.net/projects/soapui/files/soapui/5.2.0/
5.0.0版本:http://sourceforge.net/projects/soapui/files/soapui/5.0.0/
【转】SoapUI5.0创建WebService接口模拟服务端的更多相关文章
- SoapUI5.0创建WebService接口模拟服务端(转)
转载自:https://blog.csdn.net/a19881029/article/details/26348627 使用SoapUI创建WebService接口模拟服务端需要接口描述文件 Mat ...
- 【JMeter4.0学习(三)】之SoapUI创建WebService接口模拟服务端以及JMeter对SOAP协议性能测试脚本开发
目录: 创建WebService接口模拟服务端 下载SoapUI 新建MathUtil.wsdl文件 创建一个SOAP项目 接口模拟服务端配置以及启动 JMeter对SOAP协议性能测试脚本开发 [阐 ...
- Axis创建webservice客户端和服务端
原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本人声明.否则将追究法律责任. 作者:永恒の_☆ 地址:http://blog.csdn.net/chenghui0317/ ...
- CXF创建webservice客户端和服务端
转 一.CXF的介绍 Apache CXF是一个开源的WebService框架,CXF大大简化了Webservice的创建,同时它继承了XFire的传统,一样可以和spring天然的进行无缝的集成.C ...
- 13.Axis创建webservice客户端和服务端
转自:https://blog.csdn.net/chenghui0317/article/details/9318317 一.Axis的介绍 Web Service是现在最适合实现SOA的技术,而A ...
- 通过Java WebService接口从服务端下载文件
一. 前言 本文讲述如何通过webservice接口,从服务端下载文件.报告到客户端.适用于跨系统间的文件交互,传输文件不大的情况(控制在几百M以内).对于这种情况搭建一个FTP环境,增加了系统部署的 ...
- Delphi XE5通过WebService开发Web服务端和手机客户端
Delphi XE5通过WebService开发Web服务端和手机客户端介绍 我们开发一个三层的android程序 建立一个webservices stand-alone vcl applicati ...
- 一些java考过的测试题和自己制作模拟服务端和客户端
媒体 1,java环境变量: PATH: .;%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin; CLASSPATH: .;%JAVA_HOME%\jre\lib\rt.jar ...
- WebService技术,服务端发布到Tomcat(使用Servlet发布),客户端使用axis2实现(二)
还是在WebService技术,服务端and客户端JDK-wsimport工具(一)的基础上实现.新建一个包:com.aixs2client.目录结构如下: 一.服务端: 1.还是使用com.webs ...
随机推荐
- LR回放测试脚本
1.设置run time setting Pacing:设置什么时候进行迭代 2.实时观察回放录像 3.回放脚本 4.查看结果
- JavaScript 教程学习进度备忘(二)
备忘:之前,只将“JS 教程”学习完毕,这篇记录:“JS HTML DOM ”.“JS 对象”.“JS Window”.“JS 库” 书签:跳过:另外跳过的内容有待跟进 _______________ ...
- Epic - Seed Number
Find the seed of a number. Eg : 1716 = 143*1*4*3 =1716 so 143 is the seed of 1716. find all possible ...
- 图算法之Floyd-Warshall 算法-- 任意两点间最小距离
1.Floyd-Warshall 算法 给定一张图,在o(n3)时间内求出任意两点间的最小距离,并可以在求解过程中保存路径 2.Floyd-Warshall 算法概念 这是一个动态规划的算法. 将顶点 ...
- Python伪开发者对于搜狐云景的测评
Python伪开发者对于搜狐云景的测评 本人是GAE和OpenShift的狂热爱好者,玩过各种国外PaaS.某次想搞个稍微复杂点的Python Web程序,需要比较好的网络传输速度,就试图找前PM(P ...
- pku3659 Cell Phone Network
http://poj.org/problem?id=3659 树状DP,树的最小点覆盖 #include <stdio.h> #include <vector> #define ...
- HP ILO2 使用详细教程
iLO是Intergrated Light-Out的缩写,是惠普特有的远程管理功能,目前最新的版本是iLO2.通过iLO2可以实现硬件级别的服务器远程管理,包括开关机.重启.服务器状态的监控.虚拟KV ...
- KM算法详解+模板
http://www.cnblogs.com/wenruo/p/5264235.html KM算法用来求二分图最大权完美匹配. 本文配合该博文服用更佳:趣写算法系列之--匈牙利算法 现在有N男N女,男 ...
- 调整V7连保监平台时问题
11北京 XXX: 界面无法录入导致无法出单. 31上海 XXX: 送平台代码有问题 保费计算失败! 车险平台返回信息 0101010024_公司险种代码/平台险种代码('030006 '/'C02 ...
- ruby中实例变量、类变量等等的区别和联系
ruby的变量有局部变量,全局变量,实例变量,类变量,常量. 1.局部变量 局部变量以一个小写字母开头或下划线开头 局部变量有局部作用域限制(比如一个block内),它的作用域起始于声明处,结束于该声 ...