Results 1 to 4 of 4

Thread: Order of Interceptors

  1. #1

    Default Order of Interceptors

    How are the order of endpoint interceptors determined. For troubleshooting purposes, I'd like to have my PayloadLoggingInterceptor log the response first, before the PayloadValidatingInterceptor runs, since when it fails validation, it never logs, and I can't see the message that failed to validate.

  2. #2
    Join Date
    Jul 2005
    Location
    Munich, Germany
    Posts
    153

    Default

    If an interceptor returns false (which is the case for the PayloadValidatingInterceptor in the case of a validation error) not further interceptor will be executed. So you have to add the PayloadLoggingInterceptor twice - one for request logging (before the PayloadValidatingInterceptor) and one for response logging (after the PayloadValidatingInterceptor). This is how I did it:

    Code:
        <bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping">
            <property name="interceptors">
                <list>
                    <bean class="org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor">
                        <property name="logRequest" value="true"/>
                        <property name="logResponse" value="false"/>
                    </bean>
                    <bean class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor">
                        <property name="schemas">
                            <!-- ... -->
                        </property>
                        <property name="validateRequest" value="true"/>
                        <property name="validateResponse" value="true"/>
                    </bean>
                    <bean class="org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor">
                        <property name="logRequest" value="false"/>
                        <property name="logResponse" value="true"/>
                    </bean>
                </list>
            </property>
        </bean>
    HTH
    Oliver

  3. #3

    Default

    Excellent. That makes sense now. Thank you very much.

  4. #4
    Join Date
    Nov 2008
    Posts
    1

    Default

    Thank you for your info! It give me much help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •