3
foreach (System.Globalization.CultureInfo ci in System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.AllCultures))
        {
             KeywordData keyword = (KeywordData)client.GetDefaultData(ItemType.Keyword, category.Id);
           // Tridion.KeywordData keyword = (Tridion.KeywordData)client.GetDefaultData(Tridion.ItemType.Keyword, category.Id);
            keyword.Id = "tcm:0-0-0";
            keyword.Title = ci.TextInfo.CultureName;
            keyword.Key = ci.TextInfo.CultureName;
            //keyword.Title = "Sea-web the ultimate marine online database";
            //keyword.Key = null;
            keyword = (KeywordData)client.Create(keyword, new ReadOptions()) as KeywordData;
            //  client.Create(keyword, null);
        }

here am getting error in

KeywordData keyword = (KeywordData)client.GetDefaultData(ItemType.Keyword, category.Id);

GetDefaultData

Exception: FaultException There are no arguments corresponds to the given parameter "ReadOptions"

I dont Know where am going wrong as am new to core service can some one help with the sample code if possible

1

1 Answer 1

1

Looking at the Core Service CHM document, it appears that the GetDefaultData method expects three arguments to be passed in:

IdentifiableObjectData GetDefaultData(
ItemType itemType,
string containerId,
ReadOptions readOptions)

Therefore, I think that this line:

KeywordData keyword = (KeywordData)client.GetDefaultData(ItemType.Keyword, category.Id);

Needs to be changed to:

KeywordData keyword = (KeywordData)client.GetDefaultData(ItemType.Keyword, category.Id, new ReadOptions());

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.