Announcement Announcement Module
Collapse
No announcement yet.
deprecation of ServletEndpointSupport Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • deprecation of ServletEndpointSupport

    Hi,

    we are planning to migrate from Spring 2.5 to 3.0. Our web services are still running with Axis 1.3 and every class of a service implementation extends the ServletEndpointSupport. In Spring 3.0 the ServletEndpointSupport is deprecated.

    For example: our web service Implementation is looking like this:
    Code:
    public class StandardPersonService extends ServletEndpointSupport implements PersonService{
    
    @Override
        protected final void onInit() {
        	personWSConverter = (PersonWSConverter) getWebApplicationContext().getBean("PersonWSConverter");
            personDelegate = (PersonDelegate) getWebApplicationContext().getBean("PersonDelegate");
    
        }
    Is there a migration guide or can someone tell me the right way how to exchange this depracted class?

    Thanks in advance!

    Christian

  • #2
    Same Question

    I have the same question. Since the ServletEndpointSupport has been deprecated, what is the proposed new way?

    Comment


    • #3
      Has no one any idea?

      Comment


      • #4
        Ok, The way I configured it was with Annotations.

        Basically I created a POJO class that has the @Endpoint annotation on it.

        I then configured a separate applicationContext-ws.xml file for the webservice settings:

        Code:
        <?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:oxm="http://www.springframework.org/schema/oxm"
               xmlns:sws="http://www.springframework.org/schema/web-services"
               xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
               http://www.springframework.org/schema/oxm http://www.springframework.org/schema/oxm/spring-oxm-1.5.xsd
               http://www.springframework.org/schema/web-services http://www.springframework.org/schema/web-services/web-services-1.5.xsd">
        
            <bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory"/>
        
            <bean id="messageReceiver" class="org.springframework.ws.soap.server.SoapMessageDispatcher"/>
        
            <bean id="schemaCollection" class="org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection">
                <property name="xsds" value="/myWebService.xsd"/>
                <property name="inline" value="true"/>
            </bean>
            
            <oxm:jaxb2-marshaller id="marshaller" contextPath="com.foo.your.path.to.jaxb.classes"/>
        
            <!-- ===================== ENDPOINT MAPPINGS  ============================== -->
            <bean id="annotationMapping"
                  class="org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping">
                <description>
                    Detects @PayloadRoot annotations on @Endpoint bean methods. 
                    It uses two interceptors: one that logs the message payload, and the other validates
                    it accoring to the 'airline.xsd' schema file.
                </description>
                <property name="order" value="1"/>
            </bean>
        
            <!-- ===================== ENDPOINT ADAPTERS  ============================== -->
            <sws:marshalling-endpoints/>
        
            <!-- ===================== ENDPOINT EXCEPTION RESOLVER ===================== -->
        
            <!--
                Endpoint exception resolvers can handle exceptions as they occur in the Web service. We have two sorts of
                exceptions we want to handle: the business logic exceptions NoSeatAvailableException and NoSuchFlightException,
                which both have a @SoapFault annotation, and other exceptions, which don't have the annotation. Therefore, we
                have two exception resolvers here.
            -->
        
            <bean class="org.springframework.ws.soap.server.endpoint.SoapFaultAnnotationExceptionResolver">
                <description>
                    This exception resolver maps exceptions with the @SoapFault annotation to SOAP Faults. 
                </description>
                <property name="order" value="1"/>
            </bean>
        
            <bean class="org.springframework.ws.soap.server.endpoint.SoapFaultMappingExceptionResolver">
                <description>
                    This exception resolver maps other exceptions to SOAP Faults. Both UnmarshallingException and
                    ValidationFailureException are mapped to a SOAP Fault with a "Client" fault code.
                    All other exceptions are mapped to a "Server" error code, the default.
                </description>
                <property name="defaultFault" value="SERVER"/>
                <property name="exceptionMappings">
                    <props>
                        <prop key="org.springframework.oxm.UnmarshallingFailureException">CLIENT,Invalid request</prop>
                        <prop key="org.springframework.oxm.ValidationFailureException">CLIENT,Invalid request</prop>
                    </props>
                </property>
                <property name="order" value="2"/>
            </bean>
        
        </beans>
        I then added these settings to my web.xml

        Code:
        <servlet>
            <servlet-name>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>
        </servlet>
        <servlet-mapping>
            <servlet-name>ws</servlet-name>
            <url-pattern>/services</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
            <servlet-name>ws</servlet-name>
            <url-pattern>*.wsdl</url-pattern>
        </servlet-mapping>
        I hope this helps.

        Marty

        Comment

        Working...
        X