MTOM Settings and Runtime Configuration  Locate

By default both client and server are in auto MTOM mode. The four possible values of MTOM, as described in MTOM Examples are never, auto, always, and always-including-faults. These default settings are located in the clientconf.xml (client configuration settings) and serverconf.xml (server configuration settings) configuration files in the <useMtomXop> configuration element.

Table 41, “WSDL2Java to Java Mapping according to current MTOM mode” list the mappings between Schema Element types and Java types in WSDL2Java tool according to current MTOM mode.

Table 41. WSDL2Java to Java Mapping according to current MTOM mode

MTOM mode Schema Element Type Java Type
neverbase64Binary with xmlmime attributesorg.idoox.wasp.types.MtomMessageAttachment
neverbase64Binary without xmlmime attributesbyte[]
autobase64Binary with xmlmime attributesorg.idoox.wasp.types.MtomMessageAttachment
autobase64Binary without xmlmime attributesbyte[]
alwaysbase64Binary with xmlmime attributesorg.idoox.wasp.types.MtomMessageAttachment
alwaysbase64Binary without xmlmime attributesorg.idoox.wasp.types.MtomMessageAttachment
always-including-faultsbase64Binary with xmlmime attributesorg.idoox.wasp.types.MtomMessageAttachment
always-including-faultsbase64Binary without xmlmime attributesorg.idoox.wasp.types.MtomMessageAttachment

Table 42, “Outgoing messages according to current MTOM mode” list the WSO2 SOA Enablement Server for Java invocation framework behaviour according to current MTOM mode.

Table 42. Outgoing messages according to current MTOM mode

MTOM mode Outgoing message type
neverForces the sending side to don't produce MTOM messages. Outgoing message will contain base64-encoded data only.
auto Forces the sending side to emit MTOM message if the message that will be sent contains at least one base64Binary element that is mapped to an org.idoox.wasp.types.MtomMessageAttachment object. Otherwise emited message will contain base64 encoded data only.
always Forces the sending side to always produce MTOM messages, although there is no base64Binary element in the outgoing message schema definition.
always-including-faults Forces the sending side to always produce MTOM messages including faults, although there is no base64Binary element in the outgoing message schema definition.

Configuration settings (those specified in the <useMtomXop> element) can be modified during runtime. The solution is easy, just store one of the values described above to the call context under the key use.mtom as is shown in Example 247 above.

The configuration settings can be also modified in WSDL2Java tool (and WSDL2Java ant task) by specifying --use-mtom on the command line (or by the useMtom attribute in WSDL2Java ant task).

Since version 6.5.4 it is also possible to configure some aspects of XOP package creation with per-call call context properties org.systinet.wasp.webservice.CallContext.MTOM_MAX_ATTACHMENT_PARTS and MTOM_ATTACHMENT_SIZE_TRESHOLD.