Search in sources :

Example 1 with SOAPBinding

use of javax.xml.ws.soap.SOAPBinding in project nhin-d by DirectProject.

the class DocumentRepositoryProxy method initProxy.

private void initProxy() {
    try {
        URL url = DocumentRepositoryProxy.class.getClassLoader().getResource("XDS.b_DocumentRepositoryWSDLSynchMTOM.wsdl");
        QName qname = new QName("urn:ihe:iti:xds-b:2007", "DocumentRepository_Service");
        DocumentRepositoryService service = new DocumentRepositoryService(url, qname);
        if (handlerResolver != null)
            service.setHandlerResolver(handlerResolver);
        proxy = service.getDocumentRepositoryPortSoap12(new MTOMFeature(true, 1));
        BindingProvider bp = (BindingProvider) proxy;
        SOAPBinding binding = (SOAPBinding) bp.getBinding();
        binding.setMTOMEnabled(true);
        bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpoint);
    } catch (Exception e) {
        LOGGER.error("Error initializing proxy.", e);
    }
}
Also used : QName(javax.xml.namespace.QName) MTOMFeature(javax.xml.ws.soap.MTOMFeature) SOAPBinding(javax.xml.ws.soap.SOAPBinding) BindingProvider(javax.xml.ws.BindingProvider) DocumentRepositoryService(ihe.iti.xds_b._2007.DocumentRepositoryService) URL(java.net.URL) OperationNotSupportedException(javax.naming.OperationNotSupportedException)

Example 2 with SOAPBinding

use of javax.xml.ws.soap.SOAPBinding in project camel by apache.

the class CxfMtomRouterPayloadModeTest method setUp.

@Before
public void setUp() throws Exception {
    endpoint = Endpoint.publish("http://localhost:" + port2 + "/" + getClass().getSimpleName() + "/jaxws-mtom/hello", getImpl());
    SOAPBinding binding = (SOAPBinding) endpoint.getBinding();
    binding.setMTOMEnabled(true);
}
Also used : SOAPBinding(javax.xml.ws.soap.SOAPBinding) Before(org.junit.Before)

Example 3 with SOAPBinding

use of javax.xml.ws.soap.SOAPBinding in project camel by apache.

the class CxfMtomConsumerTest method testInvokingService.

@Test
public void testInvokingService() throws Exception {
    if (MtomTestHelper.isAwtHeadless(null, log)) {
        return;
    }
    Holder<byte[]> photo = new Holder<byte[]>("RequestFromCXF".getBytes("UTF-8"));
    Holder<Image> image = new Holder<Image>(getImage("/java.jpg"));
    Hello port = getPort();
    SOAPBinding binding = (SOAPBinding) ((BindingProvider) port).getBinding();
    binding.setMTOMEnabled(true);
    port.detail(photo, image);
    assertEquals("ResponseFromCamel", new String(photo.value, "UTF-8"));
    assertNotNull(image.value);
}
Also used : Hello(org.apache.camel.cxf.mtom_feature.Hello) Holder(javax.xml.ws.Holder) SOAPBinding(javax.xml.ws.soap.SOAPBinding) Image(java.awt.Image) Test(org.junit.Test)

Example 4 with SOAPBinding

use of javax.xml.ws.soap.SOAPBinding in project camel by apache.

the class CxfMtomProducerPayloadModeTest method setUp.

@Before
public void setUp() throws Exception {
    endpoint = Endpoint.publish("http://localhost:" + port + "/" + getClass().getSimpleName() + "/jaxws-mtom/hello", getServiceImpl());
    SOAPBinding binding = (SOAPBinding) endpoint.getBinding();
    binding.setMTOMEnabled(isMtomEnabled());
}
Also used : SOAPBinding(javax.xml.ws.soap.SOAPBinding) Before(org.junit.Before)

Example 5 with SOAPBinding

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);
}
Also used : Endpoint(javax.xml.ws.Endpoint) SOAPBinding(javax.xml.ws.soap.SOAPBinding) Test(org.junit.Test)

Aggregations

SOAPBinding (javax.xml.ws.soap.SOAPBinding)49 Test (org.junit.Test)20 URL (java.net.URL)19 BindingProvider (javax.xml.ws.BindingProvider)19 QName (javax.xml.namespace.QName)18 Service (javax.xml.ws.Service)14 DataHandler (javax.activation.DataHandler)13 WebServiceException (javax.xml.ws.WebServiceException)7 RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)7 JBossWSTest (org.jboss.wsf.test.JBossWSTest)7 ArrayList (java.util.ArrayList)6 Holder (javax.xml.ws.Holder)6 Image (java.awt.Image)5 IOException (java.io.IOException)5 Binding (javax.xml.ws.Binding)5 File (java.io.File)4 Before (org.junit.Before)4 FileDataSource (javax.activation.FileDataSource)3 Handler (javax.xml.ws.handler.Handler)3 MTOMFeature (javax.xml.ws.soap.MTOMFeature)3