Page 1 of 1

About Question enthuware.ocejws.v6.2.157 :

Posted: Sat Apr 25, 2015 10:59 am
by howdy2u
The answer may be correct, but I haven't been able to confirm.

1) The API doc says ABOVE, ' binary data above this size in bytes will be XOP encoded or sent as attachment. ' So if attachment is 100 bytes and MTOM(threshold=100), then it should be sent inline. 101 would be sent as attachment.

2) Hell if this works correctly on Weblogic 12.1.3. I have an image that is 32063 bytes. I have to set the threshold real high to get it to be sent inline. Not sure where the cut off is. With MTOM(threshold=320640) (notice the extra 0) it is still sent as an attachment. If I add another zero to the end, it gets sent inline.

Re: About Question enthuware.ocejws.v6.2.157 :

Posted: Sun Apr 26, 2015 2:05 pm
by fjwalraven
Hi!
With MTOM(threshold=320640) (notice the extra 0) it is still sent as an attachment. If I add another zero to the end, it gets sent inline.
That is odd, you should check Weblogic for this particulair behaviour. It is obvious that Weblogic does not follow the JAX-WS specs here.

Regards,
Frits

Re: About Question enthuware.ocejws.v6.2.157 :

Posted: Wed Jul 29, 2015 4:09 am
by khaled
Hi,
But the client didn't specify any threshold, why the file will be sent as attachment from the client ? I don't understand that. Can anyone explain me please.

Re: About Question enthuware.ocejws.v6.2.157 :

Posted: Wed Jul 29, 2015 4:47 am
by fjwalraven
If no threshold is specified then the default of 0 bytes is used. That is why it is sent as an attachment.

Regards,
Frits

Re: About Question enthuware.ocejws.v6.2.157 :

Posted: Sat Jul 30, 2016 10:30 pm
by victor2016
Hi,

Please confirm my understanding:

- the File is always sent inline when the size is less than specified threshold
- if no threshold is specified, the File is always sent as attachment

Thanks,
Victor.

Re: About Question enthuware.ocejws.v6.2.157 :

Posted: Sun Jul 31, 2016 1:06 am
by fjwalraven
Hi Victor!

Yes, you understood it correctly!

Note that if you don't specify a threshold, the default of 0 bytes will be used.

Regards,
Frits

Re: About Question enthuware.ocejws.v6.2.157 :

Posted: Sun Nov 13, 2016 6:15 pm
by Gerardo
Hi,
As howdy2u mentioned:
The API doc says ABOVE, ' binary data above this size in bytes will be XOP encoded or sent as attachment. ' So if attachment is 100 bytes and MTOM(threshold=100), then it should be sent inline. 101 would be sent as attachment. (http://docs.oracle.com/javase/6/docs/ap ... /MTOM.html)

For sending the binary data as an attachment which is true?
SIZE >= threshold?
or
SIZE > threshold?

Thanks in advance.

Re: About Question enthuware.ocejws.v6.2.157 :

Posted: Sun Nov 13, 2016 11:41 pm
by fjwalraven
The API doesn't mention it like he is writing it, the answer is:

SIZE >= threshold?

You can verify it in the Metro JAX-WS documentation ( https://jax-ws.java.net/2.2.10/docs/rel ... ation.html )
7.2.4.1. How to specify MTOM data Threshold
Default threshold value for MTOM feature is 0 bytes. You can set a threshold value for MTOM by using @MTOM annotation on server-side or using MTOMFeature on client-side. Let's say you set MTOM threshold as 3000, this serves as hint to JAX-WS when to send binary dat as attachments. In this case, JAX-WS will send any byte array in the message thats equal to or larger than 3KB as attachment and the corresponding XML infoset will be XOP encoded (will contain reference to this attachment)
Regards,
Frits

Re: About Question enthuware.ocejws.v6.2.157 :

Posted: Mon Nov 14, 2016 12:57 am
by Gerardo
Thanks for the clarification Frits

Re: About Question enthuware.ocejws.v6.2.157 :

Posted: Wed Nov 23, 2016 11:30 am
by johnlong
Client does not define any threshold, so it is assumed to be 0.
Does client infer threshold from server?

Re: About Question enthuware.ocejws.v6.2.157 :

Posted: Wed Nov 23, 2016 12:25 pm
by fjwalraven
Good question!

You can define different thresholds on client and server. Let's say that the client has a threshold of 0 and the server has a threshold of 100. If you send a text message of 50 bytes from client to server and back. The message from client to server is sent as an attachment and from server to client inline.

The answer to your question: no they don't interfere.

Regards,
Frits

Re: About Question enthuware.ocejws.v6.2.157 :

Posted: Fri Nov 25, 2016 1:01 pm
by johnlong
Is default threshold 0 or 1Kb?

https://jax-ws.java.net/2.2.1/docs/mtom-swaref.html
As defined by JAXB 2.0 specification xs:base64Binary and xs:hexBinary mapping to java is byte[]. JAX-WS implementation has set a threshold of 1KB of byte[] size.
Default threshold value for MTOM feature is 0 bytes.

Re: About Question enthuware.ocejws.v6.2.157 :

Posted: Fri Nov 25, 2016 1:21 pm
by fjwalraven
Follow the specs (JAX-WS 2.2) in this case:
6.5.2 javax.xml.ws.soap.MTOMFeature
The MTOMFeature has one property threshold, that can be configured to serve as a hint for which binary
data SHOULD be sent as an attachment. The threshold is the size in bytes that binary data SHOULD be
in order to be sent as an attachment. The threshold MUST not be negative. The default value is 0.
Regards,
Frits