现在的项目,一般不会局限于一种协议。
webservice是一个web的应用程序,使用xml向外界暴露可供调用的API接口。
SOAP(Simple Object Access Protocol)=http+xml
http+xml
。不同的接口的请求头不一样,就在不同的接口下面添加一个http信息头管理器,并填写该接口的请求头内容就可以了。
<?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>
<getSupportCityDataset xmlns="http://WebXml.com.cn/">
<theRegionCode>31123</theRegionCode>
</getSupportCityDataset>
</soap:Body>
</soap:Envelope>
{"theRegionCode":"31123"}
yml、xml、json格式都是包装数据的。
xml比json包装数据的时候,冗余代码会多很多。
带参数的soap接口
http://www.webxml.com.cn/WebServices/TranslatorWebService.asmx?op=getEnCnTwoWayTranslator
http://ws.webxml.com.cn/WebServices/WeatherWS.asmx?op=getRegionCountry
链接:https://pan.baidu.com/s/1ESIPuiEzz8JOtU6lOB4VYA?pwd=1234 提取码:1234
文章中除标明“图片来自网络”的图片,皆为小编本人所画所截图,计算机知识都一样,如有雷同,纯属巧合。文章是清菡编写的,如有转载,请标明出处!