none
[E2007] [EWSMA 1.1] [.NET] Access is denied. Check credentials and try again. message when binding to item RRS feed

  • Question

  • Hi

    In a pull subscription I get a notification about the creation of an item in a public calendar folder. The account that I use to authenticate can log on to OWA and create/delete/edit/save items in the public folder just fine.

    Firstly I bind to the item as Item type which works without errors. I issue the following command for that:

     itm = Item.Bind(service, element.ItemId, smallprops)

    propertyset smallprops just defines itemclass and ID.

    Here is the part of the  trace which shows what properties I request successfully:

     

    <
    m
    :
    ItemShape
    >
    
       <
    t
    :
    BaseShape
    >
    IdOnly</
    t
    :
    BaseShape
    >
    
       <
    t
    :
    AdditionalProperties
    >
    
       <
    t
    :
    FieldURI
     FieldURI
    =
    "
    item:ItemClass
    "
     />
    
       </
    t
    :
    AdditionalProperties
    >
    
      </
    m
    :
    ItemShape
    >
    
    

     

    the response that i  get back is as expected and without errors.

     

    2/28/2011 11:21:57 PM : EwsResponse --- <
    Trace
     Tag
    =
    "
    EwsResponse
    "
     Tid
    =
    "
    1
    "
     Time
    =
    "
    2011-03-01 07:21:57Z
    "
     Version
    =
    "
    14.02.0051.000
    "
    >
    
     <?
    xml
     version
    =
    "
    1.0
    "
     encoding
    =
    "
    utf-8
    "
    ?>
    
     <
    soap
    :
    Envelope
     xmlns:soap
    =
    "
    http://schemas.xmlsoap.org/soap/envelope/
    "
     xmlns:xsi
    =
    "
    http://www.w3.org/2001/XMLSchema-instance
    "
     xmlns:xsd
    =
    "
    http://www.w3.org/2001/XMLSchema
    "
    >
    
     <
    soap
    :
    Header
    >
    
      <
    t
    :
    ServerVersionInfo
     MajorVersion
    =
    "
    8
    "
     MinorVersion
    =
    "
    3
    "
     MajorBuildNumber
    =
    "
    137
    "
     MinorBuildNumber
    =
    "
    0
    "
     Version
    =
    "
    Exchange2007_SP1
    "
     xmlns:t
    =
    "
    http://schemas.microsoft.com/exchange/services/2006/types
    "
     />
    
     </
    soap
    :
    Header
    >
    
     <
    soap
    :
    Body
    >
    
      <
    m
    :
    GetItemResponse
     xmlns:t
    =
    "
    http://schemas.microsoft.com/exchange/services/2006/types
    "
     xmlns:m
    =
    "
    http://schemas.microsoft.com/exchange/services/2006/messages
    "
    >
    
      <
    m
    :
    ResponseMessages
    >
    
       <
    m
    :
    GetItemResponseMessage
     ResponseClass
    =
    "
    Success
    "
    >
    
       <
    m
    :
    ResponseCode
    >
    NoError</
    m
    :
    ResponseCode
    >
    
       <
    m
    :
    Items
    >
    
        <
    t
    :
    CalendarItem
    >
    
        <
    t
    :
    ItemId
     Id
    =
    "
    AQIARgAAAxpEc5CqZhHNm8gAqgAvxFoJAAUov8EGxfpAqA4fl2r38e8DcUd6uFkAAAAFKL/BBsX6QKgOH5dq9/HvA3Fo86SDAAAALgAAAxpEc5CqZhHNm8gAqgAvxFoDAAUov8EGxfpAqA4fl2r38e8DcUd6uFkAAAA=
    "
     ChangeKey
    =
    "
    DwAAABYAAAAFKL/BBsX6QKgOH5dq9/HvA3Fo84x8
    "
     />
    
        <
    t
    :
    ItemClass
    >
    IPM.Appointment</
    t
    :
    ItemClass
    >
    
        </
    t
    :
    CalendarItem
    >
    
       </
    m
    :
    Items
    >
    
       </
    m
    :
    GetItemResponseMessage
    >
    
      </
    m
    :
    ResponseMessages
    >
    
      </
    m
    :
    GetItemResponse
    >
    
     </
    soap
    :
    Body
    >
    
     </
    soap
    :
    Envelope
    >
    
    </
    Trace
    >
    
    

     

    So at this point I have access to the item and I can read some properties!!!

    Knowing that it has an ipm.appointment class I now try to bind to the item as appointment type.

    i issue the following command for that:

    Dim objInput As Appointment = Appointment.Bind(service, element.ItemId, PropsWanted)

    and now all of a sudden it descides that I don't have access to this item!

     

     

    2/28/2011 11:21:58 PM : EwsResponseHttpHeaders --- <
    Trace
     Tag
    =
    "
    EwsResponseHttpHeaders
    "
     Tid
    =
    "
    1
    "
     Time
    =
    "
    2011-03-01 07:21:58Z
    "
    >
    
    200 OK
    Content-Length: 951
    Cache-Control: private, max-age=0
    Content-Type: text/xml; charset=utf-8
    Date: Tue, 01 Mar 2011 07:21:58 GMT
    Server: Microsoft-IIS/6.0
    WWW-Authenticate: Negotiate oYGhMIGeoAMKAQChCwYJKoZIgvcSAQICooGJBIGGYIGDBgkqhkiG9xIBAgICAG90MHKgAwIBBaEDAgEPomYwZKADAgEXol0EW4H33e7CQe0sxHW2zm4CYc3BOciac0B8skB2R7auFIH6g4WCEtBydgrWOZaqDyuwvLvmnroYw5lB8fho2H2DZMJqOEsClz7fPywshNG4Hd6P5uT2QyaNQWjyJoQ=
    X-AspNet-Version: 2.0.50727
    X-Powered-By: ASP.NET
    
    
    </
    Trace
    >
    
    
    2/28/2011 11:21:58 PM : EwsResponse --- <
    Trace
     Tag
    =
    "
    EwsResponse
    "
     Tid
    =
    "
    1
    "
     Time
    =
    "
    2011-03-01 07:21:58Z
    "
     Version
    =
    "
    14.02.0051.000
    "
    >
    
     <?
    xml
     version
    =
    "
    1.0
    "
     encoding
    =
    "
    utf-8
    "
    ?>
    
     <
    soap
    :
    Envelope
     xmlns:soap
    =
    "
    http://schemas.xmlsoap.org/soap/envelope/
    "
     xmlns:xsi
    =
    "
    http://www.w3.org/2001/XMLSchema-instance
    "
     xmlns:xsd
    =
    "
    http://www.w3.org/2001/XMLSchema
    "
    >
    
     <
    soap
    :
    Header
    >
    
      <
    t
    :
    ServerVersionInfo
     MajorVersion
    =
    "
    8
    "
     MinorVersion
    =
    "
    3
    "
     MajorBuildNumber
    =
    "
    137
    "
     MinorBuildNumber
    =
    "
    0
    "
     Version
    =
    "
    Exchange2007_SP1
    "
     xmlns:t
    =
    "
    http://schemas.microsoft.com/exchange/services/2006/types
    "
     />
    
     </
    soap
    :
    Header
    >
    
     <
    soap
    :
    Body
    >
    
      <
    m
    :
    GetItemResponse
     xmlns:t
    =
    "
    http://schemas.microsoft.com/exchange/services/2006/types
    "
     xmlns:m
    =
    "
    http://schemas.microsoft.com/exchange/services/2006/messages
    "
    >
    
      <
    m
    :
    ResponseMessages
    >
    
       <
    m
    :
    GetItemResponseMessage
     ResponseClass
    =
    "
    Error
    "
    >
    
       <
    m
    :
    MessageText
    >
    Access is denied. Check credentials and try again.</
    m
    :
    MessageText
    >
    
       <
    m
    :
    ResponseCode
    >
    ErrorAccessDenied</
    m
    :
    ResponseCode
    >
    
       <
    m
    :
    DescriptiveLinkKey
    >
    0</
    m
    :
    DescriptiveLinkKey
    >
    
       <
    m
    :
    Items
     />
    
       </
    m
    :
    GetItemResponseMessage
    >
    
      </
    m
    :
    ResponseMessages
    >
    
      </
    m
    :
    GetItemResponse
    >
    
     </
    soap
    :
    Body
    >
    
     </
    soap
    :
    Envelope
    >
    
    </
    Trace
    >
    
    

     

    The same code runs on a number of other 2010 and 2007 server without issues. 

    The account that I use to bind to this item can be used to login to OWA with the full primary SMTP address (the same address as used in EWS) and then it can create, edit and save items in that public folder.

    The public folder store is on the same server as the mailbox store, there is only one exchange server.

    In order to make autodiscover work we had to add the domain suffice for the external domain and select that in the account dropdown for the account. Maybe that is relevant, maybe not.

    The server runs windows 2003(x64) and exchange 2007 sp3. (it was on sp1 rollup 10 previously but upgrading the SP did not help)

    Using the EWS managed API the account can create and delete a test item in the public folder.

    Also tried giving the account full control on the public folder store from AD Sites and Services but nothing helps.

     

    Every suggestion is highly appreciated because I am out of things to try.

     

    edit. here is the stacktrace:

    Access is denied. Check credentials and try again.

     ================================================

    stacktrace:    at Microsoft.Exchange.WebServices.Data.ServiceResponse.InternalThrowIfNecessary()

       at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()

       at Microsoft.Exchange.WebServices.Data.ExchangeService.InternalBindToItems(IEnumerable`1 itemIds, PropertySet propertySet, ServiceErrorHandling errorHandling)

       at Microsoft.Exchange.WebServices.Data.ExchangeService.BindToItem(ItemId itemId, PropertySet propertySet)

       at Microsoft.Exchange.WebServices.Data.ExchangeService.BindToItem[TItem](ItemId itemId, PropertySet propertySet)

       at ExchangeGroupCalendar_EWS.Module1.PollForEvents(ExchangeService service, Int32 i)

     

     


    Thanks, John
    Tuesday, March 1, 2011 9:11 AM