1-888-365-2779
+1-888-365-2779
Try Now
More in this section
Categories
Bloggers
Blogs RSS feed

Let Sitefinity Implement Web Services for You

by Peter Filipov

With Progress Sitefinity, you can create dynamic content types without any overhead. Editing content items is also really easy. But while all of this sounds great on paper, developers ultimately need to have more control via an API.

With the .NET managers, you are able to manipulate the items, but this is from C# code and it doesn’t work on the client side. To invoke some functionality from there, you have to implement custom web services and expose an endpoint in the backend. The process for this is straightforward but you may feel that this can be automated somehow… and it can! With Sitefinity, you are able to create a web service with OData support for each content type

Creating a Web Service—The Easy Way

To showcase how this is done, I am going to use the Quantum sample application. Go to Administration>Web services and create a new web service.

The URL is generated directly from the name of the web service and, in case you want to shorten it, you have the option to change it.

The next option is to setup the permissions. When the access to the web services requires authentication, you should log in to the system via a specific end point and then use the generated token in order to request the data. Here is one Postman collection that can be used as a reference.

The next step is choosing which content type to expose.

We recommend selecting only the content types that you need. It is better to have many services doing one thing instead of one service giving access to all of the data types, as this will eventually become nearly unmanageable at some point.

One powerful feature here is that each content type can be fine-tuned separately, from access level to the used fields.

On a service level, you are able to control whether you want to automatically add the newly created content types to the web service. On a content level, this can be applied to the newly added fields. With that option, you don’t have to configure the service each time when a change is applied to your data schema.   

Start with Examples

Click on the “Use in your app” link on the right side of the web service and a RESTful API documentation will appear. Everything there is described in detail, including how it should be used. 

The generated help is great, but I would like to go one step further and give you a collection in Postman that will make it far easier for you to get started. This collection will be particularly helpful if you don’t have much experience with OData.

Once you are familiar with the above, there will come a moment when you want to bind some controls to your data. We recommend that you stick with Kendo UI. Head over to GitHub to find samples that will help you integrate the end points with the widgets.

If you want to use third-party components, you should use the JavaScript SDK, which will save you a ton of time and energy.

Conclusion

Progress advocates for the usage of the built-in services instead of creating new ones from scratch. With the web service builder, you are able to accomplish every scenario that you may want and save time that you can invest in other mission-critical parts of your projects.

With each release, new optimizations are made—for example, with version 9.2, the optimizations affect fields of Тaxonomies type and statically linked relations (child->parent, /item?$expand=Parent) and validation checks for different fields[NG1] . The improvements and new features are numerous and can be found in the documentation. Our goal is to provide you with everything out of the box without the need to write additional code. Share your suggestions and the development team can turn them into reality.

.

5 comments

Leave a comment
  1. Fran San Apr 19, 2017

    Thanks for the post.

    One question: What about getting child items of a dynamic content type?

    I saw I can get the parent ID and expand the parent, but I can't figure it out for nested items.

  2. Opus May 17, 2017
    In what version was this first implemented in?
  3. Peter May 17, 2017

    Hi Opus,

    The firts implementation comes with 9.0. In version 9.2. we made many improvements. For details you can review the following links:

    http://www.sitefinity.com/developer-network/forums/general-discussions-/sitefinity-9.2-released

    http://www.sitefinity.com/developer-network/forums/general-discussions-/sitefinity-9.0-released

    Peter

  4. asus router login Jul 26, 2017
    Frontier offers simple instructions on how to change your Netgear 7550 password. Navigate Enter the modem username admin and the password admin.
  5. asus router login Jul 26, 2017
    Frontier offers simple instructions on how to change your Netgear 7550 password. Navigate Enter the modem username admin and the password admin. asus router login

    Leave a comment