* 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());
}