See this Rails example - http://edgeapi.rubyonrails.org/classes/ActionController/Responder.html
The web server needs to know about request formats and have separate responders for these formats. On Wed, May 20, 2015 at 11:33 AM, mark goldin <markzolo...@gmail.com> wrote: > Here is what the server returns: > > <string xmlns="something here/">{"assets":44,"projects":382}</string> > > My server code is this: > [WebMethod(EnableSession = true)] > virtual public string getCurrentSummaryWeb() > { > string json = JsonConvert.SerializeObject(getCurrentSummary()); > return json; > } > > On Wed, May 20, 2015 at 8:20 AM, Brian <brian.mccav...@gmail.com> wrote: > >> Maybe you need to convert your response payload into a json object >> instead of a string? >> JSON.parse(serverResponsePayload) >> >> >> >> On Wednesday, May 20, 2015 at 9:18:06 AM UTC-4, Brian wrote: >>> >>> Sorry, I still don't understand the issue. You are trying to get JSON, >>> and your server is returning JSON? >>> Maybe I'm dumb but can you explain in another way, or provide a plnker >>> perhaps? http://plnkr.co/edit/rQvx8CXtmkCKR89jWn8T >>> >>> >>> >>> >>> On Tuesday, May 19, 2015 at 4:47:12 PM UTC-4, mark goldin wrote: >>>> >>>> It is an Angular question. My server returns json. >>>> >>>> On Tue, May 19, 2015 at 3:43 PM, Brian <brian.m...@gmail.com> wrote: >>>> >>>>> Is there an angular JS question in here somewhere? >>>>> >>>>> Open dev tools in your browser and check the payload you are receiving >>>>> from the server. If you're expecting JSON, and receiving XML, then you >>>>> server is broken, or your expectations are wrong ;) >>>>> >>>>> >>>>> On Tuesday, May 19, 2015 at 4:25:51 PM UTC-4, mark goldin wrote: >>>>>> >>>>>> Here is my request: >>>>>> >>>>>> Key Value >>>>>> Request POST /services/reports_ws.asmx/getData HTTP/1.1 >>>>>> Accept application/json, text/plain, */* >>>>>> Content-Type plain/text >>>>>> >>>>>> I am getting the result as an xml while the server returns json >>>>>> string. I would specify Content-Type json but then my call simply fails. >>>>>> >>>>>> Please help. >>>>>> >>>>>> Thanks >>>>>> >>>>> -- >>>>> You received this message because you are subscribed to a topic in the >>>>> Google Groups "AngularJS" group. >>>>> To unsubscribe from this topic, visit >>>>> https://groups.google.com/d/topic/angular/WSXJLjdKBVQ/unsubscribe. >>>>> To unsubscribe from this group and all its topics, send an email to >>>>> angular+u...@googlegroups.com. >>>>> To post to this group, send email to ang...@googlegroups.com. >>>>> Visit this group at http://groups.google.com/group/angular. >>>>> For more options, visit https://groups.google.com/d/optout. >>>>> >>>> >>>> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "AngularJS" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/angular/WSXJLjdKBVQ/unsubscribe. >> To unsubscribe from this group and all its topics, send an email to >> angular+unsubscr...@googlegroups.com. >> To post to this group, send email to angular@googlegroups.com. >> Visit this group at http://groups.google.com/group/angular. >> For more options, visit https://groups.google.com/d/optout. >> > > -- > You received this message because you are subscribed to the Google Groups > "AngularJS" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to angular+unsubscr...@googlegroups.com. > To post to this group, send email to angular@googlegroups.com. > Visit this group at http://groups.google.com/group/angular. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscr...@googlegroups.com. To post to this group, send email to angular@googlegroups.com. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.