最近项目中经常要调试webservice接口,从朋友处了解到他们调试webservice接口时使用SoapUI,觉得十分好用,个人也对此十分感兴趣,因此简要记录一下这个工具的使用。
准备
- 下载SoapUI,我使用的是5.3.0 下载SoapUI传送门
- WebService 服务接口
进入正题
新建调试项目

输入项目名称及要调试的接口有效地址,输入完毕点击OK

soapUI会自动获取所有已开放接口,在想要调试的接口方法上面选中右击,选择new request,输入名称后如下图会自动生成如下格式代码;其中 <web:in0 style="box-sizing: border-box; margin-top: 0px;">中填写入参</web:in0>

注意:xml格式的入参最好使用 <[CDATA[]]> 包起来。点击左上角的绿色三角就可以调试接口了。
新建测试套件 New TestSuite
在项目名称上右击,选择 New TestSuite,输入名称保存

在自己新建的TestSuite名称上右击,选择 New TestCase,输入名称保存

在Test Steps上右击 选择 Add Step -->SOAP Request,输入名称并选择接口,名称最好容易识别一点


网友评论