Applying different interceptors when using @Endpoint and PayloadRootAnnotationMethodEndpointMapping

Spring-WS

On the job we needed two webservice. Both in the same web context and servlet. We’re using the PayloadRootAnnotationMethodEndpointMapping which scans for  @Endpoint annotations to detect webservice endpoints.

We defined some interceptors for validation and security, the problem here was that only one of the two @Endpoint’s needed to be secured but with the annotation mapping it seems that all interceptors configured in the xml config file affect all @Endpoint.

After some googling and reading through the spring-ws reference I found that there currently is no solution or work around available. Which seems a bit dull. I did not want to create two servlet contexts I just wanted different interceptors for each @Endpoint annotated class.

Little thinking led me to the following solution: let’s extend PayloadRootAnnotationMethodEndpointMapping#createEndpointInvocationChain to add the needed interceptor to the invocation chain.

This resulted in an annotation to define interceptors defined in the application context
Continue reading “Applying different interceptors when using @Endpoint and PayloadRootAnnotationMethodEndpointMapping”

Daily WTF

A colleague of mine recently got a question from some one he’s working with on a big Java project at a company he’s stationed for the moment:

Q: if I have a Long with value 1615 and divide it with another long with value 1000, where did the numbers behind the . go ?

“als ik een long1=1615 deel door long2=1000, waar zijn mijn nummers na de comma naartoe?”

Answer by my colleague: read the SCJP book

When he told me this I really was rofling!
Unfortunatly the questionairre really ment it. I, perhaps, should have been crying instead of laughing. My condoleances, my dear colleague that you have to program together with that kind of Java ‘programmers’

Maven 3

I knew i did not had to write down anything, I saw Joachim do it al for me!

Check out his post on Bejug Maven3 session read the post