zoukankan      html  css  js  c++  java
  • PostMan测试Web Service

    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是方法的返回值内容

  • 相关阅读:
    第59节:Java中的html和css语言
    第59节:Java中的html和css语言
    小程序版本再次发布升级
    Java中的图形界面编程-GUI
    第58节:Java中的图形界面编程-GUI
    第58节:Java中的图形界面编程-GUI
    解决微信小程序登录与发布的一些问题
    解决微信小程序登录与发布的一些问题
    第57节:Java中流的操作以及编码解码
    第57节:Java中流的操作以及编码解码
  • 原文地址:https://www.cnblogs.com/dxmdiy/p/11127568.html
Copyright © 2011-2022 走看看