3

I have JAX-WS endpoint defined with @MTOM annotation and set threshold as below. So I expect any attachments less 5MB shall be sent inline as base64binary. But the soap response is always returned as MTOM for even small files.

Is this expected behavior? How can I enforce this flexibility otherwise ?

@HandlerChain(file="/handler-chain.xml")
@MTOM(threshold=5242880) // 5MB limit for inline soap attachements else MTOM
public class WSImpl {

I'm interested in this behavior. This is not the spec, but at least Metro implementation behaves like that (at least old version) in jboss 5. The Apache CXF does always sends as MTOM if enabled and does not care about threshold.

ulab
  • 1,079
  • 3
  • 15
  • 45
  • MTOM is only applied to base64 encoded elements defined as `xs:base64Binary` in the SOAP message. Is this your use case or are you expecting SOAP attachments to be coded as base64binary? Because this second behaviour is not the target of the specification – pedrofb Jul 25 '17 at 08:07
  • The element is defined as `xs:base64Binary` and `MTOM` is enabled in server side. I'm interested the exact behavior mentioned in [here](https://docs.oracle.com/cd/E14571_01/web.1111/e13734/mtom.htm#WSADV139). It says depending on the threshold, the `xs:base64Binary` is sent as attachment or inline soap. – ulab Jul 25 '17 at 08:36
  • Then the specification is clear. It should work as an you said. Maybe it's a wildfly bug – pedrofb Jul 25 '17 at 08:39
  • yes, actually I think its `Apache CXF bug` which is embedded in the `wildfly`. But it is difficult to prove it in Wildfly because to replace `Metro` instead of default `CXF` is nightmare. – ulab Jul 25 '17 at 08:43
  • 1
    do you know the underlying version of CXF that your server is including right now? MAy be this bug is related https://issues.apache.org/jira/browse/CXF-4720 – pedrofb Jul 25 '17 at 08:45
  • Thanks. it is `Apache CXF 3.1.4` in Wildfly 10. But I have checked the behavior in `Jboss 7.2` and it is same. So apparently the CXF did not take care if the threshold is less than the provided value if found as `xop`. – ulab Jul 25 '17 at 08:58
  • 1
    I have reviewed the github repository of CXF and the threshold parameter is managed. I have reviewed the list of bugs and there is nothing, so maybe it is an undetected bug. I suggest contacting the CXF team – pedrofb Jul 25 '17 at 09:20
  • Thanks for your time! – ulab Jul 25 '17 at 09:28

0 Answers0