title: Spring Endpoint - Get CDATA content from soap request
body: <p>I am new in webservices.</p>
  <p>From documentation I got, I should create SpringWeb Service Endpoint that need to consume payload with content in CDATA:</p>
  <pre><code>&lt;soapenv:Envelope xmlns:soapenv=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;
                  xmlns:res=&quot;http://xxx/result&quot;&gt;
      &lt;soapenv:Header/&gt;
      &lt;soapenv:Body&gt;
          &lt;res:ResultMsg&gt;
          &lt;![CDATA[&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
                  &lt;result xmlns=&quot;http://xxx/result&quot;&gt;
                      &lt;Param1&gt;1&lt;/Param1&gt;
                      &lt;Param2&gt;2&lt;/Param2&gt;
                  &lt;/result&gt;
                  &lt;/xml&gt;]]&gt;
          &lt;/res:ResultMsg&gt;
      &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>
  <p>I generated the Result object.
  My endpoint looks:</p>
  <pre><code>@Endpoint
  @RequiredArgsConstructor
  @Slf4j
  public class ResultEndpoint {
  
      private static final String NAMESPACE_URI = &quot;http://xxx/result&quot;;
  
      @PayloadRoot(namespace = NAMESPACE_URI, localPart = &quot;ResultMsg&quot;)
      public void resultReceived(@RequestPayload Result result) {
          log.info(&quot;Web Service result&quot;, result);
      }
  }
  </code></pre>
  <p>And WebServiceConfig looks:</p>
  <pre><code>@EnableWs
  @Configuration
  public class WebServiceConfig extends WsConfigurerAdapter {
  
      @Bean
      public ServletRegistrationBean&lt;MessageDispatcherServlet&gt; messageDispatcherServlet(ApplicationContext applicationContext) {
          MessageDispatcherServlet servlet = new MessageDispatcherServlet();
          servlet.setApplicationContext(applicationContext);
          servlet.setTransformWsdlLocations(true);
          return new ServletRegistrationBean&lt;&gt;(servlet, &quot;/ws/endpoint&quot;);
      }
  
      @Bean(name = &quot;result&quot;)
      public DefaultWsdl11Definition defaultWsdl11Definition(XsdSchema resultSchema) {
          DefaultWsdl11Definition wsdl11Definition = new DefaultWsdl11Definition();
          wsdl11Definition.setPortTypeName(&quot;PortName&quot;); //Not sure if its ok
          wsdl11Definition.setLocationUri(&quot;/ws/endpoint&quot;);
          wsdl11Definition.setTargetNamespace(&quot;http://xxx/result&quot;);
          wsdl11Definition.setSchema(resultSchema);
          return wsdl11Definition;
      }
  
      @Bean
      public XsdSchema countriesSchema() {
          return new SimpleXsdSchema(new ClassPathResource(&quot;path_to_xsd.xsd&quot;));
      }
  }
  </code></pre>
  <p>Also XSD schema is:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;xs:schema xmlns:res=&quot;http://xxx/result&quot; xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot; targetNamespace=&quot;http://api-v1.gen.mm.vodafone.com/mminterface/result&quot; elementFormDefault=&quot;qualified&quot; attributeFormDefault=&quot;unqualified&quot;&gt;
      &lt;xs:complexType name=&quot;Result&quot;&gt;
          &lt;xs:sequence&gt;
              &lt;xs:element name=&quot;Param1&quot; type=&quot;xs:integer&quot; minOccurs=&quot;0&quot; nillable=&quot;true&quot;&gt;
                  &lt;xs:annotation&gt;
                      &lt;xs:documentation&gt;...&lt;/xs:documentation&gt;
                  &lt;/xs:annotation&gt;
              &lt;/xs:element&gt;
              &lt;xs:element name=&quot;Param2&quot;&gt;
                  &lt;xs:annotation&gt;
                      &lt;xs:documentation&gt;...&lt;/xs:documentation&gt;
                  &lt;/xs:annotation&gt;
                  &lt;xs:simpleType&gt;
                      &lt;xs:restriction base=&quot;xs:string&quot;&gt;
                          &lt;xs:maxLength value=&quot;10&quot;/&gt;
                      &lt;/xs:restriction&gt;
                  &lt;/xs:simpleType&gt;
              &lt;/xs:element&gt;
          &lt;/xs:sequence&gt;      
      &lt;/xs:complexType&gt;
      &lt;xs:element name=&quot;result&quot; type=&quot;res:Result&quot;&gt;&lt;/xs:element&gt;
  &lt;/xs:schema&gt;
  
  </code></pre>
  <p>The values in the request payload are always null, what am I missing?</p>