I am currently using JibxMarshalling & Unmarshalling in Spring 2.5, spring-ws-1.5.8 and Weblogic 9/10 in my project.

But, I want to migrate to Spring 3+ , WS 2+ and Weblogic 12x.

Below is the my current code,

pom.xml

<plugin>
        <groupId>org.jibx</groupId>
                    <artifactId>maven-jibx-plugin</artifactId>
                    <version>1.1.6a</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>bind</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>


<dependency>
            <groupId>org.jibx</groupId>
            <artifactId>jibx-bind</artifactId>
            <version>1.1.6a</version>
        </dependency>
        <dependency>
            <groupId>org.jibx</groupId>
            <artifactId>jibx-extras</artifactId>
            <version>1.1.5</version>
        </dependency>
        <dependency>
            <groupId>org.jibx</groupId>
            <artifactId>jibx-run</artifactId>
            <version>1.1.6a</version>
        </dependency>

Endpoint Class

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<Statement> statementList = stRequest.getStatements();
        String requestor = stRequest.getRequestor();
        long start = System.currentTimeMillis();

        .............
        ............
        return response;
    }

spring-ws-servlet.xml

<?xml version="1.0" encoding="UTF-8"?>
<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">

    <bean id="payloadMapping"
        class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping">
        <property name="endpointMap">
            <map>
                <entry key="{http://integration.pabi.com/ServiceSchema/v3/order}getMyOrder"
                    value-ref="getMyOrderEndpoint" />
                    ..........
                    .........
                </map>
        </property>
    </bean>

    <bean id="getFinancialPeriodsEndpoint" class="com.pabi.ws.MyOrderEndpoint">
        <property name="marshaller" ref="jibxResponseMarshaller" />
        <property name="unmarshaller" ref="jibxUnmarshaller" />
        <property name="vendorDataLoader" ref="cacheLoader"/>
        <property name="idTranslator" ref="idTranslator"/>
    </bean>

    <bean id="jibxResponseMarshaller" class="org.springframework.oxm.jibx.JibxMarshaller">
        <property name="targetClass"
            value="com.pabi.ws.MyOrderResponse" />
        <property name="encoding" value="UTF-8"/>
    </bean>
    <bean id="jibxUnmarshaller" class="org.springframework.oxm.jibx.JibxMarshaller">
        <property name="targetClass"
            value="com.pabi.ws.MyOrder" />
    </bean>


    <bean id="FinancialStatement"
        class="org.springframework.ws.wsdl.wsdl11.SimpleWsdl11Definition">
        <property name="wsdl" value="classpath:/wsdl/MyOrders.wsdl" />
    </bean>
</beans>

web.xml

<servlet>
      <servlet-name>springmvc</servlet-name>
      <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
    </servlet>

    <!-- take especial notice of the name of this servlet -->
    <servlet>
        <servlet-name>spring-ws</servlet-name>
        <servlet-class>org.springframework.ws.transport.http.MessageDispatcherServlet</servlet-class>
        <init-param>
            <param-name>transformWsdlLocations</param-name>
            <param-value>true</param-value>
        </init-param>
        <load-on-startup>2</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>spring-ws</servlet-name>
        <url-pattern>/services/*</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
      <servlet-name>springmvc</servlet-name>
      <url-pattern>*.do</url-pattern>
    </servlet-mapping>
0

There are 0 answers