none
Web Service For Managed Metadata Term Store RRS feed

  • Question

  • Hi.

    Is there a web service published that can be connected to (and/or consumed by external applications) for a managed metadata term store?

    e.g. for lists there is the ListData.svc web service that can be used for CRUD operations on lists.  Is there similar for term stores?

    Tuesday, December 3, 2013 3:03 PM

Answers

  • Hello,

    TaxonomyClientService.asmx has no update and delete method. You will only see below methods:

    • AddTerms
    • GetChildTermsInTerm
    • GetChildTermsInTermSet
    • GetKeywordTermsByGuids
    • GetTermSets
    • GetTermsByLabel

    To overcome this, could you try with client object model to update existing term?

    String server = "http://siteurl/";
    using(ClientContext clientContext = new ClientContext(server))
    {
    List list = clientContext.Web.Lists.GetByTitle("test");
    List taxonomyList = clientContext.Web.Lists.GetByTitle("TaxonomyHiddenList");
    CamlQuery camlQueryForTerm = new CamlQuery();
    camlQueryForTerm.ViewXml = @"Color";
    ListItemCollection termItems = taxonomyList.GetItems(camlQueryForTerm);
    clientContext.Load(termItems);
    clientContext.ExecuteQuery();
    ListItem termItem = termItems[0];
    String termValue = termItem["ID"] + ";#" + termItem["Term"] + "|" + termItem["IdForTerm"];
    ListItemCreationInformation itemCreateInfo = new ListItemCreationInformation();
    ListItem item = list.AddItem(itemCreateInfo);
    item["MyTestcol"] = termValue;
    
    item.Update();
    }
    Hope it could help


    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

    Friday, December 13, 2013 9:09 AM
    Moderator

All replies

  • Hi,

    You can try using the TaxonomyClientService.asmx: http://[your site url]/_vti_bin/TaxonomyClientService.asmx.

    To see the available methods go here: TaxonomyClientService Methods.

    Cheers,

    Dan.


    You can find my blog here: http://developertrack.blogspot.com

    Tuesday, December 3, 2013 3:15 PM
  • As per my understanding there is no web service which allows you to connect to managed metadata term store directly. I could be wrong but I could not find any trace of this at the SharePoint 2010 Web Services

    Amit

    Tuesday, December 3, 2013 3:16 PM
  • @Dan do you know of an example of using this web service from an external system?

    For example, if I wanted to add terms to the term store by consuming this web service and pushing data to it from another system.

    • Edited by motionpotion Tuesday, December 3, 2013 4:16 PM updated question
    Tuesday, December 3, 2013 4:11 PM
  • @Amit, looks like it is not listed at the link for the Foundation web services but @Dan has linked to the TaxonomyClientService.asmx above.
    Tuesday, December 3, 2013 4:14 PM
  • Looks like there is no Delete or Update in the TaxonomyClientService.asmx.  

    Is this a full implementation of a web service or an afterthought?

    Tuesday, December 3, 2013 4:58 PM
  • Hello,

    TaxonomyClientService.asmx has no update and delete method. You will only see below methods:

    • AddTerms
    • GetChildTermsInTerm
    • GetChildTermsInTermSet
    • GetKeywordTermsByGuids
    • GetTermSets
    • GetTermsByLabel

    To overcome this, could you try with client object model to update existing term?

    String server = "http://siteurl/";
    using(ClientContext clientContext = new ClientContext(server))
    {
    List list = clientContext.Web.Lists.GetByTitle("test");
    List taxonomyList = clientContext.Web.Lists.GetByTitle("TaxonomyHiddenList");
    CamlQuery camlQueryForTerm = new CamlQuery();
    camlQueryForTerm.ViewXml = @"Color";
    ListItemCollection termItems = taxonomyList.GetItems(camlQueryForTerm);
    clientContext.Load(termItems);
    clientContext.ExecuteQuery();
    ListItem termItem = termItems[0];
    String termValue = termItem["ID"] + ";#" + termItem["Term"] + "|" + termItem["IdForTerm"];
    ListItemCreationInformation itemCreateInfo = new ListItemCreationInformation();
    ListItem item = list.AddItem(itemCreateInfo);
    item["MyTestcol"] = termValue;
    
    item.Update();
    }
    Hope it could help


    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

    Friday, December 13, 2013 9:09 AM
    Moderator