Examples of ObjectFactory


Examples of org.apache.axis2.jaxws.sample.mtom1.ObjectFactory

       
        SOAPBinding binding = (SOAPBinding)dispatch.getBinding();
        binding.setMTOMEnabled(true);
       
        Image image = ImageIO.read (new File(imageResourceDir+File.separator+"test.jpg"));
        ImageDepot imageDepot = new ObjectFactory().createImageDepot();
        imageDepot.setImageData(image);
        setText(imageDepot);
       
        //Create a request bean with imagedepot bean as value
        ObjectFactory factory = new ObjectFactory();
        Invoke request = factory.createInvoke();
        request.setInput(imageDepot);
       
        SendImageResponse response = (SendImageResponse) dispatch.invoke(request);
       
        assertNotNull(response);
View Full Code Here

Examples of org.apache.axis2.jaxws.sample.mtomfeature.ObjectFactory

            JAXBContext jbc = JAXBContext.newInstance("org.apache.axis2.jaxws.sample.mtomfeature");
            // Create the JAX-WS client needed to send the request
            Service service = Service.create(serviceName);
            service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING, axisEndpoint);
            Dispatch<Object> dispatch = service.createDispatch(portName, jbc, Mode.PAYLOAD, mtomFeature);
            ObjectFactory of = new ObjectFactory();
            SendPDFFile pdf = of.createSendPDFFile();
            //Fetch attachment file
            File pdfFile = new File(resourceDir+File.separator+"JAX-WS.pdf");
            FileDataSource fds = new FileDataSource(pdfFile);
            DataHandler pdfHandler = new DataHandler(fds);
            pdf.setArg0(pdfHandler);
            BindingProvider bp = (BindingProvider)dispatch;
            Binding b =(Binding) bp.getBinding();
           
            WebServiceFeature wsFeature = b.getFeature(MTOMFeature.ID);
            assertNotNull(wsFeature);
            assertTrue("Expecting WSFeature to be enabled, but found disabled.", wsFeature.isEnabled());
            assertTrue("Expecting WSFeature to be instance of MTOMFeature, but found WSFeature is not a MTOMFeature",wsFeature instanceof MTOMFeature);
            assertTrue("Expecting Threshold value to be 1, but found"+ ((MTOMFeature)wsFeature).getThreshold(),((MTOMFeature)wsFeature).getThreshold()==1);
           
            JAXBElement<SendPDFFileResponse> response = (JAXBElement<SendPDFFileResponse>)dispatch.invoke(of.createSendPDFFile(pdf));
            assertNotNull(response);
            SendPDFFileResponse responsePdf = response.getValue();
            assertNotNull(responsePdf);
            DataHandler dh = responsePdf.getReturn();
            assertNotNull(dh);
View Full Code Here

Examples of org.apache.axis2.jaxws.samples.mtom.ObjectFactory

        System.out.println(">>MTOM Dispatch Test");

        init();

        // Set the data inside of the appropriate object
        ImageDepot imageDepot = new ObjectFactory().createImageDepot();
        imageDepot.setImageData(content);

        if (soap12) {
            svc = Service.create(serviceName12);
            svc.addPort(portNameDispatch, SOAPBinding.SOAP12HTTP_BINDING, uriString + urlSuffix);
        } else {
            svc = Service.create(serviceName11);
            svc.addPort(portNameDispatch, SOAPBinding.SOAP11HTTP_BINDING, uriString + urlSuffix);
        }

        // Setup the necessary JAX-WS artifacts
        JAXBContext jbc = JAXBContext
                .newInstance("org.apache.axis2.jaxws.samples.mtom");
        Dispatch<Object> dispatch = svc.createDispatch(portNameDispatch, jbc,
                Service.Mode.PAYLOAD);
        BindingProvider bp = (BindingProvider) dispatch;
        bp.getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY,
                Boolean.TRUE);
        bp.getRequestContext().put(BindingProvider.SOAPACTION_URI_PROPERTY,
                "sendImage");

        // Set the actual flag to enable MTOM
        SOAPBinding binding = (SOAPBinding) dispatch.getBinding();
        binding.setMTOMEnabled(true);

        // Create the request wrapper bean
        ObjectFactory factory = new ObjectFactory();
        SendImage request = factory.createSendImage();
        request.setInput(imageDepot);

        if (null != result) {
            result = result.concat("Invoking Dispatch<Object> with a binary payload\n");
        } else {
View Full Code Here

Examples of org.apache.axis2.jaxws.samples.ping.ObjectFactory

            bp.getRequestContext().put(BindingProvider.SOAPACTION_URI_PROPERTY,
                    "pingOperation");

            // Build the input object
            PingStringInput pingParm =
                    new ObjectFactory().createPingStringInput();
            pingParm.setPingInput(input);

            // Call the service
            ping.pingOperation(pingParm);
            System.out.println(">> CLIENT: SEI Ping SUCCESS.");
View Full Code Here

Examples of org.apache.camel.component.salesforce.api.dto.bulk.ObjectFactory

        } catch (JAXBException e) {
            String msg = "Error loading Bulk API DTOs: " + e.getMessage();
            throw new IllegalArgumentException(msg, e);
        }

        this.objectFactory = new ObjectFactory();
    }
View Full Code Here

Examples of org.apache.camel.cxf.multipart.types.ObjectFactory

        Service service = Service.create(SERVICE_NAME);
        service.addPort(ROUTE_PORT_NAME, "http://schemas.xmlsoap.org/soap/", address);
        MultiPartInvoke multiPartClient = service.getPort(ROUTE_PORT_NAME, MultiPartInvoke.class);

        InE e0 = new ObjectFactory().createInE();
        InE e1 = new ObjectFactory().createInE();
        e0.setV(in0);
        e1.setV(in1);
       
        javax.xml.ws.Holder<InE> h = new javax.xml.ws.Holder<InE>();
        javax.xml.ws.Holder<InE> h1 = new javax.xml.ws.Holder<InE>();
View Full Code Here

Examples of org.apache.chemistry.opencmis.client.api.ObjectFactory

        if (context == null) {
            throw new IllegalArgumentException("Operation context must be set!");
        }

        final NavigationService navigationService = getBinding().getNavigationService();
        final ObjectFactory objectFactory = getObjectFactory();
        final OperationContext ctxt = new OperationContextImpl(context);

        return new CollectionIterable<Document>(new AbstractPageFetcher<Document>(ctxt.getMaxItemsPerPage()) {

            @Override
            protected AbstractPageFetcher.Page<Document> fetchPage(long skipCount) {

                // get all checked out documents
                ObjectList checkedOutDocs = navigationService.getCheckedOutDocs(getRepositoryId(), null,
                        ctxt.getFilterString(), ctxt.getOrderBy(), ctxt.isIncludeAllowableActions(),
                        ctxt.getIncludeRelationships(), ctxt.getRenditionFilterString(),
                        BigInteger.valueOf(this.maxNumItems), BigInteger.valueOf(skipCount), null);

                // convert objects
                List<Document> page = new ArrayList<Document>();
                if (checkedOutDocs.getObjects() != null) {
                    for (ObjectData objectData : checkedOutDocs.getObjects()) {
                        CmisObject doc = objectFactory.convertObject(objectData, ctxt);
                        if (!(doc instanceof Document)) {
                            // should not happen...
                            continue;
                        }
View Full Code Here

Examples of org.apache.cxf.configuration.security.ObjectFactory

        sslClientPolicy.setKeystorePassword("defaultkeypass");
        sslClientPolicy.setTrustStoreType("JKS");
        sslClientPolicy.setSecureSocketProtocol("TLSv1");

        // reverse default sense of include/exlcude
        FiltersType filters = new ObjectFactory().createFiltersType();
        for (int i = 0; i < NON_EXPORT_CIPHERS.length; i++) {
            filters.getInclude().add(NON_EXPORT_CIPHERS[i]);
        }
        for (int i = 0; i < EXPORT_CIPHERS.length; i++) {
            filters.getExclude().add(EXPORT_CIPHERS[i]);
View Full Code Here

Examples of org.apache.cxf.factory_pattern.ObjectFactory

       
        return id;
    }

    private IsEvenResponse genResponse(boolean v) {
        IsEvenResponse resp = new ObjectFactory().createIsEvenResponse();
        resp.setEven(v);
        return resp;
    }
View Full Code Here

Examples of org.apache.cxf.jaxb_misc.ObjectFactory

        }
    }
    @Test
    public void testDefaultValueConverter() throws Exception {
        Base64WithDefaultValueType testData = (new ObjectFactory()).createBase64WithDefaultValueType();
        byte[] checkValue = testData.getAttributeWithDefaultValue();
        assertNotNull(checkValue);
    }
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.