Exchange ItemID differs from GlobalAppointmentID for Outlook AddIn -
the problem i'm having globalappointmentid of outlook appointement created using outlook formregion differs of itemid when using ews managed api.
i'm creating outlook addin allows users add customer , project information meeting. addin stores appointment id , meeting data in database , service periodically check id update appointment data.
ok here how use addin:
outlook.appointmentitem appointement = (outlook.appointmentitem)this.outlookitem; appointement.save(); string exchangeid = appointement.globalappointmentid;
here globalappointmentid is: 040000008200e00074c5b7101a82e0080000000060cadc517255ce01000000000000000010000000847a9cd89052dc49ba28dc8aafbbb4ba
but ews managed api expects like: aamkadvintjlztg5ltiwywmtngy3my1howziltziotm3otk3nzk1yqbgaaaaaaaefbmehamsrzur9avsphpmbwcysaa5hwpmransowsnkrckaaaaxal/aacysaa5hwpmransowsnkrckaaaaxcxwaaa=
to bind appointmentitem service. there option solve using auto-generated proxies , not managed api link proxy solution
so there way either ews managed api search globalappointementid or outlook addin retrieve itemid?
the ids can represented different ways. outlook uses first form, ews second.
to convert, use convertid method.
here example request/response calls in raw soap format (with these examples, should able implement them 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="user@domain.com"/> </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="user@domain.com"/> </m:convertidresponsemessage> </m:responsemessages> </m:convertidresponse> </s:body> </s:envelope>
exchange ewsid outlook 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="user@domain.com"/> </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="user@domain.com"/> </m:convertidresponsemessage> </m:responsemessages> </m:convertidresponse> </s:body> </s:envelope>
note there difference in using these 2 types of id's when using recurring appointments , occurrences:
ews ids differ every single occurrence, outlook hex entry id identical all:
finditem response recurring event 1 exception - note different 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 1 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>
conversion ewsid hexentryid both these itemids results in
<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="user@domain.com"/> </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="user@domain.com"/> </m:convertidresponsemessage> </m:responsemessages> </m:convertidresponse> </s:body> </s:envelope>
Comments
Post a Comment