Package org.test.mtom

Examples of org.test.mtom.ObjectFactory


       
        //Create a DataHandler with the String DataSource object
        DataHandler dataHandler = new DataHandler(stringDS);
     
        //Store the data handler in ImageDepot bean
      ImageDepot imageDepot = new ObjectFactory().createImageDepot();
      imageDepot.setImageData(dataHandler);
       
        Service svc = Service.create(serviceName);
        svc.addPort(portName, null, endpointUrl);
       
        JAXBContext jbc = JAXBContext.newInstance("org.test.mtom");
       
        Dispatch<Object> dispatch = svc
                .createDispatch(portName, jbc, Service.Mode.PAYLOAD);
       
        //Create a request bean with imagedepot bean as value
        ObjectFactory factory = new ObjectFactory();
        SendImage request = factory.createSendImage();
        request.setInput(imageDepot);

        TestLogger.logger.debug(">> Invoking Dispatch<Object> JAXBProviderService");
       
        SendImageResponse response = (SendImageResponse) dispatch.invoke(request);
View Full Code Here


       
        //Create a DataHandler with the String DataSource object
        DataHandler dataHandler = new DataHandler(imageDS);
     
        //Store the data handler in ImageDepot bean
      ImageDepot imageDepot = new ObjectFactory().createImageDepot();
      imageDepot.setImageData(dataHandler);
       
        Service svc = Service.create(serviceName);
        svc.addPort(portName, null, endpointUrl);
       
        JAXBContext jbc = JAXBContext.newInstance("org.test.mtom");
       
        Dispatch<Object> dispatch = svc
                .createDispatch(portName, jbc, Service.Mode.PAYLOAD);
       
        // Enable attachment optimization
        SOAPBinding binding = (SOAPBinding) dispatch.getBinding();
        binding.setMTOMEnabled(true);
       
        //Create a request bean with imagedepot bean as value
        ObjectFactory factory = new ObjectFactory();
        SendImage request = factory.createSendImage();
        request.setInput(imageDepot);

        TestLogger.logger.debug(">> Invoking Dispatch<Object> JAXBProviderService");
       
        SendImageResponse response = (SendImageResponse) dispatch.invoke(request);
View Full Code Here

       
        //Create a DataHandler with the String DataSource object
        DataHandler dataHandler = new DataHandler(imageDS);
       
        //Store the data handler in ImageDepot bean
        ImageDepot imageDepot = new ObjectFactory().createImageDepot();
        imageDepot.setImageData(dataHandler);
       
        Service svc = Service.create(PROVIDER_SERVICE_NAME);
        svc.addPort(portName, null, PROVIDER_ENDPOINT_URL);
       
        JAXBContext jbc = JAXBContext.newInstance("org.test.mtom");
       
       
        Dispatch<Object> dispatch = svc
                .createDispatch(portName, jbc, Service.Mode.PAYLOAD);
       
        // Enable attachment optimization
        SOAPBinding binding = (SOAPBinding) dispatch.getBinding();
        binding.setMTOMEnabled(true);
       
        //Create a request bean with imagedepot bean as value
        ObjectFactory factory = new ObjectFactory();
        SendImage request = factory.createSendImage();
        request.setInput(imageDepot);
       
        // The provider service returns the same image back if successful
        SendImage response = (SendImage) dispatch.invoke(request);
View Full Code Here

       
        //Create a DataHandler with the String DataSource object
        DataHandler dataHandler = new DataHandler(imageDS);
       
        //Store the data handler in ImageDepot bean
        ImageDepot imageDepot = new ObjectFactory().createImageDepot();
        imageDepot.setImageData(dataHandler);
       
        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
        ObjectFactory factory = new ObjectFactory();
        SendImage request = factory.createSendImage();
        request.setInput(imageDepot);
       
        // The provider service returns the same image back if successful
        SendImage response = (SendImage) dispatch.invoke(request);
View Full Code Here

       
        //Create a DataHandler with the String DataSource object
        DataHandler dataHandler = new DataHandler(imageDS);
       
        //Store the data handler in ImageDepot bean
        ImageDepot imageDepot = new ObjectFactory().createImageDepot();
        imageDepot.setImageData(dataHandler);
       
        Service svc = Service.create(PROVIDER_SERVICE_NAME);
        svc.addPort(portName, null, PROVIDER_ENDPOINT_URL);
       
        JAXBContext jbc = JAXBContext.newInstance("org.test.mtom");
       
        // Make sure MTOMFeature with a small threshhold (1) works correctly
        // by sending an optimized MTOM message.
        MTOMFeature mtom = new MTOMFeature(1);
       
        Dispatch<Object> dispatch = svc
                .createDispatch(portName, jbc, Service.Mode.PAYLOAD, mtom);
       
        //Create a request bean with imagedepot bean as value
        ObjectFactory factory = new ObjectFactory();
        SendImage request = factory.createSendImage();
        request.setInput(imageDepot);
       
        // The provider service returns the same image back if successful
        SendImage response = (SendImage) dispatch.invoke(request);
View Full Code Here

       
        //Create a DataHandler with the String DataSource object
        DataHandler dataHandler = new DataHandler(imageDS);
                       
        //Store the data handler in ImageDepot bean
        ImageDepot imageDepot = new ObjectFactory().createImageDepot();
        imageDepot.setImageData(dataHandler);
       
        //JAXBContext jbc = JAXBContext.newInstance("org.test.mtom");
        JAXBBlockContext context = new JAXBBlockContext(SendImage.class.getPackage().getName());
       
        //Create a request bean with imagedepot bean as value
        ObjectFactory factory = new ObjectFactory();
        SendImage request = factory.createSendImage();
        request.setInput(imageDepot);
       
        BlockFactory blkFactory = (JAXBBlockFactory) FactoryRegistry.getFactory(JAXBBlockFactory.class);
        Block block = blkFactory.createFrom(request, context, null);
       
View Full Code Here

    public ImageDepot sendImage(ImageDepot input) {
        TestLogger.logger.debug("MtomSampleMTOMEnableService [new sendImage request received]");
        DataHandler data = input.getImageData();

        TestLogger.logger.debug("[contentType] " + data.getContentType());
        ImageDepot output = (new ObjectFactory()).createImageDepot();
        Image image = null;
       
        resetAttachmentUnmarshallingMonitor();
        try {
            InputStream stream = (InputStream) data.getContent();
View Full Code Here

       
        //Create a DataHandler with the String DataSource object
        DataHandler dataHandler = new DataHandler(imageDS);
       
        //Store the data handler in ImageDepot bean
        ImageDepot imageDepot = new ObjectFactory().createImageDepot();
        imageDepot.setImageData(dataHandler);
       
        SendImage request = new ObjectFactory().createSendImage();
        request.setInput(imageDepot);
       
        //Create the necessary JAXBContext
        JAXBContext jbc = JAXBContext.newInstance("org.test.mtom");
       
View Full Code Here

       
        //Create a DataHandler with the String DataSource object
        DataHandler dataHandler = new DataHandler(imageDS);
       
        //Store the data handler in ImageDepot bean
        ImageDepot imageDepot = new ObjectFactory().createImageDepot();
        imageDepot.setImageData(dataHandler);
       
        SendImage request = new ObjectFactory().createSendImage();
        request.setInput(imageDepot);
       
        //Create the necessary JAXBContext
        JAXBContext jbc = JAXBContext.newInstance("org.test.mtom");
       
View Full Code Here

       
        //Create a DataHandler with the String DataSource object
        DataHandler dataHandler = new DataHandler(imageDS);
       
        //Store the data handler in ImageDepot bean
        ImageDepot imageDepot = new ObjectFactory().createImageDepot();
        imageDepot.setImageData(dataHandler);
       
        SendImage request = new ObjectFactory().createSendImage();
        request.setInput(imageDepot);
       
        //Create the necessary JAXBContext
        JAXBContext jbc = JAXBContext.newInstance("org.test.mtom");
       
View Full Code Here

TOP

Related Classes of org.test.mtom.ObjectFactory

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.