美文网首页
01webService

01webService

作者: Explorer_Mi | 来源:发表于2017-10-14 21:05 被阅读0次
    将它xml页面的地址填写到你创建项目的文件夹的路径下:具体命令如图所示 写测试类完成校验 程序调用WebService的交互过程

    IP查询服务的SOAP协议---请求部分

    POST /WebServices/IpAddressSearchWebService.asmx HTTP/1.1
    Host: ws.webxml.com.cn
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
    SOAPAction: "http://WebXml.com.cn/getCountryCityByIp"
    
    <?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>
        <getCountryCityByIp xmlns="http://WebXml.com.cn/">
          <theIpAddress>string</theIpAddress>
        </getCountryCityByIp>
      </soap:Body>
    </soap:Envelope>
    

    IP查询服务的SOAP协议---响应部分

    HTTP/1.1 200 OK
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
    
    <?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>
        <getCountryCityByIpResponse xmlns="http://WebXml.com.cn/">
          <getCountryCityByIpResult>
            <string>string</string>
            <string>string</string>
          </getCountryCityByIpResult>
        </getCountryCityByIpResponse>
      </soap:Body>
    

    京东的HTTP协议

    Request URL:https://wx.jcloud.com/?cu=true&utm_source=baidu-search&utm_medium=cpc&utm_campaign=t_262767352_baidusearchyun&utm_term=68844176487_0_08cbbd558a184763b91f5c53284af263
    Request Method:GET
    Status Code:200 OK
    Remote Address:121.18.212.130:443
    Referrer Policy:no-referrer-when-downgrade
    Response Headers
    view source
    Age:4
    Cache-Control:max-age=0
    Connection:keep-alive
    Content-Encoding:gzip
    Content-Language:zh-CN
    Content-Type:text/html;charset=UTF-8
    Date:Sat, 14 Oct 2017 13:23:17 GMT
    expires:Sat, 14 Oct 2017 13:23:17 GMT
    Pragma:no-cache
    Server:nginx
    Strict-Transport-Security:max-age=360
    Transfer-Encoding:chunked
    Vary:Accept-Encoding
    Via:http/1.1 ORI-CLOUD-HUABEI-JCS-174 (jcs [cMsSf ]), http/1.1 BD-UNI-1-BFP-157 (jcs [cMsSf ])
    Request Headers
    view source
    Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
    Accept-Encoding:gzip, deflate, br
    Accept-Language:zh-CN,zh;q=0.8
    Cache-Control:no-cache
    Connection:keep-alive
    Cookie:wx_uid=2f186716-ae2a-4d67-9d45-88129fd55044; um_id=5990dbd8fd0f426d9a3386094aacc797; Hm_lvt_79a592530d941dbec6f6bde07bb30be9=1507987605; Hm_lpvt_79a592530d941dbec6f6bde07bb30be9=1507987605; __jda=65559528.15079876060581039903722.1507987606.1507987606.1507987606.1; __jdb=65559528.1.15079876060581039903722|1.1507987606; __jdc=65559528; __jdv=65559528|baidu-search|t_262767352_baidusearchyun|cpc|68844176487_0_08cbbd558a184763b91f5c53284af263|1507987606067
    Host:wx.jcloud.com
    Pragma:no-cache
    Referer:https://union-click.jd.com/sem.php?source=baidu-search&unionId=262767352&siteId=baidusearchyun_68844176487&to=https%3A%2F%2Fwx%2Ejcloud%2Ecom
    Upgrade-Insecure-Requests:1
    User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36
    Query String Parameters
    view source
    view URL encoded
    cu:true
    utm_source:baidu-search
    utm_medium:cpc
    utm_campaign:t_262767352_baidusearchyun
    utm_term:68844176487_0_08cbbd558a184763b91f5c53284af263
    

    WSDL(WebService Description Language):web 服务描述语言
    就是一个xml文档,用于描述当前服务的一些信息(服务名称、服务的发布地址、服务提供的方法、方法的参数类型、方法的返回值类型等)

    WSDL可以看成是WebService的使用说明书,任何一个WebService都有一个WSDL

    相关文章

      网友评论

          本文标题:01webService

          本文链接:https://www.haomeiwen.com/subject/cjufuxtx.html