Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.Este contenido no está disponible en el idioma seleccionado.
9.2. Enabling MTOM
9.2.1. Using JAX-WS APIs Copiar enlaceEnlace copiado en el portapapeles!
Overview Copiar enlaceEnlace copiado en el portapapeles!
Service provider Copiar enlaceEnlace copiado en el portapapeles!
- Access the
Endpointobject for your published service.The easiest way to access theEndpointobject is when you publish the endpoint. For more information see Chapter 30, Publishing a Service. - Get the SOAP binding from the
Endpointusing itsgetBinding()method, as shown in Example 9.4, “Getting the SOAP Binding from an Endpoint”.Example 9.4. Getting the SOAP Binding from an Endpoint
// Endpoint ep is declared previously SOAPBinding binding = (SOAPBinding)ep.getBinding();
// Endpoint ep is declared previously SOAPBinding binding = (SOAPBinding)ep.getBinding();Copy to Clipboard Copied! Toggle word wrap Toggle overflow You must cast the returned binding object to aSOAPBindingobject to access the MTOM property. - Set the binding's MTOM enabled property to
trueusing the binding'ssetMTOMEnabled()method, as shown in Example 9.5, “Setting a Service Provider's MTOM Enabled Property”.Example 9.5. Setting a Service Provider's MTOM Enabled Property
binding.setMTOMEnabled(true);
binding.setMTOMEnabled(true);Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Consumer Copiar enlaceEnlace copiado en el portapapeles!
- Cast the consumer's proxy to a
BindingProviderobject.TipFor information on getting a consumer proxy see Chapter 24, Developing a Consumer Without a WSDL Contract or Chapter 27, Developing a Consumer From a WSDL Contract. - Get the SOAP binding from the
BindingProviderusing itsgetBinding()method, as shown in Example 9.6, “Getting a SOAP Binding from aBindingProvider”.Example 9.6. Getting a SOAP Binding from a
BindingProvider// BindingProvider bp declared previously SOAPBinding binding = (SOAPBinding)bp.getBinding();
// BindingProvider bp declared previously SOAPBinding binding = (SOAPBinding)bp.getBinding();Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the bindings MTOM enabled property to
trueusing the binding'ssetMTOMEnabled()method, as shown in Example 9.7, “Setting a Consumer's MTOM Enabled Property”.Example 9.7. Setting a Consumer's MTOM Enabled Property
binding.setMTOMEnabled(true);
binding.setMTOMEnabled(true);Copy to Clipboard Copied! Toggle word wrap Toggle overflow
9.2.2. Using configuration Copiar enlaceEnlace copiado en el portapapeles!
Overview Copiar enlaceEnlace copiado en el portapapeles!
Procedure Copiar enlaceEnlace copiado en el portapapeles!
jaxws:endpoint element for your endpoint. To enable MTOM do the following:
- Add a
jaxws:propertychild element to the endpoint'sjaxws:endpointelement. - Add a
entrychild element to thejaxws:propertyelement. - Set the
entryelement'skeyattribute tomtom-enabled. - Set the
entryelement'svalueattribute totrue.
Example Copiar enlaceEnlace copiado en el portapapeles!
Example 9.8. Configuration for Enabling MTOM