• 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>

     如图:

  • 相关阅读:
    webp实践的javascript检测方案
    码农不算程序员 :)
    解决 phpmyadmin #2002 无法登录 MySQL 服务器
    xmlhttprequest upload
    shape-outside 矩形之外的另一种思路
    百度搜索词&淘宝搜索词 接口实现
    Sublime Text 2 破解 on Mac
    利用a标签自动解析URL
    rc4加密解密
    国内的一些前端框架
  • 原文地址:https://www.cnblogs.com/xmqa/p/13705841.html
Copyright © 2020-2023  润新知