title: How to configure JibxMarshalling & unmarshalling in Spring 3+ WS 2+ using Annotation, JibxMarshalling or using xml config?
body: <p>I am currently using JibxMarshalling &amp; Unmarshalling in Spring 2.5, spring-ws-1.5.8 and Weblogic 9/10 in my project.</p>
  
  <p>But, I want to migrate to Spring 3+ , WS 2+ and Weblogic 12x.</p>
  
  <p>Below is the my current code,</p>
  
  <p><strong><em>pom.xml</em></strong> </p>
  
  <pre><code>&lt;plugin&gt;
          &lt;groupId&gt;org.jibx&lt;/groupId&gt;
                      &lt;artifactId&gt;maven-jibx-plugin&lt;/artifactId&gt;
                      &lt;version&gt;1.1.6a&lt;/version&gt;
                      &lt;executions&gt;
                          &lt;execution&gt;
                              &lt;goals&gt;
                                  &lt;goal&gt;bind&lt;/goal&gt;
                              &lt;/goals&gt;
                          &lt;/execution&gt;
                      &lt;/executions&gt;
                  &lt;/plugin&gt;
  
  
  &lt;dependency&gt;
              &lt;groupId&gt;org.jibx&lt;/groupId&gt;
              &lt;artifactId&gt;jibx-bind&lt;/artifactId&gt;
              &lt;version&gt;1.1.6a&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jibx&lt;/groupId&gt;
              &lt;artifactId&gt;jibx-extras&lt;/artifactId&gt;
              &lt;version&gt;1.1.5&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jibx&lt;/groupId&gt;
              &lt;artifactId&gt;jibx-run&lt;/artifactId&gt;
              &lt;version&gt;1.1.6a&lt;/version&gt;
          &lt;/dependency&gt;
  </code></pre>
  
  <p><strong><em>Endpoint Class</em></strong></p>
  
  <pre><code>import org.springframework.ws.server.endpoint.AbstractMarshallingPayloadEndpoint;
  
  public class MyOrderEndpoint extends  AbstractMarshallingPayloadEndpoint {
  
      private static final Logger log = Logger
              .getLogger(GetFinancialPeriodsEndpoint.class);
  
      /**
       * vendor data loader wrapper
       */
      private VendorDataLoader vendorDataLoader;
      /**
       * id translation instance
       */
      private IdTranslator idTranslator;
  
      public VendorDataLoader getVendorDataLoader() {
          return vendorDataLoader;
      }
  
      public void setVendorDataLoader(VendorDataLoader vendorDataLoader) {
          this.vendorDataLoader = vendorDataLoader;
      }
  
      public IdTranslator getIdTranslator() {
          return idTranslator;
      }
  
      public void setIdTranslator(IdTranslator idTranslator) {
          this.idTranslator = idTranslator;
      }
  
      @Override
      protected Object invokeInternal(Object request) throws Exception {
          GetFinancialPeriods stRequest = (GetFinancialPeriods) request;
          List&lt;Statement&gt; statementList = stRequest.getStatements();
          String requestor = stRequest.getRequestor();
          long start = System.currentTimeMillis();
  
          .............
          ............
          return response;
      }
  </code></pre>
  
  <p><strong><em>spring-ws-servlet.xml</em></strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:util="http://www.springframework.org/schema/util" 
      xsi:schemaLocation="
      http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd   
      http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"&gt;
  
      &lt;bean id="payloadMapping"
          class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping"&gt;
          &lt;property name="endpointMap"&gt;
              &lt;map&gt;
                  &lt;entry key="{http://integration.pabi.com/ServiceSchema/v3/order}getMyOrder"
                      value-ref="getMyOrderEndpoint" /&gt;
                      ..........
                      .........
                  &lt;/map&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="getFinancialPeriodsEndpoint" class="com.pabi.ws.MyOrderEndpoint"&gt;
          &lt;property name="marshaller" ref="jibxResponseMarshaller" /&gt;
          &lt;property name="unmarshaller" ref="jibxUnmarshaller" /&gt;
          &lt;property name="vendorDataLoader" ref="cacheLoader"/&gt;
          &lt;property name="idTranslator" ref="idTranslator"/&gt;
      &lt;/bean&gt;
  
      &lt;bean id="jibxResponseMarshaller" class="org.springframework.oxm.jibx.JibxMarshaller"&gt;
          &lt;property name="targetClass"
              value="com.pabi.ws.MyOrderResponse" /&gt;
          &lt;property name="encoding" value="UTF-8"/&gt;
      &lt;/bean&gt;
      &lt;bean id="jibxUnmarshaller" class="org.springframework.oxm.jibx.JibxMarshaller"&gt;
          &lt;property name="targetClass"
              value="com.pabi.ws.MyOrder" /&gt;
      &lt;/bean&gt;
  
  
      &lt;bean id="FinancialStatement"
          class="org.springframework.ws.wsdl.wsdl11.SimpleWsdl11Definition"&gt;
          &lt;property name="wsdl" value="classpath:/wsdl/MyOrders.wsdl" /&gt;
      &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p><strong><em>web.xml</em></strong></p>
  
  <pre><code>&lt;servlet&gt;
        &lt;servlet-name&gt;springmvc&lt;/servlet-name&gt;
        &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
        &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
  
      &lt;!-- take especial notice of the name of this servlet --&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;spring-ws&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.springframework.ws.transport.http.MessageDispatcherServlet&lt;/servlet-class&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;transformWsdlLocations&lt;/param-name&gt;
              &lt;param-value&gt;true&lt;/param-value&gt;
          &lt;/init-param&gt;
          &lt;load-on-startup&gt;2&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;spring-ws&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/services/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;servlet-mapping&gt;
        &lt;servlet-name&gt;springmvc&lt;/servlet-name&gt;
        &lt;url-pattern&gt;*.do&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  </code></pre>