使用主动同步协议下载附件

时间:2015-02-05 14:53:59

标签: outlook exchange-server

我可以获取邮件正文&使用Sync命令从服务器获取附件详细信息。现在我无法找到下载附件并在屏幕上显示的方法。以下是我的sync命令响应。

<?xml version="1.0" encoding="utf-8"?>
<Sync xmlns:email="Email:" xmlns:airsyncbase="AirSyncBase:" xmlns:email2="Email2:" xmlns="AirSync:">
  <Collections>
    <Collection>
      <SyncKey>334239291</SyncKey> <CollectionId>5</CollectionId> <Status>1</Status>
       <Commands>
         <Add>
           <ServerId>5:3</ServerId>
           <ApplicationData>
             <email:To>"Device User" &lt;someone1@example.com&gt;</email:To> 
             <email:From>"Device User2" &lt;someone2@example.com&gt;</email:From>              
             <email:Subject>With Attachment</email:Subject> 
             <email:DateReceived>2009-03-04T22:48:41.211Z</email:DateReceived> 
             <email:DisplayTo>Device User</email:DisplayTo>               
             <email:ThreadTopic>With Attachment</email:ThreadTopic> 
             <email:Importance>1</email:Importance>
             <email:Read>0</email:Read> 
             <airsyncbase:Attachments>
               <airsyncbase:Attachment>               
                 <airsyncbase:DisplayName>Test.txt</airsyncbase:DisplayName>      
                 <airsyncbase:FileReference>5%3a3%3a0</airsyncbase:FileReference> 
                 <airsyncbase:Method>1</airsyncbase:Method> 
                 <airsyncbase:EstimatedDataSize>84</airsyncbase:EstimatedDataSize>
               </airsyncbase:Attachment> </airsyncbase:Attachments> 
             <airsyncbase:Body>
               <airsyncbase:Type>1</airsyncbase:Type>                        
               <airsyncbase:EstimatedDataSize>33</airsyncbase:EstimatedDataSize> 
               <airsyncbase:Truncated>1</airsyncbase:Truncated>
             </airsyncbase:Body> 
             <email:Flag /> 
             <email:ContentClass>urn:content-classes:message</email:ContentClass> <airsyncbase:NativeBodyType>1</airsyncbase:NativeBodyType> <email2:ConversationId>¥gÈtent-cl<email2:ConversationId> <email2:ConversationIndex>...<email2:ConversationIndex> <email:Categories />
          </ApplicationData>
        </Add>
      </Commands>
    </Collection>
  </Collections>
</Sync>



1 个答案:

答案 0 :(得分:1)

您应下载[MS-ASCMD]的副本。它可以回答很多关于ActiveSync的问题。对于附件,它取决于您使用的协议的版本。对于12.1及更早版本,您需要使用GetAttachment command。对于14.0及更高版本,您需要使用ItemOperations command。这是example