【转】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.概述 2.Animated run和Non-animated run 3.调试小技巧 4.日志设置
- Javascript 中的小括号 “()” 的多义性
Javascript 中小括号有5 种语义 语义1:函数声明时参数表 1 function func(arg1, arg2){ 2 // ... 3 } 语义2:和一些语句联合使用以 ...
- Div高度百分比
有时候设置高度百分比,没有效果. 原因是父元素没有设置高度. 父元素可以设置高度为具体的px.或是100%等百分比. 这样子元素再能根据百分比来设置高度. <style type="t ...
- 【工作备忘】suricata
因为工作遇到的困难,我向suricata的某个作者发送了邮件. On Wed, Sep 11, 2013 at 8:22 AM, likeyi <929812468@qq.com> wro ...
- Yarn通信过程
yarn包括两块,一个是ResourceManager,主要的作用是管理集群上的资源,目前hadoop版本上,管理的只有cpu和内存. 另外一个叫NodeManager,这上面会跑我们的程序,叫App ...
- [转]Centos配置国内yum源
原文地址:http://blog.chinaunix.net/uid-23683795-id-3477603.html 网易(163)yum源是国内最好的yum源之一 ,无论是速度还是软件版本,都非常 ...
- 父视图 使用 UIViewAnimationWithBlocks 时,如何让子视图无动画
tableView使用 UIViewAnimationWithBlocks 时 上面的cell也会一起出现动画, 所以在设置cell的时候 添加 [UIView performWithoutAnima ...
- 第三百五十六天 how can I 坚持
一年了,三百五十六天.写个算法算下对不对. 今天突然想买辆自行车了.云马智行车,还是捷安特,好想买一辆. 网好卡.貌似少记了一天呢,357了.好快. 睡觉了,还没锻炼呢,太晚了. 1458748800 ...
- 全文索引之nutch与hadoop(转)
原文:http://blog.csdn.net/chaofanwei/article/details/39476535 全文索引-lucene,solr,nutch,hadoop之lucene 全文索 ...
- 非官方的iOS设计指南
非官方的iOS设计指南 有时候为iOS设计app并不是一件简单的事,但是如果你能找到正确的最新的苹果设备信息,并按照正确的方向,那么为iOS设计app或许会变得简单容易些. 关于这些指南 这些指南描述 ...