(五)soapUI创建SOAP项目
虫师 创建于 over 7 years 之前
最后更新: less than a minute 之前
阅读数: 272
创建 SOAP 项目
打开 soapUI 工具。创建一个SOAP项目。
在窗口左侧导航栏,右键 Projects --> New SOAP Project。
添加SOAP接口
以国内手机号码归属地查询接口为例:
Project Name:MobileCodeWS为项目名称。
Initial WSDL:http://ws.webxml.com.cn/WebServices/MobileCodeWS.asmx?wsdl 为接口URL。
点击 OK 按钮,创建项目完成。
依次展开:MobileCodeWS-->MobileCodeWSSoap-->getMobileCodeInfo/,双击 Request 1,填写接口查询的手机号。如下图。
请求接口详细配置如下:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://WebXml.com.cn/">
<soapenv:Header/>
<soapenv:Body>
<web:getMobileCodeInfo>
<!--Optional:-->
<web:mobileCode>186xxxxxxxx</web:mobileCode>
<!--Optional:-->
<web:userID></web:userID>
</web:getMobileCodeInfo>
</soapenv:Body>
</soapenv:Envelope>
注:将 xxxxxxxx 替换为手机号。
运行测试
点击 Request 1 窗口左上角的绿色 运行 按钮,发送 SOAP 请求。右侧窗口将会显示接口返回结果。
一个简单的 SOAP 接口测试完成了。