zoukankan      html  css  js  c++  java
  • 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>

     如图:

  • 相关阅读:
    【实践】mysql数据库表设计及存储过程设计
    # Java类链接模型
    java gc
    Spring Data Jpa
    Spring Security
    Amazon SQS 消息队列服务
    JMS概述
    jdk 7&8 new features
    java jri null
    java.lang.OutOfMemoryError: PermGen space
  • 原文地址:https://www.cnblogs.com/xmqa/p/13705841.html
Copyright © 2011-2022 走看看