Search code examples
exchange-serverexchangewebservicesexchange-server-2007

Exchange2007 WebServices - AddDelegate


Im working with Microsoft Exchange WS 2007 (JAX-WS) and need to use the delegate functionality.

I have created a Java client which generates a SOAP request which adds delegate access.

<AddDelegate xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<Mailbox>
    <t:EmailAddress>delegateEmail@mail.com</t:EmailAddress>
</Mailbox>
<DelegateUsers>
   <t:DelegateUser>
      <t:UserId>
         <t:PrimarySmtpAddress>primaryEmail@mail.com</t:PrimarySmtpAddress>
      </t:UserId>
      <t:DelegatePermissions>           
         <t:CalendarFolderPermissionLevel>
            Editor
         </t:CalendarFolderPermissionLevel>
      </t:DelegatePermissions>  
      <t:ReceiveCopiesOfMeetingMessages>
         false
      </t:ReceiveCopiesOfMeetingMessages>
      <t:ViewPrivateItems>
         false
      </t:ViewPrivateItems>
   </t:DelegateUser>
</DelegateUsers>
<DeliverMeetingRequests>DelegatesAndMe</DeliverMeetingRequests>

The response contains success code. Then to verify the addDelegate method i call the getDelegate operation which displays the new primary address i have added. However when i try and book an outlook resource using the createItem EWS operation using delegate email address i get this message;

The specified object was not found in the store

Also if i open my outlook desktop client and navigate to tools -> options -> delegates tab there are no delegates present.

If i add the delegate through the desktop client and then call my createItem operation it works fine. I want to be able do this for other users however without having to ask them manually add the delegate.

Any idea why this behavior is happening?


Solution

  • I was able to use the EWSEditor http://archive.msdn.microsoft.com/ewseditor which allowed me to discover that i was assigning delegate permissions to the wrong smtp account. Once i corrected this mistake the process worked.