Intercept request with a payload that have not been defined in a EndpointMapping

Details

Description

With the current EndpointInterceptor implementation, it is not possible to handle a request with a payload that have not been defined in a EndpointMapping. The handleRequest method of EndpointInterceptor is called after the MessageDispather get an endpoint based on the payload request. If no endpoint is found, the MessageDispatcher throws NoEndpointFoundException (and generate with servlet a 404 error).
So, it's not possible to use the PayloadTransformingInterceptor for changing the namespace or name of a payload element because this QName may not be defined in a EndpointMapping.

I read the spring-ws code and I found two solution to fix this problem.

The first solution is to add a new method in EndPointInterceptor interface (or add a new interface) without endpoint parameter (EndpointInvocationChain mappedEndpoint) : handleRequest(MessageContext messageContext).
And call it before get the endpoint in MessageDispatcher.

The second solution is to be able to define some @PayloadRoot on a method. But for this, you must create a new annotation to accept some @PayloadRoot. For example, @PayloadRoots. And for example, you could have :