Author: partyk1d24 | Posted on: 6/21/2010 9:56:44 AM | Views : 332

So I am having an issue... If I call my web service directly it works, however, when I try to call it from another controller on the same project I get a 401 exception. Below is the code I use to call the WS, and it is being run in VS not IIS. Anyone have any ideas?


Thanks


Jackie



private Organization GetOrganization(String orgId) { string relativePath = "/Organization/GetOrganization/" + orgId; //get the main url http://www.velocityreviews.com/forums/t676032-webrequest-and-relative-paths.html string authority = System.Web.HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority); //add the supplied relative path Uri uri = new Uri(authority + relativePath); WebRequest request = WebRequest.Create(uri.AbsoluteUri); WebResponse response = request.GetResponse(); Stre ...

Go to the complete details ...