Categories
Bloggers
Blogs RSS feed

Why are Sitefinity 4.0 Web Services good?

by Gabe Sumner

In past webinars & videos we’ve talked a lot about Sitefinity 4.0 being AJAXy.  Without becoming embroiled in a technical conversation, this simply means that Sitefinity’s Administrative UI can respond to many of your requests without loading a brand new web page. 

Instead of loading a new web page, Sitefinity only updates the part of the web page that needs changed.  This results in better performance and reduces the load on the web server.  Sitefinity is doing the minimum amount of work needed to respond to your request.

Behind the scenes, this is being handled through Sitefinity’s Web Services.  Web Services, just like web pages, are accessed using a URL.  However, instead of displaying human-readable HTML, these web services return raw data (typically represented with XML or JSON).  This data is retrieved by the web browser and then acted upon (locally) using client-side Javascript. 

This gives the illusion of a self-contained client-side web application although, in reality, there are lots of micro-transactions going back & forth between the web browser and the Sitefinity web site.  (If you don’t believe me, use Fiddler to watch the conversation between your web browser & Sitefinity.)

From a usability perspective all of this is a big win.  This makes Sitefinity feel a lot more responsive.

Can you type a URL?  Then you can access a Web Service

As I mentioned, Sitefinity’s web services can be accessed using a traditional URL.  Furthermore, Sitefinity’s web services will respond to any properly formed (and authenticated) web request.   If you’re interested in testing this, create a local Sitefinity 4.0 BETA web site and access the following URL:

http://localhost:4000/sitefinity/services/pages/PagesService.svc/

JSON data being returned from a Sitefinity 4.0 web service

The service URL shown above simply returns a list of Sitefinity pages using JSON.  If you don’t have any pages created, then you’ll get 0 results.  Firefox & IE will download (as a file) these JSON results.  Chrome, however, displays this data in the browser.

There are tons of Sitefinity 4.0 web services available for Sitefinity’s various content types.  For any of these web service you can append “help” to the end of the URL to see usage instructions:

http://localhost:4000/sitefinity/services/pages/PagesService.svc/help

Help for Sitefinity 4.0 Web Services

IE appears to be the only web browser that displays the help pages in an easily readable format.

The client is irrelevant

Upon first glance, this may not seem very useful.  However, this opens a limitless number of possibilities.  Sitefinity’s Administrate UI is simply a client that accesses these web service URLs to manage the web site.  This means Sitefinity’s Administrative UI is irrelevant.  We don’t need it.  All the real work is being done through the web services.  Furthermore, if a device can hit a URL, then it can also manage a Sitefinity web site.

This means we could create new administrative interfaces for…

  • Windows
  • Linux
  • Mac
  • iPhone
  • iPad
  • Windows Phone 7
  • Android
  • Silverlight
  • Flash
  • Etc, etc, etc.


Each of these clients (just like Sitefinity’s official web-based UI) will make small requests to Sitefinity’s web services to fetch & manage data.  Once this data is retrieved, it can be displayed in whatever format developers deem best for the device.

Free your data

Creating new administrative user-interfaces is interesting, but this raw data can also be exchanged between computers.  This makes it easier than ever for Sitefinity to work alongside other systems.  This includes:

  • Other CMS’s
  • Business applications
  • SharePoint
  • Customer Relationship Management (CRM) applications
  • Document Management Systems (DMS)
  • Etc, etc, etc.


The reality of many CMS deployments is that the CMS sits in the midst of a diverse heterogeneous environment.  These other systems may not be .NET or Windows based.  Web Services, because they are utilized through URLs, are platform agnostic.  This makes Sitefinity data more accessible than ever.  Data can be migrated into or out of the CMS at any time.

Samples Coming…

In this blog post, I simply wanted to introduce the concepts and explore some of the advantages of Sitefinity’s web services.  In future blog posts I’ll explore the technical details.  In the meantime, checkout the Client-Side documentation in the Sitefinity 4.0 developer manual.

6 comments

Leave a comment
  1. Steve Sep 17, 2010
    How is security managed with REST?

    I assume not just anyone can query my .svc files
  2. Gabe Sumner Sep 17, 2010
    Sitefinity's web services are bound by the same permissions applied to content in the CMS.  An anonymous web request could not modify pages or view pages that require special permissions.  The web service data and functionality is limited by the permissions associated with your profile.  

    A follow-up question (in case Lino is watching) is "How do we authenticate through web services?".  I don't yet have an answer for this, but we'll certainly explore this topic soon.

    You'll quickly discover that there is a lot you can't do anonymously with Sitefinity's web services.  This is appropriate though.  You certainly don't want random web service use causing havoc on the web site.
  3. Lino Tadros Sep 17, 2010
    Thanks Gabe for the article.  I can't wait till the authentication APIs through the REST services start working as we have huge plans for Sitefinity 4 and administration though devices.
  4. Burl Sep 22, 2010
    Hi Gabe,
    Looking forward to the "How do we authenticate through web services?" blog with a plugable modules.
  5. Jonny Apr 18, 2011
    Hi Gabe,

    Any samples coming?

    Thanks, JP
  6. Dave Lively Mar 01, 2012
    It'd be really, really nice if we could pass credentials in the URL or something. Since these appear to be WCF services, it's annoying not to be able to bind to them from a Winforms or console app client without jumping through serious hoops.

    Leave a comment