
- SOAP 教程
- SOAP - 主頁
- SOAP - SOAP 是什麼?
- SOAP - 訊息
- SOAP - 信封
- SOAP - 頁首
- SOAP - 正文
- SOAP - 錯誤
- SOAP - 編碼
- SOAP - 傳輸
- SOAP - 示例
- SOAP - 標準
- SOAP 資源
- SOAP - 快速指南
- SOAP - 有用資源
- SOAP - 討論
SOAP - 示例
在下面的示例中,GetQuotation 請求已透過 HTTP 傳送到 SOAP 伺服器。該請求有一個 QuotationName 引數,響應中將返回一個報價。
此函式的名稱空間定義在 http://www.xyz.org/quotation 地址中。
下面是 SOAP 請求−
POST /Quotation HTTP/1.0 Host: www.xyz.org Content-Type: text/xml; charset = utf-8 Content-Length: nnn <?xml version = "1.0"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV = "http://www.w3.org/2001/12/soap-envelope" SOAP-ENV:encodingStyle = "http://www.w3.org/2001/12/soap-encoding"> <SOAP-ENV:Body xmlns:m = "http://www.xyz.org/quotations"> <m:GetQuotation> <m:QuotationsName>MiscroSoft</m:QuotationsName> </m:GetQuotation> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
對應的 SOAP 響應如下 −
HTTP/1.0 200 OK Content-Type: text/xml; charset = utf-8 Content-Length: nnn <?xml version = "1.0"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV = "http://www.w3.org/2001/12/soap-envelope" SOAP-ENV:encodingStyle = "http://www.w3.org/2001/12/soap-encoding"> <SOAP-ENV:Body xmlns:m = "http://www.xyz.org/quotation"> <m:GetQuotationResponse> <m:Quotation>Here is the quotation</m:Quotation> </m:GetQuotationResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
廣告