5

Problem mam jest to, że GlobalAppointmentID z Outlook Appointement stworzony za pomocą programu Outlook FormRegion różni się od ItemID przy użyciu EWS Managed API.Exchange ItemID różni się od GlobalAppointmentID dla programu Outlook dodatek

Tworzę Outlook dodatek, który pozwala użytkownikom na dodawanie informacji o klientach i projektu na spotkanie. AddIn przechowuje również identyfikator spotkania i dane spotkania w bazie danych, a usługa okresowo sprawdza identyfikator, aby zaktualizować dane spotkania.

Ok, więc tutaj jest jak używam dodatek:

Outlook.AppointmentItem appointement = (Outlook.AppointmentItem)this.OutlookItem; 

appointement.Save(); 

string ExchangeID = appointement.GlobalAppointmentID; 

Tutaj GlobalAppointmentID jest: 040000008200E00074C5B7101A82E0080000000060CADC517255CE01000000000000000010000000847A9CD89052DC49BA28DC8AAFBBB4BA

Ale EWS udało API spodziewa się coś takiego: AAMkADViNTJlZTg5LTIwYWMtNGY3My1hOWZiLTZiOTM3OTk3Nzk1YQBGAAAAAAAEfbmEhAMsRZur9AvsphPMBwCysaa5HwPMRanSoWSnKrckAAAAXAL/AACysaa5HwPMRanSoWSnKrckAAAAXCxwAAA =

do Bind Element Powołanie z usługi. Istnieje opcja rozwiązania tego problemu, ale tylko przy użyciu generowanych automatycznie serwerów proxy, a nie zarządzanego interfejsu API. Czy istnieje sposób na wyszukiwanie w interfejsie EWS Managed API dla GlobalAppointementID lub z dodatku AddIn Outlook w celu uzyskania ItemID?

Odpowiedz

2

Identyfikatory mogą być reprezentowane różne sposoby. Outlook używa pierwszego formularza, EWS drugiego.

Aby przekonwertować, należy użyć metody ConvertID.

Oto przykład wywołuje żądanie/odpowiedź w surowym formacie SOAP (z tych przykładów, należy być w stanie realizować je z API):
Outlook HexEntryID Exchange EWSID

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:mes="http://schemas.microsoft.com/exchange/services/2006/messages"> 
    <soapenv:Header> 
     <typ:RequestServerVersion Version="Exchange2007_SP1"/> 
     <typ:MailboxCulture>en-US</typ:MailboxCulture> 
    </soapenv:Header> 
    <soapenv:Body> 
     <mes:ConvertId DestinationFormat="EwsId"> 
     <mes:SourceIds> 
      <typ:AlternateId Format="HexEntryId" Id="0000000068C940C[snip]63136C3D0000" Mailbox="[email protected]"/> 
     </mes:SourceIds> 
     </mes:ConvertId> 
    </soapenv:Body> 
</soapenv:Envelope> 

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> 
    <s:Header> 
     <h:ServerVersionInfo MajorVersion="14" MinorVersion="0" MajorBuildNumber="722" MinorBuildNumber="0" Version="Exchange2010" 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:ConvertIdResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"> 
     <m:ResponseMessages> 
      <m:ConvertIdResponseMessage ResponseClass="Success"> 
       <m:ResponseCode>NoError</m:ResponseCode> 
       <m:AlternateId xsi:type="t:AlternateIdType" Format="EwsId" Id="AQMkADkyZTQxNjUzL[snip]YxNsPQAAAA==" Mailbox="[email protected]"/> 
      </m:ConvertIdResponseMessage> 
     </m:ResponseMessages> 
     </m:ConvertIdResponse> 
    </s:Body> 
</s:Envelope> 

Exchange EWSID do Outlooka HexEntryID:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:mes="http://schemas.microsoft.com/exchange/services/2006/messages"> 
    <soapenv:Header> 
     <typ:RequestServerVersion Version="Exchange2007_SP1"/> 
    </soapenv:Header> 
    <soapenv:Body> 
     <mes:ConvertId DestinationFormat="HexEntryId"> 
     <mes:SourceIds> 
      <typ:AlternateId Format="EwsId" Id="AQMkADkyZTQxNjUzLTcwZTQtNGRlNS04M2VmLWMxYmIBNWJi[snip]YxNsPQAAAA==" Mailbox="[email protected]"/> 
     </mes:SourceIds> 
     </mes:ConvertId> 
    </soapenv:Body> 
</soapenv:Envelope> 

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> 
    <s:Header> 
     <h:ServerVersionInfo MajorVersion="14" MinorVersion="0" MajorBuildNumber="722" MinorBuildNumber="0" Version="Exchange2010" 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:ConvertIdResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"> 
     <m:ResponseMessages> 
      <m:ConvertIdResponseMessage ResponseClass="Success"> 
       <m:ResponseCode>NoError</m:ResponseCode> 
       <m:AlternateId xsi:type="t:AlternateIdType" Format="HexEntryId" Id="0000000068C940[snip]136C3D0000" Mailbox="[email protected]"/> 
      </m:ConvertIdResponseMessage> 
     </m:ResponseMessages> 
     </m:ConvertIdResponse> 
    </s:Body> 
</s:Envelope> 

Należy pamiętać, że istnieje różnica w korzystaniu z tych dwóch typów identyfikatora podczas korzystania z powtarzających się spotkań i wystąpień:
Wh ID ERE EWS różne dla każdego przypadku, prognoza wejście heks identyfikator jest identyczny dla wszystkich:

reakcji FindItem dla cyklicznego wypadku, z jednym wyjątkiem - uwagę różne ItemIDs:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> 
    <s:Header> 
     <h:ServerVersionInfo MajorVersion="14" MinorVersion="0" MajorBuildNumber="722" MinorBuildNumber="0" Version="Exchange2010" 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:FindItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"> 
     <m:ResponseMessages> 
      <m:FindItemResponseMessage ResponseClass="Success"> 
       <m:ResponseCode>NoError</m:ResponseCode> 
       <m:RootFolder TotalItemsInView="10" IncludesLastItemInRange="true"> 
        <t:Items> 
        <t:CalendarItem> 
         <t:ItemId Id="AAMkADkyZTQxNjUzLTcwZTQtNGRlNS04M2VmLWMxYmJiNWJiNTBlNgFRAAgI0B8WRv2AAEYAAAAAgq3iY5OVdkmtnHS/lxCbwgcAhKYXWHH/akCFAFNVQGZiCgAAAAAAIQAAhKYXWHH/akCFAFNVQGZiCgACKa9YrQAAEA==" ChangeKey="DwAAABYAAACEphdYcf9qQIUAU1VAZmIKAAIpr2i3"/> 
         <t:ItemClass>IPM.Appointment.Occurrence</t:ItemClass> 
         <t:Subject>Recurring appointment with one exception</t:Subject> 
         <t:Sensitivity>Normal</t:Sensitivity> 
         <t:DateTimeCreated>2013-05-22T06:51:26Z</t:DateTimeCreated> 
         <t:LastModifiedTime>2013-05-22T06:52:20Z</t:LastModifiedTime> 
         <t:Start>2013-05-15T10:30:00Z</t:Start> 
         <t:End>2013-05-15T11:00:00Z</t:End> 
         <t:IsRecurring>true</t:IsRecurring> 
         <t:CalendarItemType>Occurrence</t:CalendarItemType> 
        </t:CalendarItem> 
        <t:CalendarItem> 
         <t:ItemId Id="AAMkADkyZTQxNjUzLTcwZTQtNGRlNS04M2VmLWMxYmJiNWJiNTBlNgFRAAgI0B/fcWdAAEYAAAAAgq3iY5OVdkmtnHS/lxCbwgcAhKYXWHH/akCFAFNVQGZiCgAAAAAAIQAAhKYXWHH/akCFAFNVQGZiCgACKa9YrQAAEA==" ChangeKey="DwAAABYAAACEphdYcf9qQIUAU1VAZmIKAAIpr2i3"/> 
         <t:ItemClass>IPM.OLE.CLASS.{00061055-0000-0000-C000-000000000046}</t:ItemClass> 
         <t:Subject>The exception</t:Subject> 
         <t:Sensitivity>Normal</t:Sensitivity> 
         <t:DateTimeCreated>2013-05-22T06:51:58Z</t:DateTimeCreated> 
         <t:LastModifiedTime>2013-05-22T06:52:20Z</t:LastModifiedTime> 
         <t:Start>2013-05-16T12:00:00Z</t:Start> 
         <t:End>2013-05-16T12:30:00Z</t:End> 
         <t:IsRecurring>true</t:IsRecurring> 
         <t:CalendarItemType>Exception</t:CalendarItemType> 
        </t:CalendarItem> 
        [snip] 
        Other occurrences removed 
        [snip] 
        </t:Items> 
       </m:RootFolder> 
      </m:FindItemResponseMessage> 
     </m:ResponseMessages> 
     </m:FindItemResponse> 
    </s:Body> 
</s:Envelope> 

konwersji EWSID do HexEntryID w przypadku obu tych identyfikatorów pozycji wyniki:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> 
    <s:Header> 
     <h:ServerVersionInfo MajorVersion="14" MinorVersion="0" MajorBuildNumber="722" MinorBuildNumber="0" Version="Exchange2010" 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:ConvertIdResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"> 
     <m:ResponseMessages> 
      <m:ConvertIdResponseMessage ResponseClass="Success"> 
       <m:ResponseCode>NoError</m:ResponseCode> 
       <m:AlternateId xsi:type="t:AlternateIdType" Format="HexEntryId" Id="0000000082ADE26393957649AD9C74BF97109BC2070084A6175871FF6A40850053554066620A000000000021000084A6175871FF6A40850053554066620A000229AF58AD0000" Mailbox="[email protected]"/> 
      </m:ConvertIdResponseMessage> 
     </m:ResponseMessages> 
     </m:ConvertIdResponse> 
    </s:Body> 
</s:Envelope> 

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> 
    <s:Header> 
     <h:ServerVersionInfo MajorVersion="14" MinorVersion="0" MajorBuildNumber="722" MinorBuildNumber="0" Version="Exchange2010" 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:ConvertIdResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"> 
     <m:ResponseMessages> 
      <m:ConvertIdResponseMessage ResponseClass="Success"> 
       <m:ResponseCode>NoError</m:ResponseCode> 
       <m:AlternateId xsi:type="t:AlternateIdType" Format="HexEntryId" Id="0000000082ADE26393957649AD9C74BF97109BC2070084A6175871FF6A40850053554066620A000000000021000084A6175871FF6A40850053554066620A000229AF58AD0000" Mailbox="[email protected]"/> 
      </m:ConvertIdResponseMessage> 
     </m:ResponseMessages> 
     </m:ConvertIdResponse> 
    </s:Body> 
</s:Envelope> 
+0

Dobrze, że działało! lub przynajmniej jego wersja jest tutaj, w jaki sposób używasz funkcji konwersji z EWS Mangaed API [link] (http://blogs.msdn.com/b/brijs/archive/2010/09/09/how-to-convert -exchange-item-s-entryid-to-ews-unique-itemid-via-ews-managed-api-convertid-call.aspx) –

+0

Po prostu wyjaśnienie, użyjesz EntryID obiektu Termin z Outlooka przekonwertowane na hex za pomocą coś takiego: 'prywatny ciąg statyczny GetObjectIdStringFromUid (id łańcucha) { var buffer = nowy bajt [id.Length/2]; dla (int i = 0; i

0

powołanie Outlook ID otacza zewnętrzne (iCal) identyfikatorów terminu. Trzeba go analizować: http://msdn.microsoft.com/en-us/library/ee157690(v=exchg.80).aspx

+0

Nie jestem pewien, czy podążam za tobą. Czy mówisz, że GlobalAppointementID jest opakowaniem obiektu Exchange ItemID? Nie sądzę, że tak jest, ponieważ ItemID jest dłuższy niż GlobalAppointementID. –

+0

mówię o identyfikatorze powołania, który jest ustawiony, gdy, na przykład, przychodzące żądanie spotkanie w formacie iCal przekształca się spotkanie Outlook.Oryginalny identyfikator spotkania zostanie umieszczony wewnątrz właściwości GlobalAppointementID. Jeśli mówisz o identyfikatorze wpisu, odpowiedź udzielona przez Jana powinna ci pomóc. –

Powiązane problemy