title: How to marshall soap response to pojo?
body: <p>I have a simple Spring integration project in which I connect to simple soap service 
  <a href="http://www.w3schools.com/webservices/tempconvert.asmx" rel="nofollow">http://www.w3schools.com/webservic/tempconvert.asmx</a> to convert temperature.</p>
  
  <p>Here is xml that defines chain for soap service:</p>
  
  <pre><code>   &lt;beans:beans
          ...
          &lt;chain input-channel="fahrenheitChannel" output-channel="celsiusChannel"&gt;
              &lt;ws:header-enricher&gt;
                  &lt;ws:soap-action value="http://www.w3schools.com/webservices/FahrenheitToCelsius"/&gt;
              &lt;/ws:header-enricher&gt;
              &lt;ws:outbound-gateway uri="http://www.w3schools.com/webservices/tempconvert.asmx"/&gt;
          &lt;/chain&gt;
  
          &lt;!-- The response from the service is logged to the console. --&gt;
          &lt;stream:stdout-channel-adapter id="celsiusChannel"/&gt;
  
      &lt;/beans:beans&gt;
  </code></pre>
  
  <p>and here is demo class that sends message through input channel:</p>
  
  <pre><code> public class WebServiceDemoTestApp {
  
      public static void main(String[] args) {
          ClassPathXmlApplicationContext context =
              new ClassPathXmlApplicationContext("/META-INF/spring/integration/temperatureConversion.xml");
          ChannelResolver channelResolver = new BeanFactoryChannelResolver(context);
  
          // Compose the XML message according to the server's schema
          String requestXml =
                  "&lt;FahrenheitToCelsius xmlns=\"http://www.w3schools.com/webservices/\"&gt;" +
                  "    &lt;Fahrenheit&gt;90.0&lt;/Fahrenheit&gt;" +
                  "&lt;/FahrenheitToCelsius&gt;";
  
          // Create the Message object
          Message&lt;String&gt; message = MessageBuilder.withPayload(requestXml).build();
  
          // Send the Message to the handler's input channel
          MessageChannel channel = channelResolver.resolveChannelName("fahrenheitChannel");
          channel.send(message);
      }
  
  }
  </code></pre>
  
  <p>It works fine and I here is response:</p>
  
  <pre><code>&lt;FahrenheitToCelsiusResponse xmlns="http://www.w3schools.com/webservices/"&gt;&lt;FahrenheitToCelsiusResult&gt;32.2222222222222&lt;/FahrenheitToCelsiusResult&gt;&lt;/FahrenheitToCelsiusResponse&gt;
  </code></pre>
  
  <p>Now, how can I marshall that xml response to simple pojo object?</p>
  
  <p>If someone could post some code example.</p>