26. Anextendedproperty is a propertythatcanbe set onan item butwhich is notpresentedthrough the webservice out of the box. For instance the gender of a contact. In this case we wouldcreate a newExtendedproperty. The ExtendedFieldURI of thatproperty is a path to extended field type whichmaps to a propertythat is visible in outlook. The item willcontain the valuethat is to bedisplayed in the specified field. ExtendedPropertyTypegender = newExtendedPropertyType(); gender.ExtendedFieldURI = newPathToExtendedFieldType(); gender.ExtendedFieldURI.PropertyTag = "0x3a4d"; gender.ExtendedFieldURI.PropertyType = MapiPropertyTypeType.Short; gender.Item = ((int)pGender).ToString(); ExtendedProperties Interacting with the Exchange Web Services,by Wim De Coninck 9 October, 2008 6
27. 7 Interacting with the Exchange Web Services,by Wim De Coninck 9 October, 2008
28. Distribution List Youcan’tcreate a distribution list. The CreateItem web method does notallowyou to add a DistributionList. How do we workaroundthat ? Createan itemtype and addextendedproperties ‘tillitbecomes a distributionlist, and set the ItemClass to IPM.DistList 9 October, 2008 Interacting with the Exchange Web Services,by Wim De Coninck 8
29. Adding the members WARNING: 2 Extendedproperties: Member OneOffMember Both expect a BinaryArray. They are limited to 15000 bytes, (about 140 contact entries) Foreach entry in memberthere must bean entry in oneOffMember at the same index. BinaryArrayequals Base64String[] 9 October, 2008 Interacting with the Exchange Web Services,by Wim De Coninck 9
30. Member A membercontains a link to contact through a hexed entry id. What we have is the ItemId and the ConvertId web method. ConvertIdTypeconvertReq = newConvertIdType(); convertReq.DestinationFormat = IdFormatType.HexEntryId; convertReq.SourceIds = new[] { newAlternateIdType() { Format = IdFormatType.EntryId, Mailbox = "administrator@litwareinc.com", Id = item.ItemId.Id } }; ConvertIdResponseType response = esb.ConvertId(convertReq); 9 October, 2008 Interacting with the Exchange Web Services,by Wim De Coninck 10
31. Member: the actual base 64 string The wrapped entry id is what we want in the base 64 string. Prefix of wrapped entry id = 00000000C091ADD3519DCF11A4A900AA0047FAA4C300000000 The response contains a stringwith bytes. We onlyneed part a of the retreivedstring. 0003240033636237313064392D323134342D343761632D626137612D393730646364656335343664004600000000002F6E0D571298F14DA8E47B5FEDAA78A507001DD4ACE8303DD54F87DD53DA592670810001F3D7468A00000988B48B0E4D054284347C283576FD020424930B44BC0000 9 October, 2008 Interacting with the Exchange Web Services,by Wim De Coninck 11
32. OneOffMember 12 Interacting with the Exchange Web Services,by Wim De Coninck 9 October, 2008 varretval = newList<byte>(); varflags = Encoding.Unicode.GetBytes(""); varversion = Encoding.Unicode.GetBytes(""); var pad = Encoding.Unicode.GetBytes(""); varmuid = newbyte[] { 0x81, 0x2b, 0x1f, 0xa4, 0xbe, 0xa3, 0x10, 0x19, 0x9d, 0x6e, 0x00, 0xdd, 0x01, 0x0f, 0x54, 0x02 }; varwFlags = newbyte[] { 0x01, 0x90 }; varfirst = Encoding.Unicode.GetBytes(“contactname(email@d.com)”); varmiddle = Encoding.Unicode.GetBytes("UNKNOWN"); var last = Encoding.Unicode.GetBytes(“email@d.com”); retval.AddRange(flags); retval.AddRange(muid); retval.AddRange(version); retval.AddRange(wFlags); retval.AddRange(first); retval.AddRange(pad); retval.AddRange(middle); retval.AddRange(pad); retval.AddRange(last); retval.AddRange(pad);