Retrieving task attachment
I have an application that is downloading email and attachments. One email has an attachment of content-type "task" ItemReference=1. So I retrieve this by using getItemRequest instead of getAttachmentRequest. The result of this is another .xml file. This has various task properties such as due date, start date, which is good. However there is also "hasAttachment=1" and a size of 1480757. I was expecting that this .xml file would have further attachment data giving me the id of the task's attachment so I could download it, but nothing is there. Is there a way that I can retrieve the attachment that seems to be part of this task?
Re: Retrieving task attachment
Sorry, I'm away from the office for a few days. I'm not sure how much information I can put in a reply. You have to recursively go through the emails. getting the embedded item by using getItemRequest, then reading the attachment data by streaming the attachment data or using getAttachAttachmentRequest (if the attachment data is small).
I did a quick hack. I created a simple message "one", with one attachment "config.txt". I embedded it in a second message "two". I create a simple java program to extract the data from the message:
private void testEmbeddedItem()
Mail item = (Mail) tvItems.getSelectionModel().getSelectedItem();
GetItemRequest request = new GetItemRequest();
request.setView("default message attachments");
response = port.getItemRequest(request);
if (response.getStatus().getCode() != 0 ||
response.getItem() == null)
item = (Mail)response.getItem();
AttachmentItemInfo info = item.getAttachments().getAttachment().get(0);
GetItemRequest emdItemReq = new GetItemRequest();
emdItemReq.setView(("default message attachments"));
emdItemResp = port.getItemRequest(emdItemReq);
GetAttachmentRequest getRequest = new GetAttachmentRequest();
item = (Mail)emdItemResp.getItem();
info = item.getAttachments().getAttachment().get(0);
getResponse = port.getAttachmentRequestMessage(getRequest);
Please note, this is not the recommended way to do things. I could also provide a truncated soap trace of the output of the execution. Let me know if you still have questions of problems.