Java 8 SOAPBinding - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 SOAPBinding class.

This code example shows how to use the following methods:getMessageFactory, getSOAPFactory
This code example shows how to use the following methods:setMTOMEnabled
    @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);
         
    } 
     
    @After 
    public void tearDown() throws Exception {
        if (endpoint != null) {
            endpoint.stop();
        } 
    } 
 
    @Test
    public void testInvokingServiceFromCXFClient() throws Exception {        
        if (MtomTestHelper.isAwtHeadless(logger, null)) { 
            return; 
5
CodeRank
This code example shows how to use the following methods:setMTOMEnabled
 
    @Before 
    public void setUp() throws Exception {
        endpoint = Endpoint.publish("http://localhost:" + port + "/CxfMtomPOJOProducerTest/jaxws-mtom/hello", getImpl());
        SOAPBinding binding = (SOAPBinding)endpoint.getBinding();
        binding.setMTOMEnabled(true);
         
    } 
     
    @After 
    public void tearDown() throws Exception {
        if (endpoint != null) {
            endpoint.stop();
        } 
    } 
     
    @SuppressWarnings("unchecked") 
    @Test
    public void testInvokingServiceFromCxfProducer() throws Exception {
        if (MtomTestHelper.isAwtHeadless(logger, null)) { 
5
CodeRank
This code example shows how to use the following methods:setMTOMEnabled
	 * @see <a href="http://www.w3.org/TR/soap12-mtom/">MTOM Specification</a> 
	 * @param docusignAPIProxy 
	 */ 
	protected void enableMTOM(APIServiceSoap docusignAPIProxy) {
		SOAPBinding soapBinding = (SOAPBinding) ((BindingProvider) docusignAPIProxy).getBinding();
    	soapBinding.setMTOMEnabled(true);
	} 
} 
4
CodeRank
This code example shows how to use the following methods:setMTOMEnabled
        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);
 
        String expected = "<xop:Include ";
        assertTrue(output.toString().indexOf(expected) != -1);
        assertTrue(input.toString().indexOf(expected) != -1);
 
        assertEquals("CXF", new String(photo.value));
        assertNotNull(image.value);
    } 
     
    @Test
    @org.junit.Ignore 
4
CodeRank
This code example shows how to use the following methods:setMTOMEnabled
        ep.getInInterceptors().add(new TestMultipartMessageInterceptor());
        ep.getOutInterceptors().add(new TestAttachmentOutInterceptor());
        //ep.getInInterceptors().add(new LoggingInInterceptor()); 
        //ep.getOutInterceptors().add(new LoggingOutInterceptor()); 
        SOAPBinding jaxWsSoapBinding = (SOAPBinding)ep.getBinding();
        jaxWsSoapBinding.setMTOMEnabled(true);
        ep.publish();
    } 
 
    @AfterClass 
    public static void stopServers() throws Exception {
        bus.shutdown(false);
    } 
 
    @Test
    public void testMtomXop() throws Exception {
        TestMtom mtomPort = createPort(MTOM_SERVICE, MTOM_PORT, TestMtom.class, true);
        InputStream pre = this.getClass().getResourceAsStream("/wsdl/mtom_xop.wsdl");
        int fileSize = 0;
        for (int i = pre.read(); i != -1; i = pre.read()) {
4
CodeRank
This code example shows how to use the following methods:setMTOMEnabled
 
        AttachmentWs ws = service.getPort(AttachmentWs.class);
 
        // retrieve the SOAPBinding 
        SOAPBinding binding = (SOAPBinding) ((BindingProvider) ws).getBinding();
        binding.setMTOMEnabled(true);
 
        String request = "tsztelak@gmail.com";
 
        // Byte array 
        String response = ws.stringFromBytes(request.getBytes());
        assertEquals(request, response);
 
        // Data Source 
        DataSource source = new ByteArrayDataSource(request.getBytes(), "text/plain; charset=UTF-8");
 
        // not yet supported ! 
        //        response = ws.stringFromDataSource(source); 
        //        assertEquals(request, response); 
 
3
CodeRank
This code example shows how to use the following methods:setMTOMEnabled
        service.addPort(QNAME_PORT, SOAPBinding.SOAP11HTTP_BINDING, URL_ENDPOINT);
        Dispatch<Object> dispatch = service.createDispatch(QNAME_PORT, jbc, Mode.PAYLOAD);
         
        //Enable attachment optimization 
        SOAPBinding binding = (SOAPBinding) dispatch.getBinding();
        binding.setMTOMEnabled(true);
         
        SendImageResponse response = (SendImageResponse) dispatch.invoke(request);
         
        assertNotNull(response);
        assertNotNull(response.getOutput().getImageData());
         
        // Repeat to verify behavior 
        response = (SendImageResponse) dispatch.invoke(request);
         
        assertNotNull(response);
        assertNotNull(response.getOutput().getImageData());
    } 
     
    /* 
3
CodeRank
This code example shows how to use the following methods:setMTOMEnabled
        bp.getRequestContext().put(BindingProvider.SOAPACTION_URI_PROPERTY,
                "sendImage"); 
 
        // Set the actual flag to enable MTOM 
        SOAPBinding binding = (SOAPBinding) dispatch.getBinding();
        binding.setMTOMEnabled(true);
 
        // Create the request wrapper bean 
        ObjectFactory factory = new ObjectFactory();
        SendImage request = factory.createSendImage();
        request.setInput(imageDepot);
 
        if (null != result) {
            result = result.concat("Invoking Dispatch<Object> with a binary payload\n");
        } else { 
            System.out
                    .println(">>MTOM Invoking Dispatch<Object> with a binary payload");
        } 
 
        // Send the image and process the response image 
4
CodeRank
This code example shows how to use the following methods:setMTOMEnabled
      	 
      	JAXBContext jbc = JAXBContext.newInstance("org.apache.axis2.jaxws.sample.mtom1");
      	Dispatch<Object> dispatch = svc.createDispatch(QNAME_PORT, jbc, Service.Mode.PAYLOAD);
      	 
      	SOAPBinding binding = (SOAPBinding)dispatch.getBinding();
      	binding.setMTOMEnabled(true);
      	 
      	Image image = ImageIO.read (new File(imageResourceDir+File.separator+"test.jpg"));
      	ImageDepot imageDepot = new ObjectFactory().createImageDepot();
      	imageDepot.setImageData(image);
        setText(imageDepot);
      	 
      	//Create a request bean with imagedepot bean as value 
      	ObjectFactory factory = new ObjectFactory();
      	Invoke request = factory.createInvoke();
      	request.setInput(imageDepot);
      	 
      	SendImageResponse response = (SendImageResponse) dispatch.invoke(request);
      	 
      	assertNotNull(response);
4
CodeRank
See Code Examples for Java 8 SOAPBinding Methods: