Package javax.xml.ws.soap

Examples of javax.xml.ws.soap.SOAPBinding


        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);
View Full Code Here


    @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());
    }
View Full Code Here

        serviceFactory.setServiceClass(serviceEndpointInterface);
        serviceFactory.setWsdlURL(ClientMtomXopTest.class.getResource("/wsdl/mtom_xop.wsdl"));
        Service service = serviceFactory.create();
        EndpointInfo ei = service.getEndpointInfo(portName);
        JaxWsEndpointImpl jaxwsEndpoint = new JaxWsEndpointImpl(bus, service, ei);
        SOAPBinding jaxWsSoapBinding = new SOAPBindingImpl(ei.getBinding(), jaxwsEndpoint);
        jaxWsSoapBinding.setMTOMEnabled(enableMTOM);

        if (installInterceptors) {
            //jaxwsEndpoint.getBinding().getInInterceptors().add(new TestMultipartMessageInterceptor());
            jaxwsEndpoint.getBinding().getOutInterceptors().add(new TestAttachmentOutInterceptor());
        }
View Full Code Here

        serviceFactory.setServiceClass(serviceEndpointInterface);
        serviceFactory.setWsdlURL(ClientMtomXopTest.class.getResource("/wsdl/mtom_xop.wsdl"));
        Service service = serviceFactory.create();
        EndpointInfo ei = service.getEndpointInfo(portName);
        JaxWsEndpointImpl jaxwsEndpoint = new JaxWsEndpointImpl(bus, service, ei);
        SOAPBinding jaxWsSoapBinding = new SOAPBindingImpl(ei.getBinding(), jaxwsEndpoint);
        jaxWsSoapBinding.setMTOMEnabled(enableMTOM);
       
        jaxwsEndpoint.getBinding().getInInterceptors().add(new TestMultipartMessageInterceptor());
        jaxwsEndpoint.getBinding().getOutInterceptors().add(new TestAttachmentOutInterceptor());
       
        Client client = new ClientImpl(bus, jaxwsEndpoint);
View Full Code Here

        Service service = Service.create(wsdlURL, serviceName);
        mtomEndpoint = service.getPort(MTOMEndpoint.class);

        // enable MTOM
        SOAPBinding binding = (SOAPBinding)((BindingProvider)mtomEndpoint).getBinding();
        binding.setMTOMEnabled(true);

        List<Handler> handlerChain = new ArrayList<Handler>();
        handlerChain.addAll(binding.getHandlerChain());
        handlerChain.add(new MTOMProtocolHandler());
        binding.setHandlerChain(handlerChain);
        return mtomEndpoint;
    }
View Full Code Here

        Service service = Service.create(wsdlURL, serviceName);
        mtomEndpoint = service.getPort(MTOMEndpoint.class);

        // enable MTOM
        SOAPBinding binding = (SOAPBinding)((BindingProvider)mtomEndpoint).getBinding();
        binding.setMTOMEnabled(true);

        if (JBossDeployerUtil.getWSImpl().equals(JBossDeployerUtil.WSIMPL_NATIVE))
        {
            // Set protocol handler only for native client
            List<Handler> handlerChain = new ArrayList<Handler>();
            handlerChain.addAll(binding.getHandlerChain());
            handlerChain.add(new MTOMProtocolHandler());
            binding.setHandlerChain(handlerChain);
        }
        return mtomEndpoint;
    }
View Full Code Here

        URL wsdlURL = new URL("http://localhost:8080/contract/contract.jsp?serviceCat=MyServiceCategory&serviceName=MyWsaService&protocol=http");

        Service service = Service.create(wsdlURL, serviceName);
        endpoint = service.getPort(StatefulEndpoint.class);

        SOAPBinding binding = (SOAPBinding)((BindingProvider)endpoint).getBinding();
        List<Handler> handlerChain = new ArrayList<Handler>();

        handlerChain.addAll(binding.getHandlerChain());
        handlerChain.add(new ClientHandler());
        handlerChain.add(new WSAddressingClientHandler());
        binding.setHandlerChain(handlerChain);

        return endpoint;
    }
View Full Code Here

        assertNotNull(service);

        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());
View Full Code Here

    private Endpoint endpoint;

    @Before
    public void setUp() throws Exception {
        endpoint = Endpoint.publish("http://localhost:9092/jaxws-mtom/hello", getImpl());
        SOAPBinding binding = (SOAPBinding)endpoint.getBinding();
        binding.setMTOMEnabled(true);
       
    }
View Full Code Here

        Holder<byte[]> photo = new Holder<byte[]>(MtomTestHelper.REQ_PHOTO_DATA);
        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);
       
        MtomTestHelper.assertEquals(MtomTestHelper.RESP_PHOTO_DATA,  photo.value);     
        Assert.assertNotNull(image.value);
View Full Code Here

TOP

Related Classes of javax.xml.ws.soap.SOAPBinding

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.