Click here to Skip to main content
15,887,336 members
Home / Discussions / Web Development
   

Web Development

 
AnswerRe: Inadvertent Cookie Stuffing - I Can't Figure Out What I'm Doing... Pin
ZurdoDev15-Jan-16 8:34
professionalZurdoDev15-Jan-16 8:34 
GeneralRe: Inadvertent Cookie Stuffing - I Can't Figure Out What I'm Doing... Pin
Amanda Reaume15-Jan-16 16:26
Amanda Reaume15-Jan-16 16:26 
GeneralRe: Inadvertent Cookie Stuffing - I Can't Figure Out What I'm Doing... Pin
ZurdoDev16-Jan-16 1:46
professionalZurdoDev16-Jan-16 1:46 
QuestionShowing article to right of left hand menu.... Pin
richardlatter12-Jan-16 10:47
richardlatter12-Jan-16 10:47 
AnswerRe: Showing article to right of left hand menu.... Pin
Richard Deeming13-Jan-16 2:19
mveRichard Deeming13-Jan-16 2:19 
GeneralRe: Showing article to right of left hand menu.... Pin
richardlatter13-Jan-16 10:36
richardlatter13-Jan-16 10:36 
PraiseRe: Showing article to right of left hand menu.... Pin
ZurdoDev15-Jan-16 8:43
professionalZurdoDev15-Jan-16 8:43 
QuestionThe remote server returned an error: (404) Not Found. Pin
Stephen Holdorf11-Jan-16 8:21
Stephen Holdorf11-Jan-16 8:21 
I went through this tutorial:

WCF RESTful service and WebGrid in ASP.NET MVC 5 : WCF RESTful service and WebGrid in ASP.NET MVC 5 - Part 1[^]


and everything seemed fine. In the web service project if I browse to the customerService.svc file the web service page comes up fine. In the MVC controller I am using the same web service url string that is copied from the actual browser that did display in the service just fine:

customerServiceUri = "http://localhost:55429/CustomerService.svc"



I have a break point in the code where the customerList is assigned a value:

public ActionResult Index()
        {
            List<Customer> customerList = new List<Customer>();
            using (WebClient webClient = new WebClient())
            {
                string dwml;
                dwml = webClient.DownloadString(customerServiceUri + "GetAllCustomers");
                customerList = JsonConvert.DeserializeObjectAsync<List<Customer>>(dwml).Result;
            }
            return View(customerList);
        }


The web method definition is below:

C#
// WebGet attribute is used to make GET request in WCF REST service
 [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, UriTemplate = "GetAllCustomers")]
 IEnumerable<CustomerEntity> GetAllCustomers();



Now when the controller Index code runs with the Web method called I get the following error:

C#
An exception of type 'System.Net.WebException' occurred in System.dll but was not handled in user code

Additional information: The remote server returned an error: (404) Not Found.


The strange thing is if I put a break point in the code where the customerList is assigned a value and I comment out the web method (GetAllCustomers) and just use the web service url no 404 exception occurs. It seems to find the web service just fine but there is a problem when I try to make a call to the web method.

dwml = webClient.DownloadString(customerServiceUri); // + "GetAllCustomers");


Has anyone experienced the same problem? I must of forgot to add something or broke something in one of the tutorial files.
AnswerRe: The remote server returned an error: (404) Not Found. Pin
F-ES Sitecore11-Jan-16 23:08
professionalF-ES Sitecore11-Jan-16 23:08 
GeneralRe: The remote server returned an error: (404) Not Found. Pin
Stephen Holdorf12-Jan-16 3:10
Stephen Holdorf12-Jan-16 3:10 
GeneralRe: The remote server returned an error: (404) Not Found. Pin
F-ES Sitecore12-Jan-16 3:13
professionalF-ES Sitecore12-Jan-16 3:13 
GeneralRe: The remote server returned an error: (404) Not Found. Pin
Stephen Holdorf12-Jan-16 3:25
Stephen Holdorf12-Jan-16 3:25 
QuestionMVC API How To: Client Callback Pin
Kevin Marois11-Jan-16 4:23
professionalKevin Marois11-Jan-16 4:23 
AnswerRe: MVC API How To: Client Callback Pin
F-ES Sitecore11-Jan-16 5:01
professionalF-ES Sitecore11-Jan-16 5:01 
GeneralRe: MVC API How To: Client Callback Pin
Kevin Marois11-Jan-16 5:18
professionalKevin Marois11-Jan-16 5:18 
QuestionFairytale about port, xdebug and phpshtorm Pin
Member 80755916-Jan-16 4:16
Member 80755916-Jan-16 4:16 
Rant[REPOST] Fairytale about port, xdebug and phpshtorm Pin
Richard Deeming6-Jan-16 4:28
mveRichard Deeming6-Jan-16 4:28 
Questionguidance to build a website Pin
Member 122470745-Jan-16 23:01
Member 122470745-Jan-16 23:01 
AnswerRe: guidance to build a website Pin
Richard MacCutchan5-Jan-16 23:04
mveRichard MacCutchan5-Jan-16 23:04 
AnswerRe: guidance to build a website Pin
Nathan Minier6-Jan-16 1:29
professionalNathan Minier6-Jan-16 1:29 
QuestionWhat are the new web development techniques? Pin
Quick Innovations- Web Design Company4-Jan-16 23:17
professionalQuick Innovations- Web Design Company4-Jan-16 23:17 
AnswerRe: What are the new web development techniques? Pin
Nathan Minier6-Jan-16 1:34
professionalNathan Minier6-Jan-16 1:34 
QuestionOur WebSite and the IP Address Pin
BobInNJ2-Jan-16 12:48
BobInNJ2-Jan-16 12:48 
AnswerRe: Our WebSite and the IP Address Pin
Garth J Lancaster2-Jan-16 14:09
professionalGarth J Lancaster2-Jan-16 14:09 
GeneralRe: Our WebSite and the IP Address Pin
BobInNJ4-Jan-16 3:24
BobInNJ4-Jan-16 3:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.