开发者

What are the SOAP Messages on the Help Page of an ASMX Web Service Method?

开发者 https://www.devze.com 2023-03-03 00:43 出处:网络
I am currently studying Web Services and after doing a sample practise in a .asmx file, I notice that below the sample method output page, there\'s many SOAP related messages like the ones below, can

I am currently studying Web Services and after doing a sample practise in a .asmx file, I notice that below the sample method output page, there's many SOAP related messages like the ones below, can anyone tell me what are these messages for? Thanks.

SOAP 1.1 The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.

POST /SecurityWebService/Service.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/GetSecurityInfo"

<?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>
    <GetSecurityInfo xmlns="http://tempuri.org/">
      <Code>string</Code>
    </GetSecurityInfo>
  </soap:Body>
</soap:Envelope>
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>
    <GetSecurityInfoResponse xmlns="http://tempuri.org/">
      <GetSecurityInfoResult>
        <Code>string</Code>
        <CompanyName>string</CompanyName>
        <Price>double</Price>
      </GetSecurityInfoResult>
    </GetSecurityInfoResponse>
  </soap:Body>
</soap:Envelope>

SOAP 1.2 The following is a sample SOAP 1.2 request and response. The placeholders shown need to be replaced with actual values.

POST /SecurityWebService/Service.asmx HTTP/1.1
Host: localhost
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body&开发者_运维百科gt;
    <GetSecurityInfo xmlns="http://tempuri.org/">
      <Code>string</Code>
    </GetSecurityInfo>
  </soap12:Body>
</soap12:Envelope>
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <GetSecurityInfoResponse xmlns="http://tempuri.org/">
      <GetSecurityInfoResult>
        <Code>string</Code>
        <CompanyName>string</CompanyName>
        <Price>double</Price>
      </GetSecurityInfoResult>
    </GetSecurityInfoResponse>
  </soap12:Body>
</soap12:Envelope>


These are messages encoded in the SOAP protocol. .NET kinda puts that in a "black box" that for you, so that you don't have to handle SOAP messages creation and parsing yourself.

0

精彩评论

暂无评论...
验证码 换一张
取 消