I have been doing some reading on Sitecore.Services.Client framework for a project for which I am required to use and consume Sitecore as a data repository. The data in Sitecore will be some Html content blocks as well as some Dictionary items for the pages that are not hosted in Sitecore CMS. What are the minimum Sitecore assemblies I should need to reference in my project?
-
This setup intrigues me. Are you storing the HTML as a field value? Or getting html from rendered presentstion?– Pete NavarraCommented Oct 31, 2016 at 19:21
-
I am trying to create an EntityService controller and an ItemService controller to fetch data as needed from Sitecore. Also, I need to understand how can I call these services from JavaScript.– Hetal DaveCommented Nov 1, 2016 at 12:53
-
Off the cuff, I'd advise taking a look at how Sitecore (through SPEAKUI) is using AJAX to call JSON service controllers to fetch item formation. You might be able to more effectively create a SPEAKUI application that provides the functionality you're looking for.– Pete NavarraCommented Nov 1, 2016 at 13:13
2 Answers
As per the Sitecore Nuget feed, https://sitecore.myget.org/feed/sc-packages/package/nuget/Sitecore.Services.Client, these are the required assemblies/frameworks needed by the Sitecore.Services.Client
assembly:
- .NET Framework 4.5 (or higher depending on the Sitecore version being used)
- Sitecore.Kernel
- Sitecore.Services.Core
- Microsoft.Extensions.DependencyInjection.Abstractions (= 1.0.0)
-
1The naming is a bit confusing here. The documentation and config file refer to
Sitecore.Services.Client
, but in order to use the API, you do not reference that dll. You need to referenceSitecore.Services.Core
, if anything. Commented Nov 1, 2016 at 23:55 -
You don't need to reference any Sitecore dlls in order to be able to use the Sitecore REST API. These APIs are defined in the developer's guide available on SDN.
(This document does not seem to have been ported to doc.sitecore.net yet, so SDN is where you need to get it.)
Referencing Sitecore.Services.Core
will give you access to a .NET API, so you aren't working with REST calls directly.
Ironically, you don't need to reference Sitecore.Services.Client
. That dll is used during installation. It is highly unlikely you need to reference this assembly in your project.