1、設置URL
2、設置請求模式:Post
3、設置Header:添加 Content-Type ,值為 text/xml;charset=utf-8
4、設置Body:勾選raw
5、輸入Body內容
Body案例:
以下幾點是要修改替換地方:
<soap:Body>父級節點是固定不變的
xmlns 標識,命名空間 比如:http://WebXml.com.cn/
<soap:Body>節點下的getWeather 節點 是調用的web service的方法名
<getWeather>下的節點是 web serivce方法需要傳輸的參數 theCityCode、theUserID是方法參數
請求web serivce時的Body結構
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<getWeather xmlns="http://WebXml.com.cn/">
<theCityCode>string</theCityCode>
<theUserID>string</theUserID>
</getWeather>
</soap:Body>
</soap:Envelope>
web service響應時的Body結構:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<getWeatherResponse xmlns="http://WebXml.com.cn/">
<getWeatherResult>
<string>string</string>
<string>string</string>
</getWeatherResult>
</getWeatherResponse>
</soap:Body>
</soap:Envelope>
getWeatherResult是方法的返回值內容