/** * Configures SOAP binding of the given SOAP port. */ private void configureBinding(Object port) { BindingProvider bindingProvider = (BindingProvider) port; Map<String, Object> reqContext = bindingProvider.getRequestContext(); reqContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceUrl); Binding binding = bindingProvider.getBinding(); SOAPBinding soapBinding = (SOAPBinding) binding; soapBinding.setMTOMEnabled(wsTransactionConfiguration.isMtom()); }
/** * @return <code>true</code> if MTOM enabled. */ @ManagedAttribute(description = "Mtom Enabled") public boolean isMtom() { return getComponent().getWsTransactionConfiguration().isMtom(); }
public void testEndpointAttributes() throws Exception { MBeanServer mbeanServer = getMBeanServer(); Set<ObjectName> s = CastUtils.cast(mbeanServer.queryNames(new ObjectName( "org.apache.camel:*,type=endpoints,name=\"some-ws-iti://data*\""), null)); ObjectName on = (ObjectName) s.toArray()[0]; assertEquals(SomeItiComponent.WS_CONFIG.isAddressing(), ((Boolean) mbeanServer.getAttribute(on, "Addressing")).booleanValue()); assertEquals(SomeItiComponent.WS_CONFIG.isMtom(), ((Boolean) mbeanServer.getAttribute(on, "Mtom")).booleanValue()); assertEquals(SomeItiComponent.WS_CONFIG.isSwaOutSupport(), ((Boolean) mbeanServer.getAttribute(on, "SwaOutSupport")).booleanValue()); }
private void configureService(ServerFactoryBean svrFactory, Object service) { svrFactory.setServiceClass(wsTransactionConfiguration.getSei()); svrFactory.setServiceName(wsTransactionConfiguration.getServiceName()); svrFactory.setWsdlLocation(wsTransactionConfiguration.getWsdlLocation()); svrFactory.setAddress(serviceAddress); svrFactory.setServiceBean(service); svrFactory.getFeatures().add(new WSAddressingFeature()); if (wsTransactionConfiguration.isMtom()) { svrFactory.setProperties(Collections.singletonMap("mtom-enabled", "true")); } }