Results 1 to 4 of 4

Thread: How to map interceptor only on particular endpoints?

  1. #1
    Join Date
    Nov 2007
    Posts
    4

    Default 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. #2
    Join Date
    Oct 2004
    Posts
    207

    Default

    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.

  3. #3
    Join Date
    Nov 2007
    Posts
    4

    Default

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

  4. #4
    Join Date
    Oct 2004
    Posts
    207

    Default

    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.

Posting Permissions

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