SOAP Body 요소

의무적으로 사용되는 SOAP 본체 요소는 실제 SOAP 메시지를 포함합니다.

SOAP Body 요소

필수 SOAP 본체 요소는 메시지의 최종 목적지에 전달할 예정인 실제 SOAP 메시지를 포함할 수 있습니다.

SOAP 본체 요소의 직접 자식 요소는 이름공간이 올바른 요소일 수 있습니다. SOAP은 기본 이름공간("http://www.w3.org/2001/12/soap-envelope")에서 본체 요소 내부의 요소를 정의합니다. 즉, SOAP의 Fault 요소는 오류 메시지를 지시하는 역할을 합니다.

<?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>
   <m:GetPrice xmlns:m="http://www.codew3c.com/prices">
      <m:Item>사과</m:Item>
   </m:GetPrice>
</soap:Body>
</soap:Envelope>

위의 예제는 사과의 가격을 요청합니다. 위의 m:GetPrice와 Item 요소는 애플리케이션 전용 요소이며, SOAP 표준의 일부가 아닙니다.

이SOAP 응답은 다음과 같아야 합니다:

<?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>
   <m:GetPriceResponse xmlns:m="http://www.codew3c.com/prices">
      <m:Price>1.90</m:Price>
   </m:GetPriceResponse>
</soap:Body>
</soap:Envelope>