原文:http://blog.csdn.net/a19881029/article/details/26348627

使用SoapUI创建WebService接口模拟服务端需要接口描述文件

MathUtil.wsdl:

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <wsdl:definitions targetNamespace="http://sean.com"
  3. xmlns:apachesoap="http://xml.apache.org/xml-soap"
  4. xmlns:impl="http://sean.com"
  5. xmlns:intf="http://sean.com"
  6. xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
  7. xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
  8. xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  9. <wsdl:types>
  10. <schema elementFormDefault="qualified"
  11. targetNamespace="http://sean.com"
  12. xmlns="http://www.w3.org/2001/XMLSchema">
  13. <element name="add">
  14. <complexType>
  15. <sequence>
  16. <element name="x" type="xsd:int"/>
  17. <element name="y" type="xsd:int"/>
  18. </sequence>
  19. </complexType>
  20. </element>
  21. <element name="addResponse">
  22. <complexType>
  23. <sequence>
  24. <element name="addReturn" type="xsd:int"/>
  25. </sequence>
  26. </complexType>
  27. </element>
  28. </schema>
  29. </wsdl:types>
  30. <wsdl:message name="addResponse">
  31. <wsdl:part element="impl:addResponse" name="parameters">
  32. </wsdl:part>
  33. </wsdl:message>
  34. <wsdl:message name="addRequest">
  35. <wsdl:part element="impl:add" name="parameters">
  36. </wsdl:part>
  37. </wsdl:message>
  38. <wsdl:portType name="MathUtil">
  39. <wsdl:operation name="add">
  40. <wsdl:input message="impl:addRequest" name="addRequest">
  41. </wsdl:input>
  42. <wsdl:output message="impl:addResponse" name="addResponse">
  43. </wsdl:output>
  44. </wsdl:operation>
  45. </wsdl:portType>
  46. <wsdl:binding name="MathUtilSoapBinding" type="impl:MathUtil">
  47. <wsdlsoap:binding style="document"
  48. transport="http://schemas.xmlsoap.org/soap/http"/>
  49. <wsdl:operation name="add">
  50. <wsdlsoap:operation soapAction=""/>
  51. <wsdl:input name="addRequest">
  52. <wsdlsoap:body use="literal"/>
  53. </wsdl:input>
  54. <wsdl:output name="addResponse">
  55. <wsdlsoap:body use="literal"/>
  56. </wsdl:output>
  57. </wsdl:operation>
  58. </wsdl:binding>
  59. <wsdl:service name="MathUtilService">
  60. <wsdl:port binding="impl:MathUtilSoapBinding" name="MathUtil">
  61. <wsdlsoap:address
  62. location="http://localhost:8080/webservice_create/services/MathUtil"/>
  63. </wsdl:port>
  64. </wsdl:service>
  65. </wsdl:definitions>

通过MathUtil.wsdl文件在SoapUI中创建一个SOAP项目:

确认后,会在新建的SOAP项目下自动生成模拟客户端

在模拟客户端的基础上创建一个接口模拟服务端(Mock Service):

双击Response1可以设置接口服务端返回值:

返回值默认为"?",一定要进行修改,否则调用该接口时会报错

  1. AxisFault
  2. faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
  3. faultSubcode:
  4. faultString: java.lang.NumberFormatException: For input string: "?"
  5. faultActor:
  6. faultNode:
  7. faultDetail:
  8. {http://xml.apache.org/axis/}stackTrace:java.lang.NumberFormatException: For input string: "?"

双击创建的接口模拟服务端:

修改接口模拟服务端配置:

配置完成后,启动模拟服务端:

此时模拟服务端已经启动,可以使用了:

【转】SoapUI5.0创建WebService接口模拟服务端的更多相关文章

  1. SoapUI5.0创建WebService接口模拟服务端(转)

    转载自:https://blog.csdn.net/a19881029/article/details/26348627 使用SoapUI创建WebService接口模拟服务端需要接口描述文件 Mat ...

  2. 【JMeter4.0学习(三)】之SoapUI创建WebService接口模拟服务端以及JMeter对SOAP协议性能测试脚本开发

    目录: 创建WebService接口模拟服务端 下载SoapUI 新建MathUtil.wsdl文件 创建一个SOAP项目 接口模拟服务端配置以及启动 JMeter对SOAP协议性能测试脚本开发 [阐 ...

  3. Axis创建webservice客户端和服务端

    原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本人声明.否则将追究法律责任. 作者:永恒の_☆ 地址:http://blog.csdn.net/chenghui0317/ ...

  4. CXF创建webservice客户端和服务端

    转 一.CXF的介绍 Apache CXF是一个开源的WebService框架,CXF大大简化了Webservice的创建,同时它继承了XFire的传统,一样可以和spring天然的进行无缝的集成.C ...

  5. 13.Axis创建webservice客户端和服务端

    转自:https://blog.csdn.net/chenghui0317/article/details/9318317 一.Axis的介绍 Web Service是现在最适合实现SOA的技术,而A ...

  6. 通过Java WebService接口从服务端下载文件

    一. 前言 本文讲述如何通过webservice接口,从服务端下载文件.报告到客户端.适用于跨系统间的文件交互,传输文件不大的情况(控制在几百M以内).对于这种情况搭建一个FTP环境,增加了系统部署的 ...

  7. Delphi XE5通过WebService开发Web服务端和手机客户端

    Delphi XE5通过WebService开发Web服务端和手机客户端介绍 我们开发一个三层的android程序 建立一个webservices  stand-alone vcl applicati ...

  8. 一些java考过的测试题和自己制作模拟服务端和客户端

    媒体 1,java环境变量: PATH: .;%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;  CLASSPATH: .;%JAVA_HOME%\jre\lib\rt.jar ...

  9. WebService技术,服务端发布到Tomcat(使用Servlet发布),客户端使用axis2实现(二)

    还是在WebService技术,服务端and客户端JDK-wsimport工具(一)的基础上实现.新建一个包:com.aixs2client.目录结构如下: 一.服务端: 1.还是使用com.webs ...

随机推荐

  1. LR回放测试脚本

    1.设置run time setting Pacing:设置什么时候进行迭代 2.实时观察回放录像 3.回放脚本 4.查看结果

  2. JavaScript 教程学习进度备忘(二)

    备忘:之前,只将“JS 教程”学习完毕,这篇记录:“JS HTML DOM ”.“JS 对象”.“JS Window”.“JS 库” 书签:跳过:另外跳过的内容有待跟进 _______________ ...

  3. 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 ...

  4. 图算法之Floyd-Warshall 算法-- 任意两点间最小距离

    1.Floyd-Warshall 算法 给定一张图,在o(n3)时间内求出任意两点间的最小距离,并可以在求解过程中保存路径 2.Floyd-Warshall 算法概念 这是一个动态规划的算法. 将顶点 ...

  5. Python伪开发者对于搜狐云景的测评

    Python伪开发者对于搜狐云景的测评 本人是GAE和OpenShift的狂热爱好者,玩过各种国外PaaS.某次想搞个稍微复杂点的Python Web程序,需要比较好的网络传输速度,就试图找前PM(P ...

  6. pku3659 Cell Phone Network

    http://poj.org/problem?id=3659 树状DP,树的最小点覆盖 #include <stdio.h> #include <vector> #define ...

  7. HP ILO2 使用详细教程

    iLO是Intergrated Light-Out的缩写,是惠普特有的远程管理功能,目前最新的版本是iLO2.通过iLO2可以实现硬件级别的服务器远程管理,包括开关机.重启.服务器状态的监控.虚拟KV ...

  8. KM算法详解+模板

    http://www.cnblogs.com/wenruo/p/5264235.html KM算法用来求二分图最大权完美匹配. 本文配合该博文服用更佳:趣写算法系列之--匈牙利算法 现在有N男N女,男 ...

  9. 调整V7连保监平台时问题

    11北京 XXX: 界面无法录入导致无法出单. 31上海 XXX: 送平台代码有问题 保费计算失败! 车险平台返回信息 0101010024_公司险种代码/平台险种代码('030006 '/'C02 ...

  10. ruby中实例变量、类变量等等的区别和联系

    ruby的变量有局部变量,全局变量,实例变量,类变量,常量. 1.局部变量 局部变量以一个小写字母开头或下划线开头 局部变量有局部作用域限制(比如一个block内),它的作用域起始于声明处,结束于该声 ...