Click here to Skip to main content
15,905,420 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: Web API needed or not?! Pin
Amr.Mohammad8722-Jan-16 2:06
Amr.Mohammad8722-Jan-16 2:06 
GeneralRe: Web API needed or not?! Pin
F-ES Sitecore22-Jan-16 2:15
professionalF-ES Sitecore22-Jan-16 2:15 
GeneralRe: Web API needed or not?! Pin
Amr.Mohammad8722-Jan-16 4:36
Amr.Mohammad8722-Jan-16 4:36 
QuestionAngularJS or JQuery? Pin
Jassim Rahma16-Jan-16 9:28
Jassim Rahma16-Jan-16 9:28 
SuggestionRe: AngularJS or JQuery? Pin
Kornfeld Eliyahu Peter16-Jan-16 9:55
professionalKornfeld Eliyahu Peter16-Jan-16 9:55 
AnswerRe: AngularJS or JQuery? Pin
Thomas Daniels17-Jan-16 0:52
mentorThomas Daniels17-Jan-16 0:52 
GeneralRe: AngularJS or JQuery? Pin
Jassim Rahma17-Jan-16 8:12
Jassim Rahma17-Jan-16 8:12 
GeneralRe: AngularJS or JQuery? Pin
Thomas Daniels17-Jan-16 9:23
mentorThomas Daniels17-Jan-16 9:23 
GeneralRe: AngularJS or JQuery? Pin
Beginner Luck26-Jan-16 16:16
professionalBeginner Luck26-Jan-16 16:16 
SuggestionRe: AngularJS or JQuery? Pin
Beginner Luck21-Jan-16 14:27
professionalBeginner Luck21-Jan-16 14:27 
QuestionInadvertent Cookie Stuffing - I Can't Figure Out What I'm Doing... Pin
Amanda Reaume14-Jan-16 13:39
Amanda Reaume14-Jan-16 13:39 
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 

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.