• 经常调用的WebServce的方法有哪些?


    get,post,soap

    get的request
    GET /ServiceURL/ServiceName.asmx/WebMethodName?param1=123&param2=234

    get的resopnse
    returnValue

    Post的Request
    POST /ServiceURL/ServiceName.asmx/WebMethodName HTTP/1.1
    HOST: hostname(localhost)
    Content-Type:application/x-www-form-urlencoded
    Content-Length:length(int)
    param1=123&param2=234

    Post的Response
    HTTP/1.1 200 OK
    Content-Type:text/xml; charset=utf-8
    Content-Length:length
    <returnType(String,boolena,etc.) xmlns="namespaces">returnValue</returnType>

    SOAP的Request
    POST /webservice1.asmx HTTP/1.1
    Host: localhost
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
    SOAPAction: "http://localhost/WebServer/Webmethodname"

    <?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>
        <Webmethodname xmlns="http://tempurl.org/webservices1/service1">
          <Param1>value123</Param1>
          <Param2>string</Param2>
        </Webmethodname>
      </soap:Body>
    </soap:Envelope>

    SOAP的Response
    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>
        <WebmethodnameResponse xmlns="http://tempurl.org/webservices1/service1">
          <WebmethodnameResult>returnValue</WebmethodnameResult>
        </WebmethodnameResponse>
      </soap:Body>
    </soap:Envelope>

    最常见的就以上三种,另外json什么的也可以,就不一一举例了。

  • 相关阅读:
    javascript执行机制
    PhpStorm常用的一些快捷键
    php值传递和引用传递的区别是什么?
    echo与print,var_dump()和print_r()的区别
    PHP错误类型及屏蔽方法
    工作中常用的正则表达式
    Linux环境变量配置文件/etc/profile、/etc/bashrc、~/.bashrc的区别以及一些隐藏文件的作用
    log4j配置不生效
    Java执行CMD命令
    jar的解压与打包
  • 原文地址:https://www.cnblogs.com/evan51/p/3920874.html
Copyright © 2020-2023  润新知