Examples of MTOMFeature


Examples of javax.xml.ws.soap.MTOMFeature

        request = TestUtils.createMessage(MessageFormat.format(MSG2, address, UUID.randomUUID(), ADD_REQUEST_ACTION, 5));
        response = dispatch.invoke(request);
        testAddResponse(response, 10, false);
       
        // make a call with Addressing support and MTOM
        dispatch = service.createDispatch(PORT, SOAPMessage.class, Service.Mode.MESSAGE, new MTOMFeature());
        request = TestUtils.createMessage(MessageFormat.format(MSG2, address, UUID.randomUUID(), ADD_REQUEST_ACTION, 10));
        response = dispatch.invoke(request);
        testAddResponse(response, 20, true);
       
        EndpointReference epr = null;
       
        // make a call with Addressing support using EPR
        epr = createEPR();

        service.createDispatch(epr, SOAPMessage.class, Service.Mode.MESSAGE);
        request = TestUtils.createMessage(MessageFormat.format(MSG2, address, UUID.randomUUID(), ADD_REQUEST_ACTION, 15));
        response = dispatch.invoke(request);
        testAddResponse(response, 30, false);
       
        // make a call with Addressing support using EPR and MTOM
        epr = createEPR();

        service.createDispatch(epr, SOAPMessage.class, Service.Mode.MESSAGE, new MTOMFeature());
        request = TestUtils.createMessage(MessageFormat.format(MSG2, address, UUID.randomUUID(), ADD_REQUEST_ACTION, 20));
        response = dispatch.invoke(request);
        testAddResponse(response, 40, true);
    }
View Full Code Here

Examples of javax.xml.ws.soap.MTOMFeature

    }

    private void testEchoBytes(boolean mtomSupport) throws Exception {
        Echo echo = null;
        if (mtomSupport)
            echo = service.getPort(Echo.class, new MTOMFeature());
        else
            echo = service.getPort(Echo.class);

        byte[] expectedBytes = loadImageAsBytes();
        byte[] echoBytes = echo.echoBytes(mtomSupport, expectedBytes);
View Full Code Here

Examples of javax.xml.ws.soap.MTOMFeature

    }

    private void testEchoImage(boolean mtomSupport) throws Exception {
        Echo echo = null;
        if (mtomSupport)
            echo = service.getPort(Echo.class, new MTOMFeature());
        else
            echo = service.getPort(Echo.class);

        BufferedImage expectedImage = loadImage();
        Image echoImage = echo.echoImage(mtomSupport, expectedImage);
View Full Code Here

Examples of javax.xml.ws.soap.MTOMFeature

        this.threshold = threshold;
    }

    @Override
    public WebServiceFeature getWebServiceFeature() {
        return new MTOMFeature(enabled, threshold);
    }
View Full Code Here

Examples of javax.xml.ws.soap.MTOMFeature

        }

        Object portObject;
        try {
            if (service instanceof RepositoryService) {
                portObject = ((RepositoryService) service).getRepositoryServicePort(new MTOMFeature());
            } else if (service instanceof NavigationService) {
                portObject = ((NavigationService) service).getNavigationServicePort(new MTOMFeature());
            } else if (service instanceof ObjectService) {
                int threshold = getSession().get(SessionParameter.WEBSERVICES_MEMORY_THRESHOLD, 4 * 1024 * 1024);
                portObject = ((ObjectService) service).getObjectServicePort(new MTOMFeature(),
                        new StreamingAttachmentFeature(null, true, threshold));
                ((BindingProvider) portObject).getRequestContext().put(
                        JAXWSProperties.HTTP_CLIENT_STREAMING_CHUNK_SIZE, CHUNK_SIZE);
            } else if (service instanceof VersioningService) {
                portObject = ((VersioningService) service).getVersioningServicePort(new MTOMFeature());
            } else if (service instanceof DiscoveryService) {
                portObject = ((DiscoveryService) service).getDiscoveryServicePort(new MTOMFeature());
            } else if (service instanceof MultiFilingService) {
                portObject = ((MultiFilingService) service).getMultiFilingServicePort(new MTOMFeature());
            } else if (service instanceof RelationshipService) {
                portObject = ((RelationshipService) service).getRelationshipServicePort(new MTOMFeature());
            } else if (service instanceof PolicyService) {
                portObject = ((PolicyService) service).getPolicyServicePort(new MTOMFeature());
            } else if (service instanceof ACLService) {
                portObject = ((ACLService) service).getACLServicePort(new MTOMFeature());
            } else {
                throw new CmisRuntimeException("Cannot find Web Services service object!");
            }

            // add SOAP and HTTP authentication headers
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

    }
   
    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

    }
   
    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

    }
   
    final void createJaxwsBinding() {
        if (getBinding() instanceof SoapBinding) {
            jaxwsBinding = new SOAPBindingImpl(getEndpointInfo().getBinding());
            MTOMFeature mtomFeature = getMTOMFeature();
            if (mtomFeature != null && mtomFeature.isEnabled()) {
                ((SOAPBinding)jaxwsBinding).setMTOMEnabled(true);
            }
        } else if (getBinding() instanceof XMLBinding) {
            jaxwsBinding = new HTTPBindingImpl(getEndpointInfo().getBinding());
        } else {
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.