原文: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.概述 2.Animated run和Non-animated run 3.调试小技巧 4.日志设置

  2. Javascript 中的小括号 “()” 的多义性

    Javascript 中小括号有5 种语义 语义1:函数声明时参数表 1 function func(arg1, arg2){  2    // ...  3  }    语义2:和一些语句联合使用以 ...

  3. Div高度百分比

    有时候设置高度百分比,没有效果. 原因是父元素没有设置高度. 父元素可以设置高度为具体的px.或是100%等百分比. 这样子元素再能根据百分比来设置高度. <style type="t ...

  4. 【工作备忘】suricata

    因为工作遇到的困难,我向suricata的某个作者发送了邮件. On Wed, Sep 11, 2013 at 8:22 AM, likeyi <929812468@qq.com> wro ...

  5. Yarn通信过程

    yarn包括两块,一个是ResourceManager,主要的作用是管理集群上的资源,目前hadoop版本上,管理的只有cpu和内存. 另外一个叫NodeManager,这上面会跑我们的程序,叫App ...

  6. [转]Centos配置国内yum源

    原文地址:http://blog.chinaunix.net/uid-23683795-id-3477603.html 网易(163)yum源是国内最好的yum源之一 ,无论是速度还是软件版本,都非常 ...

  7. 父视图 使用 UIViewAnimationWithBlocks 时,如何让子视图无动画

    tableView使用 UIViewAnimationWithBlocks 时 上面的cell也会一起出现动画, 所以在设置cell的时候 添加 [UIView performWithoutAnima ...

  8. 第三百五十六天 how can I 坚持

    一年了,三百五十六天.写个算法算下对不对. 今天突然想买辆自行车了.云马智行车,还是捷安特,好想买一辆. 网好卡.貌似少记了一天呢,357了.好快. 睡觉了,还没锻炼呢,太晚了. 1458748800 ...

  9. 全文索引之nutch与hadoop(转)

    原文:http://blog.csdn.net/chaofanwei/article/details/39476535 全文索引-lucene,solr,nutch,hadoop之lucene 全文索 ...

  10. 非官方的iOS设计指南

    非官方的iOS设计指南 有时候为iOS设计app并不是一件简单的事,但是如果你能找到正确的最新的苹果设备信息,并按照正确的方向,那么为iOS设计app或许会变得简单容易些. 关于这些指南 这些指南描述 ...