use of javax.xml.ws.soap.SOAPBinding in project cxf by apache.
the class JaxWsServiceFactoryBeanTest method testMtomFeature.
@Test
public void testMtomFeature() throws Exception {
JaxWsServiceFactoryBean bean = new JaxWsServiceFactoryBean();
bean.setBus(getBus());
bean.setServiceClass(GreeterImpl.class);
bean.setWsdlURL(getClass().getResource("/wsdl/hello_world.wsdl"));
bean.setWsFeatures(Arrays.asList(new WebServiceFeature[] { new MTOMFeature() }));
Service service = bean.create();
Endpoint endpoint = service.getEndpoints().values().iterator().next();
assertTrue(endpoint instanceof JaxWsEndpointImpl);
Binding binding = ((JaxWsEndpointImpl) endpoint).getJaxwsBinding();
assertTrue(binding instanceof SOAPBinding);
assertTrue(((SOAPBinding) binding).isMTOMEnabled());
}
use of javax.xml.ws.soap.SOAPBinding in project cxf by apache.
the class MTOMBindingTypeTest method testEcho.
@Test
@org.junit.Ignore
public void testEcho() throws Exception {
byte[] bytes = ImageHelper.getImageBytes(getImage("/java.jpg"), "image/jpeg");
Holder<byte[]> image = new Holder<>(bytes);
Hello port = getPort();
SOAPBinding binding = (SOAPBinding) ((BindingProvider) port).getBinding();
binding.setMTOMEnabled(true);
port.echoData(image);
assertNotNull(image);
}
use of javax.xml.ws.soap.SOAPBinding in project cxf by apache.
the class ClientMtomXopWithJMSTest method createPort.
private static <T> T createPort(QName serviceName, QName portName, Class<T> serviceEndpointInterface, boolean enableMTOM) throws Exception {
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setBus(bus);
factory.setServiceName(serviceName);
factory.setServiceClass(serviceEndpointInterface);
factory.setWsdlURL(ClientMtomXopTest.class.getResource("/wsdl/mtom_xop.wsdl").toExternalForm());
factory.setFeatures(Collections.singletonList(cff));
factory.getInInterceptors().add(new TestMultipartMessageInterceptor());
factory.getOutInterceptors().add(new TestAttachmentOutInterceptor());
@SuppressWarnings("unchecked") T proxy = (T) factory.create();
BindingProvider bp = (BindingProvider) proxy;
SOAPBinding binding = (SOAPBinding) bp.getBinding();
binding.setMTOMEnabled(true);
return proxy;
}
use of javax.xml.ws.soap.SOAPBinding in project cxf by apache.
the class CXFServletTest method testGetBinding.
@Test
public void testGetBinding() throws Exception {
Endpoint ep = Endpoint.create("http://schemas.xmlsoap.org/wsdl/soap/http", new HelloImpl());
assertTrue(ep.getBinding() instanceof SOAPBinding);
}
use of javax.xml.ws.soap.SOAPBinding in project cxf by apache.
the class JMSTestMtom method startServers.
@BeforeClass
public static void startServers() throws Exception {
broker = new EmbeddedJMSBrokerLauncher();
broker.startInProcess();
bus = BusFactory.getDefaultBus();
broker.updateWsdl(bus, "testutils/jms_test_mtom.wsdl");
Object mtom = new JMSMTOMImpl();
EndpointImpl ep = (EndpointImpl) Endpoint.publish("jms:jndi:dynamicQueues/test.cxf.jmstransport.queue&receiveTimeout=10000", mtom);
Binding binding = ep.getBinding();
((SOAPBinding) binding).setMTOMEnabled(true);
}
Aggregations