WebService开发过程中难免会进行测试,除了使用单元测试进行测试,也可以利用soapUI和postman等工具进行测试,soapUI下载地址:SoapUI下载地址,近期在使用postman进行webservice测试的时候提示no SOAPAction header!
排查了一下问题,发现时header需要加上SOAPAction,然后测试就没有问题了
具体截图如下:
soapui请求参数格式:
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://包名反写">
<soapenv:Header/>
<soapenv:Body>
<ser:checkRegister soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<idNo xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">123456789</idNo>
</ser:checkRegister>
</soapenv:Body>
</soapenv:Envelope>