none
EWS 2.2 - The attachment could not be opened RRS feed

  • Question

  • Hi All

    I'm connecting to the Exchange Server 2010 SP2 from my C# application with EWS version 2.2 to download a big image attachment in my calendar item. The image size is 5,976,794 bytes as reported by fileAtt.Size property. The application throws exception:

    Microsoft.Exchange.WebServices.Data.ServiceResponseException: The attachment could not be opened.

    at

    Microsoft.Exchange.WebServices.Data.ServiceResponse.InternalThrowIfNecessary()

    at

    Microsoft.Exchange.WebServices.Data.ServiceResponse.ThrowIfNecessary()

    at

    Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()

    at

    Microsoft.Exchange.WebServices.Data.ExchangeService.InternalGetAttachments(IEnumerable`1 attachments, Nullable`1 bodyType,IEnumerable`1 additionalProperties, ServiceErrorHandling errorHandling)

    at

    Microsoft.Exchange.WebServices.Data.ExchangeService.GetAttachment(Attachment attachment,Nullable `1 bodyType, IENumerable`1 additionalProperties)

    at

    Microsoft.Exchange.WebServices.Data.Attachment.InternalLoad(Nullable`1 bodyType, IENumerable`1 addtionalProperties)

    at Microsoft.Exchange.WebServices.Data.Attachment.Load()

    Here is my code to download the attachment:

    service.LoadPropertiesForItems(items, PropertySet.FirstClassProperties);

    foreach (Appointment a in appointments) {

    string htmlBody = a.Body.Text;

    foreach(Attachment att in a.Attachments) {

    if (att is FileAttachment) {

    FileAttachment fileAtt = att as FileAttachment;

    FileStream theStream = new FileStream(String.Format(@"ANP\{0}", att.ContentId ), FileMode.OpenOrCreate, FileAccess.ReadWrite);

    fileAtt.Load(theStream);

           theStream.Close();

           theStream.Dispose();

    }

    }

    }

    The exception is triggered by this code line: fileAtt.Load(theStream);

    Do I miss something ? If the attachment is < 5 Mb, the codes run very well and I can download the attachment.

    Please help.

    Thank you so much.

    Halomoan



    • Edited by Halomoan K Wednesday, July 8, 2015 7:54 AM
    Wednesday, July 8, 2015 7:50 AM

All replies

  • Can you open the attachment in OWA ? I would also try using the EWSEditor https://ewseditor.codeplex.com/ . If you still get an error post the SOAP response you get from the server  (you can get this by either enabling tracing in your code or the EWSEditor has a request log the exception your getting isn't really that helpful).

    Cheers
    Glen

    Thursday, July 9, 2015 4:18 AM
  • Hi Glen

    Thank you for the reply. Like what you said, I tested on the OWA and yes, the attachment cannot be opened as well while the other smaller attachments have no problem. 

    Here is the log I got from the EWSEditor, hopefully it can gives you some clues:

    2015-07-09T15:29:59|EwsTrace|PerformRetryableItemBind|EwsRequestHttpHeaders|
    <Trace Tag="EwsRequestHttpHeaders" Tid="1" Time="2015-07-09 07:29:59Z">
    POST /ews/exchange.asmx HTTP/1.1
    Content-Type: text/xml; charset=utf-8
    Accept: text/xml
    User-Agent: EwsEditor (ExchangeServicesClient/15.00.0913.015)
    Accept-Encoding: gzip,deflate
    
    
    </Trace>
    
    2015-07-09T15:29:59|EwsTrace|PerformRetryableItemBind|EwsRequest|
    <Trace Tag="EwsRequest" Tid="1" Time="2015-07-09 07:29:59Z" Version="15.00.0913.015">
      <?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <soap:Header>
          <t:RequestServerVersion Version="Exchange2010_SP2" />
        </soap:Header>
        <soap:Body>
          <m:GetItem>
            <m:ItemShape>
              <t:BaseShape>AllProperties</t:BaseShape>
            </m:ItemShape>
            <m:ItemIds>
              <t:ItemId Id="AAMkAGI5NTA3NDkyLTAwOWItNGM4OC05NDM5LWFhOGZkYzZjYjM5YQBGAAAAAABo+HxLIILQTocQMbNXNgSnBwBz4CP/sa1nT72CY+jeLIwRAAAA6ZnEAABamyuoaglHQqtPQXlTPNu6AANFWO4CAAA=" />
            </m:ItemIds>
          </m:GetItem>
        </soap:Body>
      </soap:Envelope>
    </Trace>
    
    2015-07-09T15:29:59|EwsTrace|PerformRetryableItemBind|EwsResponseHttpHeaders|
    <Trace Tag="EwsResponseHttpHeaders" Tid="1" Time="2015-07-09 07:29:59Z">
    HTTP/1.1 200 OK
    Transfer-Encoding: chunked
    Content-Encoding: gzip
    Vary: Accept-Encoding
    Persistent-Auth: true
    Cache-Control: private
    Content-Type: text/xml; charset=utf-8
    Date: Thu, 09 Jul 2015 07:30:00 GMT
    Server: Microsoft-IIS/7.5
    X-AspNet-Version: 2.0.50727
    X-Powered-By: ASP.NET
    
    
    </Trace>
    
    2015-07-09T15:29:59|EwsTrace|PerformRetryableItemBind|EwsResponse|
    <Trace Tag="EwsResponse" Tid="1" Time="2015-07-09 07:29:59Z" Version="15.00.0913.015">
      <?xml version="1.0" encoding="utf-8"?>
      <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
        <s:Header>
          <h:ServerVersionInfo MajorVersion="14" MinorVersion="2" MajorBuildNumber="247" MinorBuildNumber="3" Version="Exchange2010_SP2" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
        </s:Header>
        <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          <m:GetItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
            <m:ResponseMessages>
              <m:GetItemResponseMessage ResponseClass="Success">
                <m:ResponseCode>NoError</m:ResponseCode>
                <m:Items>
                  <t:CalendarItem>
                    <t:ItemId Id="AAMkAGI5NTA3NDkyLTAwOWItNGM4OC05NDM5LWFhOGZkYzZjYjM5YQBGAAAAAABo+HxLIILQTocQMbNXNgSnBwBz4CP/sa1nT72CY+jeLIwRAAAA6ZnEAABamyuoaglHQqtPQXlTPNu6AANFWO4CAAA=" ChangeKey="DwAAABYAAABz4CP/sa1nT72CY+jeLIwRAAAA6gJT" />
                    <t:ParentFolderId Id="AAMkAGI5NTA3NDkyLTAwOWItNGM4OC05NDM5LWFhOGZkYzZjYjM5YQAuAAAAAABo+HxLIILQTocQMbNXNgSnAQBz4CP/sa1nT72CY+jeLIwRAAAA6ZnEAAA=" ChangeKey="AQAAAA==" />
                    <t:ItemClass>IPM.Appointment</t:ItemClass>
                    <t:Subject>Urban Attack Game - big file</t:Subject>
                    <t:Sensitivity>Normal</t:Sensitivity>
                    <t:Body BodyType="HTML">&lt;html&gt;
    &lt;head&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
    &lt;meta name="Generator" content="Microsoft Exchange Server"&gt;
    &lt;!-- converted from rtf --&gt;
    &lt;style&gt;&lt;!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --&gt;&lt;/style&gt;
    &lt;/head&gt;
    &lt;body&gt;
    &lt;font face="Times New Roman" size="2"&gt;&lt;span style="font-size:11pt;"&gt;
    &lt;div&gt;&lt;img src="cid:D0CDE8D290B3A2031954992F332C2C61C80BA98E@1"&gt;&lt;font face="Calibri"&gt; &lt;/font&gt;&lt;/div&gt;
    &lt;div&gt;&amp;nbsp;&lt;/div&gt;
    &lt;/span&gt;&lt;/font&gt;
    &lt;/body&gt;
    &lt;/html&gt;
    </t:Body>
                    <t:Attachments>
                      <t:FileAttachment>
                        <t:AttachmentId Id="AAMkAGI5NTA3NDkyLTAwOWItNGM4OC05NDM5LWFhOGZkYzZjYjM5YQBGAAAAAABo+HxLIILQTocQMbNXNgSnBwBz4CP/sa1nT72CY+jeLIwRAAAA6ZnEAABamyuoaglHQqtPQXlTPNu6AANFWO4CAAABEgAQAOxthkQeKNtNvSd8GVyndDA=" />
                        <t:Name>ATT09357</t:Name>
                        <t:Size>5971034</t:Size>
                        <t:LastModifiedTime>2015-07-08T06:21:45</t:LastModifiedTime>
                        <t:IsInline>true</t:IsInline>
                        <t:ContentId>D0CDE8D290B3A2031954992F332C2C61C80BA98E@1</t:ContentId>
                      </t:FileAttachment>
                    </t:Attachments>
                    <t:DateTimeReceived>2015-07-08T00:50:09Z</t:DateTimeReceived>
                    <t:Size>5976864</t:Size>
                    <t:Importance>Normal</t:Importance>
                    <t:IsSubmitted>false</t:IsSubmitted>
                    <t:IsDraft>false</t:IsDraft>
                    <t:IsFromMe>false</t:IsFromMe>
                    <t:IsResend>false</t:IsResend>
                    <t:IsUnmodified>false</t:IsUnmodified>
                    <t:DateTimeSent>2015-07-08T00:50:09Z</t:DateTimeSent>
                    <t:DateTimeCreated>2015-07-08T00:49:05Z</t:DateTimeCreated>
                    <t:ResponseObjects>
                      <t:ForwardItem />
                    </t:ResponseObjects>
                    <t:ReminderDueBy>2015-07-08T07:00:00Z</t:ReminderDueBy>
                    <t:ReminderIsSet>false</t:ReminderIsSet>
                    <t:ReminderMinutesBeforeStart>15</t:ReminderMinutesBeforeStart>
                    <t:DisplayCc />
                    <t:DisplayTo>A&amp;P Events</t:DisplayTo>
                    <t:HasAttachments>true</t:HasAttachments>
                    <t:Culture>en-SG</t:Culture>
                    <t:EffectiveRights>
                      <t:CreateAssociated>false</t:CreateAssociated>
                      <t:CreateContents>false</t:CreateContents>
                      <t:CreateHierarchy>false</t:CreateHierarchy>
                      <t:Delete>true</t:Delete>
                      <t:Modify>true</t:Modify>
                      <t:Read>true</t:Read>
                      <t:ViewPrivateItems>true</t:ViewPrivateItems>
                    </t:EffectiveRights>
                    <t:LastModifiedName>A&amp;P Events</t:LastModifiedName>
                    <t:LastModifiedTime>2015-07-08T07:18:02Z</t:LastModifiedTime>
                    <t:IsAssociated>false</t:IsAssociated>
                    <t:WebClientReadFormQueryString>?ae=Item&amp;t=IPM.Appointment&amp;id=RgAAAABo%2bHxLIILQTocQMbNXNgSnBwBz4CP%2fsa1nT72CY%2bjeLIwRAAAA6ZnEAABamyuoaglHQqtPQXlTPNu6AANFWO4CAAAP&amp;exvsurl=1</t:WebClientReadFormQueryString>
                    <t:WebClientEditFormQueryString>?ae=Item&amp;a=Open&amp;t=IPM.Appointment&amp;id=RgAAAABo%2bHxLIILQTocQMbNXNgSnBwBz4CP%2fsa1nT72CY%2bjeLIwRAAAA6ZnEAABamyuoaglHQqtPQXlTPNu6AANFWO4CAAAP&amp;exvsurl=1</t:WebClientEditFormQueryString>
                    <t:ConversationId Id="AAQkAGI5NTA3NDkyLTAwOWItNGM4OC05NDM5LWFhOGZkYzZjYjM5YQAQAInTZyCBWk7Go406y/fJZF8=" />
                    <t:UID>040000008200E00074C5B7101A82E0080000000000E81D185BB9D00100000000000000001000000026169E6751F39D408C6FB5CC7AF5C077</t:UID>
                    <t:DateTimeStamp>2015-07-08T07:18:02Z</t:DateTimeStamp>
                    <t:Start>2015-07-08T07:00:00Z</t:Start>
                    <t:End>2015-07-08T07:30:00Z</t:End>
                    <t:IsAllDayEvent>false</t:IsAllDayEvent>
                    <t:LegacyFreeBusyStatus>Busy</t:LegacyFreeBusyStatus>
                    <t:Location>IT Meeting Room 22-06,United Square</t:Location>
                    <t:IsMeeting>false</t:IsMeeting>
                    <t:IsCancelled>false</t:IsCancelled>
                    <t:IsRecurring>false</t:IsRecurring>
                    <t:MeetingRequestWasSent>false</t:MeetingRequestWasSent>
                    <t:IsResponseRequested>true</t:IsResponseRequested>
                    <t:CalendarItemType>Single</t:CalendarItemType>
                    <t:MyResponseType>Unknown</t:MyResponseType>
                    <t:Organizer>
                      <t:Mailbox>
                        <t:Name>A&amp;P Events</t:Name>
                        <t:EmailAddress>events.anp@uol.com.sg</t:EmailAddress>
                        <t:RoutingType>SMTP</t:RoutingType>
                        <t:MailboxType>Mailbox</t:MailboxType>
                      </t:Mailbox>
                    </t:Organizer>
                    <t:RequiredAttendees>
                      <t:Attendee>
                        <t:Mailbox>
                          <t:Name>A&amp;P Events</t:Name>
                          <t:EmailAddress>events.anp@uol.com.sg</t:EmailAddress>
                          <t:RoutingType>SMTP</t:RoutingType>
                          <t:MailboxType>Mailbox</t:MailboxType>
                        </t:Mailbox>
                        <t:ResponseType>Unknown</t:ResponseType>
                      </t:Attendee>
                    </t:RequiredAttendees>
                    <t:Duration>PT30M</t:Duration>
                    <t:TimeZone>(UTC+08:00) Kuala Lumpur, Singapore</t:TimeZone>
                    <t:AppointmentSequenceNumber>0</t:AppointmentSequenceNumber>
                    <t:AppointmentState>0</t:AppointmentState>
                    <t:ConferenceType>0</t:ConferenceType>
                    <t:AllowNewTimeProposal>true</t:AllowNewTimeProposal>
                    <t:NetShowUrl />
                  </t:CalendarItem>
                </m:Items>
              </m:GetItemResponseMessage>
            </m:ResponseMessages>
          </m:GetItemResponse>
        </s:Body>
      </s:Envelope>
    </Trace>
    
    2015-07-09T15:30:04|EwsTrace|HandleItemMenuOpening|EwsRequestHttpHeaders|
    <Trace Tag="EwsRequestHttpHeaders" Tid="1" Time="2015-07-09 07:30:04Z">
    POST /ews/exchange.asmx HTTP/1.1
    Content-Type: text/xml; charset=utf-8
    Accept: text/xml
    User-Agent: EwsEditor (ExchangeServicesClient/15.00.0913.015)
    Accept-Encoding: gzip,deflate
    
    
    </Trace>
    
    2015-07-09T15:30:04|EwsTrace|HandleItemMenuOpening|EwsRequest|
    <Trace Tag="EwsRequest" Tid="1" Time="2015-07-09 07:30:04Z" Version="15.00.0913.015">
      <?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <soap:Header>
          <t:RequestServerVersion Version="Exchange2010_SP2" />
        </soap:Header>
        <soap:Body>
          <m:GetItem>
            <m:ItemShape>
              <t:BaseShape>AllProperties</t:BaseShape>
            </m:ItemShape>
            <m:ItemIds>
              <t:ItemId Id="AAMkAGI5NTA3NDkyLTAwOWItNGM4OC05NDM5LWFhOGZkYzZjYjM5YQBGAAAAAABo+HxLIILQTocQMbNXNgSnBwBz4CP/sa1nT72CY+jeLIwRAAAA6ZnEAABamyuoaglHQqtPQXlTPNu6AANFWO4CAAA=" />
            </m:ItemIds>
          </m:GetItem>
        </soap:Body>
      </soap:Envelope>
    </Trace>
    
    2015-07-09T15:30:05|EwsTrace|HandleItemMenuOpening|EwsResponseHttpHeaders|
    <Trace Tag="EwsResponseHttpHeaders" Tid="1" Time="2015-07-09 07:30:05Z">
    HTTP/1.1 200 OK
    Transfer-Encoding: chunked
    Content-Encoding: gzip
    Vary: Accept-Encoding
    Persistent-Auth: true
    Cache-Control: private
    Content-Type: text/xml; charset=utf-8
    Date: Thu, 09 Jul 2015 07:30:05 GMT
    Server: Microsoft-IIS/7.5
    X-AspNet-Version: 2.0.50727
    X-Powered-By: ASP.NET
    
    
    </Trace>
    
    2015-07-09T15:30:05|EwsTrace|HandleItemMenuOpening|EwsResponse|
    <Trace Tag="EwsResponse" Tid="1" Time="2015-07-09 07:30:05Z" Version="15.00.0913.015">
      <?xml version="1.0" encoding="utf-8"?>
      <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
        <s:Header>
          <h:ServerVersionInfo MajorVersion="14" MinorVersion="2" MajorBuildNumber="247" MinorBuildNumber="3" Version="Exchange2010_SP2" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
        </s:Header>
        <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          <m:GetItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
            <m:ResponseMessages>
              <m:GetItemResponseMessage ResponseClass="Success">
                <m:ResponseCode>NoError</m:ResponseCode>
                <m:Items>
                  <t:CalendarItem>
                    <t:ItemId Id="AAMkAGI5NTA3NDkyLTAwOWItNGM4OC05NDM5LWFhOGZkYzZjYjM5YQBGAAAAAABo+HxLIILQTocQMbNXNgSnBwBz4CP/sa1nT72CY+jeLIwRAAAA6ZnEAABamyuoaglHQqtPQXlTPNu6AANFWO4CAAA=" ChangeKey="DwAAABYAAABz4CP/sa1nT72CY+jeLIwRAAAA6gJT" />
                    <t:ParentFolderId Id="AAMkAGI5NTA3NDkyLTAwOWItNGM4OC05NDM5LWFhOGZkYzZjYjM5YQAuAAAAAABo+HxLIILQTocQMbNXNgSnAQBz4CP/sa1nT72CY+jeLIwRAAAA6ZnEAAA=" ChangeKey="AQAAAA==" />
                    <t:ItemClass>IPM.Appointment</t:ItemClass>
                    <t:Subject>Urban Attack Game - big file</t:Subject>
                    <t:Sensitivity>Normal</t:Sensitivity>
                    <t:Body BodyType="HTML">&lt;html&gt;
    &lt;head&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
    &lt;meta name="Generator" content="Microsoft Exchange Server"&gt;
    &lt;!-- converted from rtf --&gt;
    &lt;style&gt;&lt;!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --&gt;&lt;/style&gt;
    &lt;/head&gt;
    &lt;body&gt;
    &lt;font face="Times New Roman" size="2"&gt;&lt;span style="font-size:11pt;"&gt;
    &lt;div&gt;&lt;img src="cid:D0CDE8D290B3A2031954992F332C2C61C80BA98E@1"&gt;&lt;font face="Calibri"&gt; &lt;/font&gt;&lt;/div&gt;
    &lt;div&gt;&amp;nbsp;&lt;/div&gt;
    &lt;/span&gt;&lt;/font&gt;
    &lt;/body&gt;
    &lt;/html&gt;
    </t:Body>
                    <t:Attachments>
                      <t:FileAttachment>
                        <t:AttachmentId Id="AAMkAGI5NTA3NDkyLTAwOWItNGM4OC05NDM5LWFhOGZkYzZjYjM5YQBGAAAAAABo+HxLIILQTocQMbNXNgSnBwBz4CP/sa1nT72CY+jeLIwRAAAA6ZnEAABamyuoaglHQqtPQXlTPNu6AANFWO4CAAABEgAQAOxthkQeKNtNvSd8GVyndDA=" />
                        <t:Name>ATT09357</t:Name>
                        <t:Size>5971034</t:Size>
                        <t:LastModifiedTime>2015-07-08T06:21:45</t:LastModifiedTime>
                        <t:IsInline>true</t:IsInline>
                        <t:ContentId>D0CDE8D290B3A2031954992F332C2C61C80BA98E@1</t:ContentId>
                      </t:FileAttachment>
                    </t:Attachments>
                    <t:DateTimeReceived>2015-07-08T00:50:09Z</t:DateTimeReceived>
                    <t:Size>5976864</t:Size>
                    <t:Importance>Normal</t:Importance>
                    <t:IsSubmitted>false</t:IsSubmitted>
                    <t:IsDraft>false</t:IsDraft>
                    <t:IsFromMe>false</t:IsFromMe>
                    <t:IsResend>false</t:IsResend>
                    <t:IsUnmodified>false</t:IsUnmodified>
                    <t:DateTimeSent>2015-07-08T00:50:09Z</t:DateTimeSent>
                    <t:DateTimeCreated>2015-07-08T00:49:05Z</t:DateTimeCreated>
                    <t:ResponseObjects>
                      <t:ForwardItem />
                    </t:ResponseObjects>
                    <t:ReminderDueBy>2015-07-08T07:00:00Z</t:ReminderDueBy>
                    <t:ReminderIsSet>false</t:ReminderIsSet>
                    <t:ReminderMinutesBeforeStart>15</t:ReminderMinutesBeforeStart>
                    <t:DisplayCc />
                    <t:DisplayTo>A&amp;P Events</t:DisplayTo>
                    <t:HasAttachments>true</t:HasAttachments>
                    <t:Culture>en-SG</t:Culture>
                    <t:EffectiveRights>
                      <t:CreateAssociated>false</t:CreateAssociated>
                      <t:CreateContents>false</t:CreateContents>
                      <t:CreateHierarchy>false</t:CreateHierarchy>
                      <t:Delete>true</t:Delete>
                      <t:Modify>true</t:Modify>
                      <t:Read>true</t:Read>
                      <t:ViewPrivateItems>true</t:ViewPrivateItems>
                    </t:EffectiveRights>
                    <t:LastModifiedName>A&amp;P Events</t:LastModifiedName>
                    <t:LastModifiedTime>2015-07-08T07:18:02Z</t:LastModifiedTime>
                    <t:IsAssociated>false</t:IsAssociated>
                    <t:WebClientReadFormQueryString>?ae=Item&amp;t=IPM.Appointment&amp;id=RgAAAABo%2bHxLIILQTocQMbNXNgSnBwBz4CP%2fsa1nT72CY%2bjeLIwRAAAA6ZnEAABamyuoaglHQqtPQXlTPNu6AANFWO4CAAAP&amp;exvsurl=1</t:WebClientReadFormQueryString>
                    <t:WebClientEditFormQueryString>?ae=Item&amp;a=Open&amp;t=IPM.Appointment&amp;id=RgAAAABo%2bHxLIILQTocQMbNXNgSnBwBz4CP%2fsa1nT72CY%2bjeLIwRAAAA6ZnEAABamyuoaglHQqtPQXlTPNu6AANFWO4CAAAP&amp;exvsurl=1</t:WebClientEditFormQueryString>
                    <t:ConversationId Id="AAQkAGI5NTA3NDkyLTAwOWItNGM4OC05NDM5LWFhOGZkYzZjYjM5YQAQAInTZyCBWk7Go406y/fJZF8=" />
                    <t:UID>040000008200E00074C5B7101A82E0080000000000E81D185BB9D00100000000000000001000000026169E6751F39D408C6FB5CC7AF5C077</t:UID>
                    <t:DateTimeStamp>2015-07-08T07:18:02Z</t:DateTimeStamp>
                    <t:Start>2015-07-08T07:00:00Z</t:Start>
                    <t:End>2015-07-08T07:30:00Z</t:End>
                    <t:IsAllDayEvent>false</t:IsAllDayEvent>
                    <t:LegacyFreeBusyStatus>Busy</t:LegacyFreeBusyStatus>
                    <t:Location>IT Meeting Room 22-06,United Square</t:Location>
                    <t:IsMeeting>false</t:IsMeeting>
                    <t:IsCancelled>false</t:IsCancelled>
                    <t:IsRecurring>false</t:IsRecurring>
                    <t:MeetingRequestWasSent>false</t:MeetingRequestWasSent>
                    <t:IsResponseRequested>true</t:IsResponseRequested>
                    <t:CalendarItemType>Single</t:CalendarItemType>
                    <t:MyResponseType>Unknown</t:MyResponseType>
                    <t:Organizer>
                      <t:Mailbox>
                        <t:Name>A&amp;P Events</t:Name>
                        <t:EmailAddress>events.anp@uol.com.sg</t:EmailAddress>
                        <t:RoutingType>SMTP</t:RoutingType>
                        <t:MailboxType>Mailbox</t:MailboxType>
                      </t:Mailbox>
                    </t:Organizer>
                    <t:RequiredAttendees>
                      <t:Attendee>
                        <t:Mailbox>
                          <t:Name>A&amp;P Events</t:Name>
                          <t:EmailAddress>events.anp@uol.com.sg</t:EmailAddress>
                          <t:RoutingType>SMTP</t:RoutingType>
                          <t:MailboxType>Mailbox</t:MailboxType>
                        </t:Mailbox>
                        <t:ResponseType>Unknown</t:ResponseType>
                      </t:Attendee>
                    </t:RequiredAttendees>
                    <t:Duration>PT30M</t:Duration>
                    <t:TimeZone>(UTC+08:00) Kuala Lumpur, Singapore</t:TimeZone>
                    <t:AppointmentSequenceNumber>0</t:AppointmentSequenceNumber>
                    <t:AppointmentState>0</t:AppointmentState>
                    <t:ConferenceType>0</t:ConferenceType>
                    <t:AllowNewTimeProposal>true</t:AllowNewTimeProposal>
                    <t:NetShowUrl />
                  </t:CalendarItem>
                </m:Items>
              </m:GetItemResponseMessage>
            </m:ResponseMessages>
          </m:GetItemResponse>
        </s:Body>
      </s:Envelope>
    </Trace>
    
    2015-07-09T15:30:05|EwsTrace|MnuAttachments_Click|EwsRequestHttpHeaders|
    <Trace Tag="EwsRequestHttpHeaders" Tid="1" Time="2015-07-09 07:30:05Z">
    POST /ews/exchange.asmx HTTP/1.1
    Content-Type: text/xml; charset=utf-8
    Accept: text/xml
    User-Agent: EwsEditor (ExchangeServicesClient/15.00.0913.015)
    Accept-Encoding: gzip,deflate
    
    
    </Trace>
    
    2015-07-09T15:30:05|EwsTrace|MnuAttachments_Click|EwsRequest|
    <Trace Tag="EwsRequest" Tid="1" Time="2015-07-09 07:30:05Z" Version="15.00.0913.015">
      <?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <soap:Header>
          <t:RequestServerVersion Version="Exchange2010_SP2" />
        </soap:Header>
        <soap:Body>
          <m:GetItem>
            <m:ItemShape>
              <t:BaseShape>AllProperties</t:BaseShape>
            </m:ItemShape>
            <m:ItemIds>
              <t:ItemId Id="AAMkAGI5NTA3NDkyLTAwOWItNGM4OC05NDM5LWFhOGZkYzZjYjM5YQBGAAAAAABo+HxLIILQTocQMbNXNgSnBwBz4CP/sa1nT72CY+jeLIwRAAAA6ZnEAABamyuoaglHQqtPQXlTPNu6AANFWO4CAAA=" />
            </m:ItemIds>
          </m:GetItem>
        </soap:Body>
      </soap:Envelope>
    </Trace>
    
    2015-07-09T15:30:05|EwsTrace|MnuAttachments_Click|EwsResponseHttpHeaders|
    <Trace Tag="EwsResponseHttpHeaders" Tid="1" Time="2015-07-09 07:30:05Z">
    HTTP/1.1 200 OK
    Transfer-Encoding: chunked
    Content-Encoding: gzip
    Vary: Accept-Encoding
    Persistent-Auth: true
    Cache-Control: private
    Content-Type: text/xml; charset=utf-8
    Date: Thu, 09 Jul 2015 07:30:06 GMT
    Server: Microsoft-IIS/7.5
    X-AspNet-Version: 2.0.50727
    X-Powered-By: ASP.NET
    
    
    </Trace>
    
    2015-07-09T15:30:05|EwsTrace|MnuAttachments_Click|EwsResponse|
    <Trace Tag="EwsResponse" Tid="1" Time="2015-07-09 07:30:05Z" Version="15.00.0913.015">
      <?xml version="1.0" encoding="utf-8"?>
      <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
        <s:Header>
          <h:ServerVersionInfo MajorVersion="14" MinorVersion="2" MajorBuildNumber="247" MinorBuildNumber="3" Version="Exchange2010_SP2" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
        </s:Header>
        <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          <m:GetItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
            <m:ResponseMessages>
              <m:GetItemResponseMessage ResponseClass="Success">
                <m:ResponseCode>NoError</m:ResponseCode>
                <m:Items>
                  <t:CalendarItem>
                    <t:ItemId Id="AAMkAGI5NTA3NDkyLTAwOWItNGM4OC05NDM5LWFhOGZkYzZjYjM5YQBGAAAAAABo+HxLIILQTocQMbNXNgSnBwBz4CP/sa1nT72CY+jeLIwRAAAA6ZnEAABamyuoaglHQqtPQXlTPNu6AANFWO4CAAA=" ChangeKey="DwAAABYAAABz4CP/sa1nT72CY+jeLIwRAAAA6gJT" />
                    <t:ParentFolderId Id="AAMkAGI5NTA3NDkyLTAwOWItNGM4OC05NDM5LWFhOGZkYzZjYjM5YQAuAAAAAABo+HxLIILQTocQMbNXNgSnAQBz4CP/sa1nT72CY+jeLIwRAAAA6ZnEAAA=" ChangeKey="AQAAAA==" />
                    <t:ItemClass>IPM.Appointment</t:ItemClass>
                    <t:Subject>Urban Attack Game - big file</t:Subject>
                    <t:Sensitivity>Normal</t:Sensitivity>
                    <t:Body BodyType="HTML">&lt;html&gt;
    &lt;head&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
    &lt;meta name="Generator" content="Microsoft Exchange Server"&gt;
    &lt;!-- converted from rtf --&gt;
    &lt;style&gt;&lt;!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --&gt;&lt;/style&gt;
    &lt;/head&gt;
    &lt;body&gt;
    &lt;font face="Times New Roman" size="2"&gt;&lt;span style="font-size:11pt;"&gt;
    &lt;div&gt;&lt;img src="cid:D0CDE8D290B3A2031954992F332C2C61C80BA98E@1"&gt;&lt;font face="Calibri"&gt; &lt;/font&gt;&lt;/div&gt;
    &lt;div&gt;&amp;nbsp;&lt;/div&gt;
    &lt;/span&gt;&lt;/font&gt;
    &lt;/body&gt;
    &lt;/html&gt;
    </t:Body>
                    <t:Attachments>
                      <t:FileAttachment>
                        <t:AttachmentId Id="AAMkAGI5NTA3NDkyLTAwOWItNGM4OC05NDM5LWFhOGZkYzZjYjM5YQBGAAAAAABo+HxLIILQTocQMbNXNgSnBwBz4CP/sa1nT72CY+jeLIwRAAAA6ZnEAABamyuoaglHQqtPQXlTPNu6AANFWO4CAAABEgAQAOxthkQeKNtNvSd8GVyndDA=" />
                        <t:Name>ATT09357</t:Name>
                        <t:Size>5971034</t:Size>
                        <t:LastModifiedTime>2015-07-08T06:21:45</t:LastModifiedTime>
                        <t:IsInline>true</t:IsInline>
                        <t:ContentId>D0CDE8D290B3A2031954992F332C2C61C80BA98E@1</t:ContentId>
                      </t:FileAttachment>
                    </t:Attachments>
                    <t:DateTimeReceived>2015-07-08T00:50:09Z</t:DateTimeReceived>
                    <t:Size>5976864</t:Size>
                    <t:Importance>Normal</t:Importance>
                    <t:IsSubmitted>false</t:IsSubmitted>
                    <t:IsDraft>false</t:IsDraft>
                    <t:IsFromMe>false</t:IsFromMe>
                    <t:IsResend>false</t:IsResend>
                    <t:IsUnmodified>false</t:IsUnmodified>
                    <t:DateTimeSent>2015-07-08T00:50:09Z</t:DateTimeSent>
                    <t:DateTimeCreated>2015-07-08T00:49:05Z</t:DateTimeCreated>
                    <t:ResponseObjects>
                      <t:ForwardItem />
                    </t:ResponseObjects>
                    <t:ReminderDueBy>2015-07-08T07:00:00Z</t:ReminderDueBy>
                    <t:ReminderIsSet>false</t:ReminderIsSet>
                    <t:ReminderMinutesBeforeStart>15</t:ReminderMinutesBeforeStart>
                    <t:DisplayCc />
                    <t:DisplayTo>A&amp;P Events</t:DisplayTo>
                    <t:HasAttachments>true</t:HasAttachments>
                    <t:Culture>en-SG</t:Culture>
                    <t:EffectiveRights>
                      <t:CreateAssociated>false</t:CreateAssociated>
                      <t:CreateContents>false</t:CreateContents>
                      <t:CreateHierarchy>false</t:CreateHierarchy>
                      <t:Delete>true</t:Delete>
                      <t:Modify>true</t:Modify>
                      <t:Read>true</t:Read>
                      <t:ViewPrivateItems>true</t:ViewPrivateItems>
                    </t:EffectiveRights>
                    <t:LastModifiedName>A&amp;P Events</t:LastModifiedName>
                    <t:LastModifiedTime>2015-07-08T07:18:02Z</t:LastModifiedTime>
                    <t:IsAssociated>false</t:IsAssociated>
                    <t:WebClientReadFormQueryString>?ae=Item&amp;t=IPM.Appointment&amp;id=RgAAAABo%2bHxLIILQTocQMbNXNgSnBwBz4CP%2fsa1nT72CY%2bjeLIwRAAAA6ZnEAABamyuoaglHQqtPQXlTPNu6AANFWO4CAAAP&amp;exvsurl=1</t:WebClientReadFormQueryString>
                    <t:WebClientEditFormQueryString>?ae=Item&amp;a=Open&amp;t=IPM.Appointment&amp;id=RgAAAABo%2bHxLIILQTocQMbNXNgSnBwBz4CP%2fsa1nT72CY%2bjeLIwRAAAA6ZnEAABamyuoaglHQqtPQXlTPNu6AANFWO4CAAAP&amp;exvsurl=1</t:WebClientEditFormQueryString>
                    <t:ConversationId Id="AAQkAGI5NTA3NDkyLTAwOWItNGM4OC05NDM5LWFhOGZkYzZjYjM5YQAQAInTZyCBWk7Go406y/fJZF8=" />
                    <t:UID>040000008200E00074C5B7101A82E0080000000000E81D185BB9D00100000000000000001000000026169E6751F39D408C6FB5CC7AF5C077</t:UID>
                    <t:DateTimeStamp>2015-07-08T07:18:02Z</t:DateTimeStamp>
                    <t:Start>2015-07-08T07:00:00Z</t:Start>
                    <t:End>2015-07-08T07:30:00Z</t:End>
                    <t:IsAllDayEvent>false</t:IsAllDayEvent>
                    <t:LegacyFreeBusyStatus>Busy</t:LegacyFreeBusyStatus>
                    <t:Location>IT Meeting Room 22-06,United Square</t:Location>
                    <t:IsMeeting>false</t:IsMeeting>
                    <t:IsCancelled>false</t:IsCancelled>
                    <t:IsRecurring>false</t:IsRecurring>
                    <t:MeetingRequestWasSent>false</t:MeetingRequestWasSent>
                    <t:IsResponseRequested>true</t:IsResponseRequested>
                    <t:CalendarItemType>Single</t:CalendarItemType>
                    <t:MyResponseType>Unknown</t:MyResponseType>
                    <t:Organizer>
                      <t:Mailbox>
                        <t:Name>A&amp;P Events</t:Name>
                        <t:EmailAddress>events.anp@uol.com.sg</t:EmailAddress>
                        <t:RoutingType>SMTP</t:RoutingType>
                        <t:MailboxType>Mailbox</t:MailboxType>
                      </t:Mailbox>
                    </t:Organizer>
                    <t:RequiredAttendees>
                      <t:Attendee>
                        <t:Mailbox>
                          <t:Name>A&amp;P Events</t:Name>
                          <t:EmailAddress>events.anp@uol.com.sg</t:EmailAddress>
                          <t:RoutingType>SMTP</t:RoutingType>
                          <t:MailboxType>Mailbox</t:MailboxType>
                        </t:Mailbox>
                        <t:ResponseType>Unknown</t:ResponseType>
                      </t:Attendee>
                    </t:RequiredAttendees>
                    <t:Duration>PT30M</t:Duration>
                    <t:TimeZone>(UTC+08:00) Kuala Lumpur, Singapore</t:TimeZone>
                    <t:AppointmentSequenceNumber>0</t:AppointmentSequenceNumber>
                    <t:AppointmentState>0</t:AppointmentState>
                    <t:ConferenceType>0</t:ConferenceType>
                    <t:AllowNewTimeProposal>true</t:AllowNewTimeProposal>
                    <t:NetShowUrl />
                  </t:CalendarItem>
                </m:Items>
              </m:GetItemResponseMessage>
            </m:ResponseMessages>
          </m:GetItemResponse>
        </s:Body>
      </s:Envelope>
    </Trace>
    
    2015-07-09T15:30:05|EwsTrace|LoadSelectionDetails|EwsRequestHttpHeaders|
    <Trace Tag="EwsRequestHttpHeaders" Tid="1" Time="2015-07-09 07:30:05Z">
    POST /ews/exchange.asmx HTTP/1.1
    Content-Type: text/xml; charset=utf-8
    Accept: text/xml
    User-Agent: EwsEditor (ExchangeServicesClient/15.00.0913.015)
    Accept-Encoding: gzip,deflate
    
    
    </Trace>
    
    2015-07-09T15:30:05|EwsTrace|LoadSelectionDetails|EwsRequest|
    <Trace Tag="EwsRequest" Tid="1" Time="2015-07-09 07:30:05Z" Version="15.00.0913.015">
      <?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <soap:Header>
          <t:RequestServerVersion Version="Exchange2010_SP2" />
        </soap:Header>
        <soap:Body>
          <m:GetAttachment>
            <m:AttachmentIds>
              <t:AttachmentId Id="AAMkAGI5NTA3NDkyLTAwOWItNGM4OC05NDM5LWFhOGZkYzZjYjM5YQBGAAAAAABo+HxLIILQTocQMbNXNgSnBwBz4CP/sa1nT72CY+jeLIwRAAAA6ZnEAABamyuoaglHQqtPQXlTPNu6AANFWO4CAAABEgAQAOxthkQeKNtNvSd8GVyndDA=" />
            </m:AttachmentIds>
          </m:GetAttachment>
        </soap:Body>
      </soap:Envelope>
    </Trace>
    
    2015-07-09T15:30:06|EwsTrace|LoadSelectionDetails|EwsResponseHttpHeaders|
    <Trace Tag="EwsResponseHttpHeaders" Tid="1" Time="2015-07-09 07:30:06Z">
    HTTP/1.1 200 OK
    Transfer-Encoding: chunked
    Content-Encoding: gzip
    Vary: Accept-Encoding
    Persistent-Auth: true
    Cache-Control: private
    Content-Type: text/xml; charset=utf-8
    Date: Thu, 09 Jul 2015 07:30:06 GMT
    Server: Microsoft-IIS/7.5
    X-AspNet-Version: 2.0.50727
    X-Powered-By: ASP.NET
    
    
    </Trace>
    
    2015-07-09T15:30:06|EwsTrace|LoadSelectionDetails|EwsResponse|
    <Trace Tag="EwsResponse" Tid="1" Time="2015-07-09 07:30:06Z" Version="15.00.0913.015">
      <?xml version="1.0" encoding="utf-8"?>
      <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
        <s:Header>
          <h:ServerVersionInfo MajorVersion="14" MinorVersion="2" MajorBuildNumber="247" MinorBuildNumber="3" Version="Exchange2010_SP2" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
        </s:Header>
        <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          <m:GetAttachmentResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
            <m:ResponseMessages>
              <m:GetAttachmentResponseMessage ResponseClass="Error">
                <m:MessageText>The attachment could not be opened.</m:MessageText>
                <m:ResponseCode>ErrorCannotOpenFileAttachment</m:ResponseCode>
                <m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
                <m:Attachments />
              </m:GetAttachmentResponseMessage>
            </m:ResponseMessages>
          </m:GetAttachmentResponse>
        </s:Body>
      </s:Envelope>
    </Trace>
    
    2015-07-09T15:30:06|Error|Application_ThreadException|Unhandled exception!|
    Exception details:
    Message: The attachment could not be opened.
    Type: Microsoft.Exchange.WebServices.Data.ServiceResponseException
    Source: Microsoft.Exchange.WebServices
    ErrorCode: ErrorCannotOpenFileAttachment
    ErrorMessage: The attachment could not be opened.
    Stack Trace:
       at Microsoft.Exchange.WebServices.Data.ServiceResponse.InternalThrowIfNecessary()
       at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()
       at Microsoft.Exchange.WebServices.Data.Attachment.Load()
       at EWSEditor.Forms.AttachmentsContentForm.LoadSelectionDetails() in e:\msft tools\ewseditor\EWSEditor\Forms\AttachmentsContentForm.cs:line 87
       at EWSEditor.Forms.BaseContentForm.BaseContentForm_Load(Object sender, EventArgs e) in e:\msft tools\ewseditor\EWSEditor\Forms\BaseContentForm.cs:line 202
       at System.EventHandler.Invoke(Object sender, EventArgs e)
       at System.Windows.Forms.Form.OnLoad(EventArgs e)
       at System.Windows.Forms.Form.OnCreateControl()
       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       at System.Windows.Forms.Control.CreateControl()
       at System.Windows.Forms.Control.WmShowWindow(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at System.Windows.Forms.ContainerControl.WndProc(Message& m)
       at System.Windows.Forms.Form.WmShowWindow(Message& m)
       at System.Windows.Forms.Form.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    

    Best regards,

    Halomoan K.


    Thursday, July 9, 2015 7:37 AM
  • So EWS itself is returning the error which means from a client/code perspective there anything you can do from the Service perspective its tell you the attachment is un-processable.

    Look at the response header

          <h:ServerVersionInfo MajorVersion="14" MinorVersion="2" MajorBuildNumber="247" MinorBuildNumber="3" Version="Exchange2010_SP2" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
     

    Your only using Exchange SP2 build 247 which mean no rollups which was released back in 2011 https://technet.microsoft.com/en-us/library/hh135098%28v=exchg.150%29.aspx . With a server side issue like you have the first place to start would be making sure your server is patched fully.

    Cheers
    Glen

    Friday, July 10, 2015 6:04 AM
  • Hi Glen

    Sorry for my late reply, just be back from my vacation. 

    You are right, our Exchange Server had never been touched for patch update since the 1st installation. I will bring this to our Exchange Server engineer for them to plan to update the server. Hopefully it will works after the patches update. I'll update you.

    Thanks,
    Halomoan

    Thursday, July 23, 2015 12:33 AM