In some references, it says when @BindingType (value = SOAPBinding.SOAP11HTTP_MTOM_BINDING) and @MTOM (enabled=false) are present in a SIB,
the MTOM annotation will take the precedence and it means MTOM will be disable.
But when I tried this with Martin Kalin's SkiImageService example in chapter 3, like this:
When I ran the publisher, I got this from my NetBean platform using JDK 1.7
It seems to me that MTOM cannot override BindingType in NetBean platform. This contradicts with what the references saying MTOM annotation overrides BindingType annotation
6.5.2 javax.xml.ws.soap.MTOMFeature The MTOMFeature is used to specify if MTOM should be used with a web service. This feature should be used instead of the javax.xml.ws.soap.SOAPBinding.SOAP11HTTP MTOM BINDING, javax.xml.ws.soap.SOAPBinding.SOAP12HTTP MTOM BINDING and the javax.xml.ws.soap.SOAPBinding.setMTOMEnabled().
There is no precedence defined in the specs, so it is up to the application server developers to define a rule or not.
In my previous example, I put @MTOM(false) and @BindingType together in the same SIB. I expect MTOM is disabled according to the above specification. However, I got an error saying @MTOM(false) contradicts against @BindingType(....) .