Package sample.mtom.service.MTOMSampleMTOMSampleSOAP11Port_httpStub

Examples of sample.mtom.service.MTOMSampleMTOMSampleSOAP11Port_httpStub.AttachmentType


     * Constants.Configuration.FILE_SIZE_THRESHOLD, "4000");
     */

    // Populating the code generated beans
    AttachmentRequest attachmentRequest = new AttachmentRequest();
    AttachmentType attachmentType = new AttachmentType();
    Base64Binary base64Binary = new Base64Binary();

    // Creating a javax.activation.FileDataSource from the input file.
    FileDataSource fileDataSource = new FileDataSource(file);

    // Create a dataHandler using the fileDataSource. Any implementation of
    // javax.activation.DataSource interface can fit here.
    DataHandler dataHandler = new DataHandler(fileDataSource);
    base64Binary.setBase64Binary(dataHandler);
    base64Binary.setContentType(dataHandler.getContentType());
    attachmentType.setBinaryData(base64Binary);
    attachmentType.setFileName(destination);
    attachmentRequest.setAttachmentRequest(attachmentType);

    AttachmentResponse response = serviceStub.attachment(attachmentRequest);
    System.out.println(response.getAttachmentResponse());
  }
View Full Code Here

TOP

Related Classes of sample.mtom.service.MTOMSampleMTOMSampleSOAP11Port_httpStub.AttachmentType

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.