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

SOAP 헤더 요소



선택적인 SOAP Header 요소에는 헤더 정보가 포함됩니다.


SOAP 헤더 요소

선택적 SOAP 헤더 요소에는 SOAP 메시지에 대한 애플리케이션별 정보(예: 인증, 결제 등)가 포함될 수 있습니다.

Header 요소가 제공되는 경우 Envelope 요소의 첫 번째 하위 요소여야 합니다.

참고: Header 요소의 모든 직계 하위 요소는 정규화된 네임스페이스여야 합니다.

<?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:Header>
<m:Trans xmlns:m="http://www.w3schools.com/transaction/"
비누:mustUnderstand="1">234
</m:Trans>
</soap:Header>
...
...
</soap:Envelope>

위의 예에는 "Trans" 요소가 있는 헤더가 포함되어 있으며 해당 값은 다음과 같습니다. 234이고 이 요소의 "mustUnderstand" 속성 값은 "1"입니다.

SOAP는 기본 네임스페이스("http://www.w3.org/2001/12/soap-envelope")에 세 가지 속성을 정의합니다.

세 가지 속성은 actor, mustUnderstand 및 EncodingStyle입니다. SOAP 헤더에 정의된 이러한 속성은 컨테이너가 SOAP 메시지를 처리하는 방법을 정의합니다.


mustUnderstand 속성

SOAP의 mustUnderstand 속성은 수신자가 처리하는 데 헤더 항목이 필수인지 선택 사항인지 식별하는 데 사용할 수 있습니다.

Header 요소의 하위 요소에 "mustUnderstand="1"을 추가하면 이 헤더를 처리하는 수신자가 이 요소를 인식해야 함을 나타낼 수 있습니다. 이 수신자가 이 요소를 인식할 수 없으면 이 헤더를 처리할 때

구문

soap:mustUnderstand="0|1"

Example

<?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:Header>
<m:Trans xmlns:m="http://www.w3schools.com/transaction/"
비누:mustUnderstand="1">234
</m:Trans>
</soap:Header>
...
...
</soap:Envelope>


actor 속성

SOAP 메시지는 메시지 경로를 따라 다양한 끝점을 통과하여 발신자에서 수신자로 전파될 수 있습니다. SOAP 메시지의 모든 부분이 SOAP 메시지의 최종 끝점으로 전달되는 것은 아니지만 메시지 경로를 따라 하나 이상의 끝점으로 전달될 수도 있습니다.

SOAP의 행위자 속성은 특정 끝점에 대한 헤더 요소의 주소를 지정하는 데 사용될 수 있습니다.

Syntax

soap:actor="URI"

Example

<?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:Header>
<m:Trans xmlns:m="http://www.w3schools.com/transaction/"
비누:배우="http://www.w3schools.com/appml/">234
</m:Trans>
</soap:Header>
...
...
</soap:Envelope>


encodingStyle 속성

SOAP의 인코딩 스타일 속성은 문서에서 정의하는 데 사용됩니다. 사용된 데이터 유형입니다. 이 특성은 모든 SOAP 요소에 나타날 수 있으며 요소의 콘텐츠와 모든 하위 요소에 적용됩니다.

SOAP 메시지에는 기본 인코딩이 없습니다.

Syntax

soap:encodingStyle="URI"

PHP 중국어 웹사이트