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

  • 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
    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

    Comment


    • #3
      Excellent. That makes sense now. Thank you very much.

      Comment


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

        Comment

        Working...
        X