Examples of MTOMFeature


Examples of javax.xml.ws.soap.MTOMFeature

        MTOM mtom = implInfo.getImplementorClass().getAnnotation(MTOM.class);       
        if (mtom == null && serviceClass != null) {
            mtom = serviceClass.getAnnotation(MTOM.class);
        }
        if (mtom != null) {
            features.add(new MTOMFeature(mtom.enabled(), mtom.threshold()));
        } else {
            //deprecated way to set mtom
            BindingType bt = implInfo.getImplementorClass().getAnnotation(BindingType.class);
            if (bt != null
                && (SOAPBinding.SOAP11HTTP_MTOM_BINDING.equals(bt.value())
                || SOAPBinding.SOAP12HTTP_MTOM_BINDING.equals(bt.value()))) {
                features.add(new MTOMFeature(true));               
            }
        }
       

        Addressing addressing = null;
View Full Code Here

Examples of javax.xml.ws.soap.MTOMFeature

    }
   
    final void createJaxwsBinding() {
        if (getBinding() instanceof SoapBinding) {
            jaxwsBinding = new SOAPBindingImpl(getEndpointInfo().getBinding(), this);
            MTOMFeature mtomFeature = getMTOMFeature();
            if (mtomFeature != null && mtomFeature.isEnabled()) {
                ((SOAPBinding)jaxwsBinding).setMTOMEnabled(true);
            }
        } else if (getBinding() instanceof XMLBinding) {
            jaxwsBinding = new HTTPBindingImpl(getEndpointInfo().getBinding(), this);
        } else {
View Full Code Here

Examples of javax.xml.ws.soap.MTOMFeature

        MTOM mtom = implInfo.getImplementorClass().getAnnotation(MTOM.class);
        if (mtom == null && serviceClass != null) {
            mtom = serviceClass.getAnnotation(MTOM.class);
        }
        if (mtom != null) {
            features.add(new MTOMFeature(mtom.enabled(), mtom.threshold()));
        } else {
            //deprecated way to set mtom
            BindingType bt = implInfo.getImplementorClass().getAnnotation(BindingType.class);
            if (bt != null
                && (SOAPBinding.SOAP11HTTP_MTOM_BINDING.equals(bt.value())
                || SOAPBinding.SOAP12HTTP_MTOM_BINDING.equals(bt.value()))) {
                features.add(new MTOMFeature(true));
            }
        }


        Addressing addressing = null;
View Full Code Here

Examples of javax.xml.ws.soap.MTOMFeature

    private void setMTOMFeatures(DataBinding databinding) {
        if (this.wsFeatures != null) {
            for (WebServiceFeature wsf : this.wsFeatures) {
                if (wsf instanceof MTOMFeature) {
                    databinding.setMtomEnabled(true);
                    MTOMFeature f = (MTOMFeature) wsf;
                    if (f.getThreshold() > 0) {
                        databinding.setMtomThreshold(((MTOMFeature)wsf).getThreshold());
                    }
                }
            }
        }
View Full Code Here

Examples of javax.xml.ws.soap.MTOMFeature

            public OutputStream getOutputStream() throws IOException {
                return null;
            }
        };
        EndpointInterface port = (EndpointInterface)service.getPort(EndpointInterface.class,
                                                                    new MTOMFeature(true));
        DataHandler dh = new DataHandler(ds);
        DHResponse response = port.echoDataHandler(new DHRequest(dh));
        assertNotNull(response);
        Object content = response.getDataHandler().getContent();
        assertEquals("Server data", content);
View Full Code Here

Examples of javax.xml.ws.soap.MTOMFeature

        service.addPort(portName,
                        "http://schemas.xmlsoap.org/soap/",
                        "local://Hello");
        port = service.getPort(portName,
                               Hello.class,
                               new MTOMFeature());

       

        ((BindingProvider)port).getRequestContext()
            .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, address);
View Full Code Here

Examples of javax.xml.ws.soap.MTOMFeature

        assertNotNull("WSDL is null", wsdl);

        HelloService service = new HelloService(wsdl, serviceName);
        assertNotNull("Service is null ", service);
        //return service.getHelloPort();
        MTOMFeature mtomFeature = new MTOMFeature();
        if (threshold > 0) {
            mtomFeature = new MTOMFeature(true, threshold);
        }
        Hello hello = service.getHelloPort(mtomFeature);
       
        try {
            updateAddressPort(hello, PORT);
View Full Code Here

Examples of javax.xml.ws.soap.MTOMFeature

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

Examples of javax.xml.ws.soap.MTOMFeature

    /*
     * Test the default configuration of the MTOMFeature.
     */
    public void testDefaultMTOMFeature() {
        // Use the default feature config
        MTOMFeature feature = new MTOMFeature();
       
        Service svc = Service.create(new QName("http://test", "ProxyMTOMService"));
        ProxyMTOMService proxy = svc.getPort(ProxyMTOMService.class, feature);
        assertTrue("Proxy instance was null", proxy != null);
       
View Full Code Here

Examples of javax.xml.ws.soap.MTOMFeature

    /*
     * Test disabling the MTOM feature.
     */
    public void testDisabledMTOMFeature() {
        // Use the default feature config
        MTOMFeature feature = new MTOMFeature(false);
       
        Service svc = Service.create(new QName("http://test", "ProxyMTOMService"));
        ProxyMTOMService proxy = svc.getPort(ProxyMTOMService.class, feature);
        assertTrue("Proxy instance was null", proxy != null);
       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.