[SWS-474] Interceptor on endpoint Created: 08/Jan/09  Updated: 27/Jun/12  Resolved: 27/Jun/12

Status: Resolved
Project: Spring Web Services
Component/s: Core
Affects Version/s: 1.5.5
Fix Version/s: 2.0 GA

Type: Improvement Priority: Major
Reporter: Thomas Champagne Assignee: Arjen Poutsma
Resolution: Fixed Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


With the current implementation, it's not possible to define an EndpointInterceptor on a particular endpoint. You can only add interceptors on EndpointMapping so in a group of endpoint.

When you use annotations (@Endpoint), you have only one EndpointMapping (AnnotationMethodEndpointMapping) for all endpoints and you can not define an interceptor for one method.

Personally, I would like secured some methods but not all with the XwsSecurityInterceptor. But with the AnnotationMethodEndpointMapping, I can't do that.

A thread in the forum about this problem.

Comment by omar elmandour [ 04/Feb/11 ]

It seems already implemented in the class
PayloadRootSmartSoapEndpointInterceptor & SoapActionSmartEndpointInterceptor
since 2.0.

Comment by Thomas Champagne [ 26/Jun/12 ]

I'm agree with ramo roudnamle :-D
For example with this spring-ws 1.x config :

<bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping">
  <property name="mappings">
      <prop key="{hxxp://blah.com:8080/api/blah/v1}getBlahRequest">getBlahRequestEndpoint</prop>
      <prop key="{hxxp://blah.com:8080/api/blah/v1}SaveBlahRequest">saveBlahRequestEndpoint</prop>   	             	              	        	
      <prop key="{hxxp://blah.com:8080/api/blah/v1}GetAllActiveRequest">getAllActiveRequestEndpoint</prop>             	
  <property name="interceptors">
      <ref local="validationInterceptor"/>       

You can define with spring-ws 2.0 :

  <sws:payloadRoot namespaceUri="{hxxp://blah.com:8080/api/blah/v1}">
    <bean class="validationInterceptor"/>

So, this issue can be closed with version 2.0.

Comment by Arjen Poutsma [ 27/Jun/12 ]

Resolved as fixed, thanks for pointing this out!

Generated at Tue Nov 20 21:47:04 UTC 2018 using JIRA 7.9.2#79002-sha1:3bb15b68ecd99a30eb364c4c1a393359bcad6278.