SOAP 시작하기 튜토리얼login
SOAP 시작하기 튜토리얼
작가:php.cn  업데이트 시간:2022-04-11 14:22:12

SOAP 인스턴스



A SOAP 인스턴스

아래 예에서는 GetStockPrice 요청이 서버로 전송됩니다. 이 요청에는 StockName 매개변수가 있으며 Price 매개변수가 응답으로 반환됩니다. 이 기능의 네임스페이스는 다음 주소에 정의되어 있습니다: "http://www.example.org/stock"

SOAP 요청:

POST /InStock HTTP/1.1
Host: www.example.org
Content- Type : application/soap+xml; charset=utf-8
Content-Length: nnn

<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www . w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">

<soap:Body xmlns:m="http://www.example.org/stock">
<m:GetStockPrice>
                    <m:StockName>IBM</m:StockName>
</m:GetStockPrice>
</soap:Body>

</soap:Envelope>

SOAP 응답:

HTTP/1.1 200 OK
Content-Type: application/soap+xml charset=utf-8
Content-Length; : nnn

<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle ="http://www.w3.org/2001/12/soap-encoding">

<soap:Body xmlns:m="http://www.example.org/stock">
​ <m:GetStockPriceResponse>
                    <m:가격>34.5</m:가격>
​ </m:GetStockPriceResponse>
</soap:Body>

</soap:Envelope>

PHP 중국어 웹사이트