Examples of SendPDFFile


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

            // 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);
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.