postman调用webservice方法

1、headers加上Content-Type=text/xml;charset=utf-8,如下图:

 

2、 body选择xml格式,如下图:

 

3、测试:

比如url为:http://www.webxml.com.cn/WebServices/WeatherWebService.asmx?wsdl

比如入参xml为:

<?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>
    <getSupportCity xmlns="http://WebXml.com.cn/">
      <byProvinceName>四川</byProvinceName>
    </getSupportCity>
  </soap:Body>
</soap:Envelope>

调用为:

 【备注:有的比较特殊情况】

1、在header加上SOAPAction值为application/soap+xml;charset=utf-8

 2、body用xml格式,内容:

<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="接口地址">
    <soapenv:Header/>
    <soapenv:Body>
        <ser:login soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
            <param1 xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">参数1</param1>
        </ser:login>
    </soapenv:Body>
</soapenv:Envelope>

 如图:

 

posted @ 2020-09-21 15:28  迢迢  阅读(8849)  评论(0编辑  收藏  举报