Package javax.xml.ws.soap

Examples of javax.xml.ws.soap.MTOMFeature


    public void testMTOMFeatureAndBindingOverride() {
        Service svc = Service.create(new QName("http://test", "TestService"));
        svc.addPort(new QName("http://test", "TestPort"), SOAPBinding.SOAP11HTTP_MTOM_BINDING, "http://localhost");
       
        // Use the default feature config
        MTOMFeature feature = new MTOMFeature(false);
       
        Dispatch<Source> d = svc.createDispatch(new QName("http://test", "TestPort"),
            Source.class, Service.Mode.PAYLOAD, feature);
       
        d.invoke(null);
View Full Code Here


        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

    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

    }
   
    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

    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

        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

        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

        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

    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

        Service svc = Service.create(PROVIDER_SERVICE_NAME);
        svc.addPort(portName, null, PROVIDER_ENDPOINT_URL);
       
        JAXBContext jbc = JAXBContext.newInstance("org.test.mtom");
       
        MTOMFeature mtom = new MTOMFeature();
       
        Dispatch<Object> dispatch = svc
                .createDispatch(portName, jbc, Service.Mode.PAYLOAD, mtom);
       
        //Create a request bean with imagedepot bean as value
View Full Code Here

TOP

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

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.