Package javax.xml.ws.soap

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


    }
   
    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

        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

    /*
     * 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

    /*
     * 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

     * not be enabled on the Message, since the attachment size is too small.
     */
    public void testMTOMFeatureThreshold() {
        // Set a threshold that we will not meet.
        int threshold = 20000;
        MTOMFeature feature = new MTOMFeature(threshold);
       
        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

    /*
     * 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", "TestService"));
        svc.addPort(new QName("http://test", "TestPort"), SOAPBinding.SOAP11HTTP_BINDING, "http://localhost");
        Dispatch<Source> d = svc.createDispatch(new QName("http://test", "TestPort"),
            Source.class, Service.Mode.PAYLOAD, feature);
View Full Code Here

    public void testDisabledMTOMFeature() {
        Service svc = Service.create(new QName("http://test", "TestService"));
        svc.addPort(new QName("http://test", "TestPort"), SOAPBinding.SOAP11HTTP_BINDING, "http://localhost");
       
        // Set the feature to be disabled.
        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

        Service svc = Service.create(new QName("http://test", "TestService"));
        svc.addPort(new QName("http://test", "TestPort"), SOAPBinding.SOAP11HTTP_BINDING, "http://localhost");
       
        // Set the feature to be disabled.
        int threshold = 20000;
        MTOMFeature feature = new MTOMFeature(threshold);
               
        Dispatch<Source> d = svc.createDispatch(new QName("http://test", "TestPort"),
            Source.class, Service.Mode.PAYLOAD, feature);
       
        d.invoke(null);
View Full Code Here

    public void testMTOMFeatureAndBinding() {
        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();
       
        Dispatch<Source> d = svc.createDispatch(new QName("http://test", "TestPort"),
            Source.class, Service.Mode.PAYLOAD, feature);
       
        d.invoke(null);
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.