Interacting with the Exchange Web Services

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Interacting with the Exchange Web Services - Presentation Transcript

    1. 9 October, 2008
      Interacting with the Exchange Web Services, by Wim De Coninck
    2. Exchange Web Services Architecture
      9 October, 2008
      Interacting with the Exchange Web Services,by Wim De Coninck
      2
    3. Exchange Web Service: Whatcan we do withit?
      Interacting with the Exchange Web Services,by Wim De Coninck
      9 October, 2008
      • Autodiscover
      • Calendaring
      • Contact
      • Folder
      • Server Management
      • Messaging
      • MIME
      • Security
      • Store EventSinks
      • Store Schemas
      • Store
      • Synchronization
      • Task Item
      • Utility
      • Notification
      • Web services
      3
    4. Creating a basic contact
      4
      Interacting with the Exchange Web Services,by Wim De Coninck
      9 October, 2008
      • Instantiate a ContactItemType
      • Set somepropertieson the contact
      • Specify the folder whereyou want the contact
      • Instantiate a CreateItemType
      • Add the contact to the createItem
      • Invoke the CreateItemmethodon the webservice.
      • Process the response of the CreateItemmethod.
    5. Zooming in...
      To set email addresson a contact, create a new List of EmailAddressDictionaryEntryType and add the email address to the array, thenadd the array to the contact’s email addressesproperty…
      var contact = newContactItemType();
      varemails = newList<EmailAddressDictionaryEntryType>
                      {
                          newEmailAddressDictionaryEntryType
                              {
                                  Key = EmailAddressKeyType.EmailAddress1,
                                  Value = "mail1@example.com"
                              },
                          newEmailAddressDictionaryEntryType
                              {
                                  Key = EmailAddressKeyType.EmailAddress1,
                                  Value = "mail2@example.com"
                              }
                      };
      contact.EmailAddresses = emails.ToArray();
      Imaginedoingthis pre Framework 3.5
      9 October, 2008
      Interacting with the Exchange Web Services,by Wim De Coninck
      5
    6. 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
    7. 7
      Interacting with the Exchange Web Services,by Wim De Coninck
      9 October, 2008
    8. 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
    9. 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
    10. 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
    11. 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
    12. 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);
    13. Resources
      http://msdn.microsoft.com/en-us/library/bb408417.aspx
      9 October, 2008
      Interacting with the Exchange Web Services,by Wim De Coninck
      13
    14. 14
      Interacting with the Exchange Web Services,by Wim De Coninck
      9 October, 2008

    + Orbit One Internet SolutionsOrbit One Internet Solutions, 1 month ago

    custom

    252 views, 0 favs, 0 embeds more stats

    Tips on using Exchange Web Services to create Conta more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 252
      • 252 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 6
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories