5

I am doing some investigation work using the Tridion APIs. I'm hoping there is a Visual Studio project out there that gets me started in terms of connecting to Tridion, calling Core Service APIs through .net.

Does anything exist? Or can anyone help me get started. I do have a bit of a learning curve here as I'm a Java developer rather than a .net one! Any help will be appreciated.

Thanks Marc

6

I have written a small tutorial about creating a core service client and reading checked-out items here.

The Core Service DLL is in the Tridion/bin/client folder and is referenced in Visual Studio. Together, with the config, this will allow you to connect to Tridion. You don't need to be on the server for it to work, as long as the ports are open. Most of the times the http Basic protocol will work since it uses port 80.

After you have a basic client working, then you'll be ready to start playing with the code.

The client.Read method is where you'll do most of your work, and you'll cast the result to a 'Data' object, like a ComponentData or PageData class. Not that some methods will be using the ComponentData class. I documented the object hierarchy of the 'Data' objects here.

However, note that some methods are from the CoreService client while others are on the returned object.

The implementation is a WCF .Net web service, so any info you read about those will be relevant to the Core Service.

Finally, if you're getting a list of items back, you'll want to find the magic filter to apply to the list, and there's lots of blogs or questions on StackExchange about getting lists and the items. Generally, the performance of getting a list from one folder is much faster and if you can specify a Filter or ReadOptions that gives you enough info in the returned list items - great! Otherwise, you'll need to get each item as it's own ComponentData or PageData within the loop of the results, and this is much slower, especially if dealing with hundreds or thousands.

I hope this helps you get started, and come back here with some more specific questions.

| improve this answer | |
2

You may also want to take a look through the patterns and code within the Tridion Practice Project.

There are a number of Core Service 'recipes' there, including:

  • GetCoreServiceClientWithoutConfigFile
  • GetCoreServiceClientWithConfigFile
  • ChangeContentOrMetadata
  • CreatingANewPublication
| improve this answer | |
2

You can refer this link shared by Chris Morgan:

https://code.msdn.microsoft.com/SDL-Tridion-Core-Service-17f4660b

for Core Service sample project.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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