title: Spring Web Service with Header and Body In Envelope
body: <p>We are creating a webservice that came from a WSDL which the soap messagehas both a header and body in the request and response.  How can you set this up to work with a Spring WS?  I can not find any examples????</p>
  
  <p><strong>In WSDL</strong></p>
  
  <pre><code>&lt;wsdl11:message name="createCourseSectionRequest"&gt;
  &lt;wsdl11:part name="Parameters" element="tns:createCourseSectionRequest"/&gt;
  &lt;wsdl11:part name="HeaderInfoParameters" element="tns:imsx_syncRequestHeaderInfo"/&gt;
  &lt;/wsdl11:message&gt;
  &lt;wsdl11:message name="createCourseSectionResponse"&gt;
  &lt;wsdl11:part name="Response" element="tns:createCourseSectionResponse"/&gt;
  &lt;wsdl11:part name="HeaderInfoResponse" element="tns:imsx_syncResponseHeaderInfo"/&gt;
  &lt;/wsdl11:message&gt;
  </code></pre>
  
  <p><strong>Endpoint</strong></p>
  
  <pre><code>@PayloadRoot(localPart="CreateCourseSectionRequest", namespace="")
      @ResponsePayload
      public CreateCourseSectionResponse createCourseSection(CreateCourseSectionRequest req) {
  
          //TODO 
          return null;
      }
  </code></pre>
  
  <p><strong>Example</strong></p>
  
  <pre><code>&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ims="http://www.imsglobal.org/services/lis/cmsv1p0/wsdl11/sync/imscms_v1p0"&gt;
     &lt;soapenv:Header&gt;
        &lt;ims:imsx_syncRequestHeaderInfo&gt;
           &lt;ims:imsx_version&gt;?&lt;/ims:imsx_version&gt;
           &lt;ims:imsx_messageIdentifier&gt;?&lt;/ims:imsx_messageIdentifier&gt;
           &lt;!--Optional:--&gt;
           &lt;ims:imsx_sendingAgentIdentifier&gt;?&lt;/ims:imsx_sendingAgentIdentifier&gt;
        &lt;/ims:imsx_syncRequestHeaderInfo&gt;
     &lt;/soapenv:Header&gt;
     &lt;soapenv:Body&gt;
        .....
     &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>