none
Access Denied when writing to Managed Metadata RRS feed

  • Question

  • Hi,

    I have a web service which is used to add data to sharepoint using server-side code. I have a issue about writing to Managed Metadata field and it always show "Access is denied". The web service is using different application pool with sharepoint. If we use the sharepoint's application pool, it will work.

    Btw, I have set the id of web service's application with a farm administrator user. This user can do everything on the Managed Metadata field in the UI of sharepoint site.

    Here is error info:

     System.Exception: Error writing Managed Metadata field 'Category' ---> System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
        at Microsoft.SharePoint.SPGlobal.HandleUnauthorizedAccessException(UnauthorizedAccessException ex)
        at Microsoft.SharePoint.Library.SPRequest.GetWebMetainfo(String bstrUrl)
        at Microsoft.SharePoint.SPWeb.GetProperties()
        at Microsoft.SharePoint.Utilities.SPPropertyBag..ctor(GetProperties getProperties, UpdateProperties updateProperties)
        at Microsoft.SharePoint.SPWeb.get_Properties()
        at Microsoft.SharePoint.Taxonomy.TaxonomyField.GetLookupListHelper(SPSite site)
        at Microsoft.SharePoint.Taxonomy.TaxonomyField.GetLookupList(SPSite site)
        at Microsoft.SharePoint.Taxonomy.TaxonomyField.<>c__DisplayClass16.<TryGetWssIdsOfTerm>b__13()
        at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass5.<RunWithElevatedPrivileges>b__3()
        at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)
        at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param)
        at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode)
        at Microsoft.SharePoint.Taxonomy.TaxonomyField.TryGetWssIdsOfTerm(SPSite site, TermStore termStore, Guid termSet, Guid term, Int32 limit, List`1& itemIds)
        at Microsoft.SharePoint.Taxonomy.TaxonomyField.GetWssIdsOfTerm(Guid localSspId, Guid termId, List`1& itemIds)
        at Microsoft.SharePoint.Taxonomy.TaxonomyField.ValidateTaxonomyFieldValue(TaxonomyFieldValue taxFieldValue)
        at Microsoft.SharePoint.Taxonomy.TaxonomyField.ValidTaxonomyFieldValue(TaxonomyFieldValue taxFieldValue)
        at Microsoft.SharePoint.Taxonomy.TaxonomyField.GetValidatedString(Object value)
        at Microsoft.SharePoint.Taxonomy.TaxonomyField.SetFieldValue(SPListItem item, TaxonomyFieldValue taxValue)
        at Microsoft.SharePoint.Taxonomy.TaxonomyField.SetFieldValue(SPListItem item, Term term, Int32 lcid)

    William

    Thursday, March 9, 2017 9:15 AM

All replies