Wednesday, February 26, 2014

Object of type System.Int32 cannot be converted to type System.Web.Security.Cryptography.Purpose

When you open the Sitecore Admin and Try to login you get this error:  

Well John West has the solution. This blog post explains how you can resolve the Object of type 'System.Int32' cannot be converted to type 'System.Web.Security.Cryptography.Purpose' error that you may receive when you try to access a user interface in the Sitecore ASP.NET web Content Management System (CMS) after installing Visual Studio 2012 or .NET 4.5. 

Check out the blog article

Thanks John you saved me some time and hopefully will save others on the Guild some time as well.

If you have any tips, tricks or resources you would like shared with the Guild please email them to me at and I will post them here.

Saturday, February 22, 2014

Accessing A Sitecore Item From an External Application

In order to access a Sitecore Item outside of Sitecore you need to use the Sitecore Web Services or

Step 1: Register the Sitecore Web Service with your application.  This is done by adding a reference.
You want a web reference not a service reference so be sure to click Advanced and click Web Reference.
The service can be found at

http://{sitecore server url}/sitecore/shell/WebService/service.asmx?wsdl

Step 2: If you require getting item by Sitecore Path then you need to my Sitecore Get Item Id For Item Path Web Service Module in Marketplace. You would place the dll in the right folder and the asmx in the services folder to access it.

Step 3: Connect to the web service and get the item path for the id.  If you already have the path then ignore this step.
                com.scws.itempath.ItemPathService service = new com.scws.itempath.ItemPathService();
                service.Url = serverUrl + "/sitecore/shell/webservice/ItemPathService.asmx";
                string itemId = service.GetItemId(databaseName, itemPath);
                                return "<dataset><item_id>" + itemId + "</item_id></dataset>";

Step 4: Get the item based on the Sitecore Path.  The service returns an xml but you then wrap it in dataset tags and you can stuff it in a dataset to query it.  NOTE: Replace {sitecore_path} with the path you want to retrieve the item for.

            com.scws.Credentials cred = new com.scws.Credentials();
            cred.UserName = userName;
            cred.Password = password;
            com.scws.VisualSitecoreService service = new com.scws.VisualSitecoreService();
            service.Url = serverUrl + "/sitecore/shell/WebService/service.asmx";

            // Verify Credentials
            var xn = service.GetXML({sitecore path}, false, databaseName, cred);
            return "<dataset>" + xn.InnerXml + "</dataset>";

This should work to get your item.  If you have any questions please email or and we will assist.