SOAP Header 요소
- 이전 페이지 SOAP Envelope
- 다음 페이지 SOAP Body
선택적인 SOAP Header 요소는 헤더 정보를 포함할 수 있습니다.
SOAP Header 요소
선택적인 SOAP Header 요소는 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.codew3c.com/transaction/" soap:mustUnderstand="1">234</m:Trans> </soap:Header> ... ... </soap:Envelope>
위의 예제는 "Trans" 요소를 포함하고 있는 헤더를 포함하고 있으며, 이 요소의 "mustUnderstand" 속성의 값은 "1"입니다.
SOAP은 기본 네임스페이스("http://www.w3.org/2001/12/soap-envelope")에서 세 가지 속성을 정의합니다. 이 세 속성은 actor, mustUnderstand 및 encodingStyle입니다. 이러한 속성은 SOAP 헤더에 정의되어 있으며, SOAP 메시지를 처리하는 방식을 정의할 수 있습니다.
actor 속성
다른 엔드포인트를 통해 메시지 경로를 따라 SOAP 메시지는 발신자에서 수신자로 전파될 수 있습니다. SOAP 메시지의 모든 부분이 SOAP 메시지의 최종 엔드포인트로 전달될 의도는 아닙니다. 그러나 다른 한편, 메시지 경로의 하나나 여러 엔드포인트로 전달될 의도일 수도 있습니다.
SOAP의 actor 속성은 Header 요소를 특정 엔드포인트로 주소를 지정하는 데 사용될 수 있습니다.
문법
soap:actor="URI"
예제
<?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.codew3c.com/transaction/" soap:actor="http://www.codew3c.com/appml/"> 234 </m:Trans> </soap:Header> ... ... </soap:Envelope>
mustUnderstand 속성
SOAP의 mustUnderstand 속성은 타이틀 항목이 처리할 수신자에게 필수인지 선택적인지를 표시하는 데 사용될 수 있습니다.
Header 요소의 자식 요소에 "mustUnderstand="1"을 추가하면, 이 요소를 처리하는 수신자가 이 요소를 인정해야 한다는 것을 나타낼 수 있습니다. 이 수신자가 이 요소를 인정할 수 없다면, 이 요소를 처리할 때 무효화해야 합니다.
문법
soap:mustUnderstand="0|1"
예제
<?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.codew3c.com/transaction/" soap:mustUnderstand="1"> 234 </m:Trans> </soap:Header> ... ... </soap:Envelope>
encodingStyle 속성
SOAP의 encodingStyle 속성은 이전 섹션에서 설명했습니다.
- 이전 페이지 SOAP Envelope
- 다음 페이지 SOAP Body