Hi,
I have a Kentico Website that we set up at work using ASPX templates and it works pretty well, but now we have a separate ASP.NET site that we want to grab CMS data from certain documents within our Kentico site.
For example, we want to pull out certain images and text in a few of the pages in our Kentico site via a Web Service, so when I found out that there was a REST Web Service available, I was happy that I could access this data easily.
However, your documentation shows only how to setup IIS7 when it comes to configuring REST services, but my development workstation uses Windows XP with IIS 5.1.
So whenever I attempt to run this code from my ASP.NET website:
string url = "http://localhost/OurSite/rest/content/site/currentsite/en-ca/document/OurDocument";
string result = string.Empty;
//System.Net.WebClient wc = new System.Net.WebClient();
//result = wc.DownloadString(url);
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
request.Method = "GET";
WebResponse res = request.GetResponse();
string status = ((HttpWebResponse)res).StatusDescription;
var code = ((HttpWebResponse)res).StatusCode;
Stream stream = res.GetResponseStream();
StreamReader reader = new StreamReader(stream);
string output = reader.ReadToEnd();
I get a 401 unauthorized exception. My IIS has been setup to have "Anonymous Access" unchecked and "Integrated Windows Authentication" checked in the "Authentication Methods" folder.
Why can't I get this to work?
Ben.