Announcement Announcement Module
Collapse
No announcement yet.
How to map interceptor only on particular endpoints? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to map interceptor only on particular endpoints?

    For example:

    Code:
    <bean id="endpointMapping" class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping">
    		<property name="mappings">
        	    <props>
            	    <prop key="{http://www.something.org}firstRQ">firstEndpoint</prop-->
            	    <prop key="{http://www.something.org}secondRQ">secondEndpoint</prop>
            	    <prop key="{http://www.something.org}thirdRQ">thirdEndpoint</prop>
        	    </props>
    	    </property>
        	<property name="interceptors">
    			<list>
    				<ref bean="loggingInterceptor" />
    				<ref bean="requestInterceptor" />
    			</list>
    		</property>
    	</bean>
    I have three endpoints and I need to assign on each of them PayloadValidatingInterceptor with particular schema (xsd):

    on firstEndpoint
    Code:
    <bean id="firstValidatingInterceptor"
    class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor">
    <property name="schema" value="/WEB-INF/firstRQ.xsd"/>
    <property name="validateRequest" value="true"/>
    <property name="validateResponse" value="false"/>
    </bean>
    on secondEndpoint
    Code:
    <bean id="secondValidatingInterceptor"
    class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor">
    <property name="schema" value="/WEB-INF/secondRQ.xsd"/>
    <property name="validateRequest" value="true"/>
    <property name="validateResponse" value="false"/>
    </bean>
    on thirdEndpoint
    Code:
    <bean id="thirdValidatingInterceptor"
    class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor">
    <property name="schema" value="/WEB-INF/thirdRQ.xsd"/>
    <property name="validateRequest" value="true"/>
    <property name="validateResponse" value="false"/>
    </bean>
    But I can't find any example how to assign a particular interceptor on a particular endpoint. Does anybody know how to do that?

  • #2
    That isn't necessary, you can do this...

    Code:
    <bean id="validatingInterceptor" class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor">
    <property name="schemas">
      <list>
        <value>/WEB-INF/firstRQ.xsd</value>
        <value>/WEB-INF/secondRQ.xsd</value>
        <value>/WEB-INF/thirdRQ.xsd</value>
      </list>
    </property>
    </bean>
    The request will be validated against the schema that defined it.

    Comment


    • #3
      That's cool. I think that should be pointed in the documentation.

      Comment


      • #4
        Yeah, the "schemas" property is a new feature that didn't make it into the reference guide.

        I've opened a jira for it to be added...
        http://opensource.atlassian.com/proj...browse/SWS-221

        Thanks.

        Comment

        Working...
        X