SoapUI5.0创建WebService接口模拟服务端
来源:互联网 发布:中铁七局郑州公司知乎 编辑:程序博客网 时间:2024/06/11 20:05
使用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: "?"
双击创建的接口模拟服务端:
修改接口模拟服务端配置:
配置完成后,启动模拟服务端:
此时模拟服务端已经启动,可以使用了:
0 0
- SoapUI5.0创建WebService接口模拟服务端
- SoapUI5.0创建WebService接口模拟服务端
- 使用soapUI5.3.0调试webservice接口
- 创建一个WebService服务端
- Java创建WebService服务端
- slim开发webservice服务端接口
- cxf+spring创建webservice服务端
- webservice axi2 远程服务端接口调用
- WebService入门java实现服务端接口调用
- webservice接口-PHP服务端与PHP客户端
- cxf框架webService接口服务端详细配置
- Java创建WebService服务端及客户端
- 创建WebService简单服务端和客户端
- Axis创建webservice客户端和服务端
- CXF创建webservice客户端和服务端
- CXF创建webservice客户端和服务端
- CXF创建webservice客户端和服务端
- WebService--使用Axis2创建服务端和客户端
- day68(5.19)
- OSI结构和TCP/IP模型
- MFC中手动create窗口退出程序报错的解决方法
- PowerDesigner导出表到word
- android学习日记-6 观察者模式与订阅者模式
- SoapUI5.0创建WebService接口模拟服务端
- 背包
- ahci硬盘模式下的网页视频播放
- fread函数和fwrite函数
- ubuntu 的 ant更新
- HDU Shortest path
- android 控件 单项选择(RadioGroup,RadioButton)
- android-视频时间转换
- avr单片机复位电路