Hi all,
I am trying to use the RPS method of authentication to request information about my Windows Live contacts.
I *think* the code is okay, but I'm getting a System.Net.WebException at run time.
My (C#) code is:
(where oID is an Identity - I'm hacking about with the 'WLID Client Sample')
// Create HTTP request object.
bool bSuccess = true; UriBuilder uriBuilder = new UriBuilder();uriBuilder.Scheme =
"HTTPS";uriBuilder.Path =
"/" + "username@hotmail.com" + "/LiveContacts/Contacts";uriBuilder.Host =
"cumulus.services.live.com";uriBuilder.Port = 443;
string uriPath = uriBuilder.Uri.AbsoluteUri; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uriPath);request.Method =
"GET";request.Headers.Add(
"Authorization", "WLID1.0 t=\"t=" + oID.ExportAuthString() + "=\""); HttpWebResponse resp = null; try {resp = (
HttpWebResponse)request.GetResponse();}
catch(WebException e){
//Console.WriteLine(e);textBox1.Text = e.ToString();
if(e.Status == WebExceptionStatus.ProtocolError)resp = (
HttpWebResponse)e.Response;}
The error in my Debug console is : A first chance exception of type 'System.Net.WebException' occurred in System.dll
And the exeception caught is:
System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
at System.Net.HttpWebRequest.GetResponse()
at WindowsLiveIDClientSample.ContactsWindow..ctor(Identity oID) in C:\WLID Client Sample\src\ContactsWindow.cs:line 64
Any ideas I've spent a lot of time trawling the internet forums - but nothing seems to work (I've even tried editing the <add name="HttpGet"> approach)
Anyone had this problem Anyone see what I might be obviously doing wrong
I've never tried to develop any applications which use web services, so any really basic suggestions are welcome
Thanks!!