An application which consumes my webservice sends an invalid soap-request, my service can not handle this request.
The applications send an wrong tag (misspelled), but they cannot alter this behaviour.
So my question:
Is there a possibility with a filter or a listner to get the raw http stream, alter something and put it back into the chain.
Thank you, Alex
I assume you want to change incoming body of the HTTP request. There is no easy way to do this. I don’t know of any Servlet API that would allow you to do this “officially”.
“Unofficially” you can do some reflection magic on
org.apache.catalina.connector.Request. If you look at this object, you will see that both methods which return the actual body (getReader()andgetInputStream()) are building streams on top of input buffer, instance oforg.apache.catalina.connector.InputBuffer. You would have to manipulate that buffer so it returns tainted data.Needless to say, this is a very volatile and dangerous hack. There are no guarantees this will work on the next Tomcat version (even minor one) and would be virtually unmaintainable.