angularjs having issues accessing object returned by ajax call

Posted on 2014-03-26
Last Modified: 2014-03-26
I can successfully console.log the response from my ajax request, but I don't know how to access the object.  In the examples I have seen, they just access the properties.  I have even tried to parse it.

                var url = 'myservoce.svc/CancelSelections';
                $http({ method: 'POST', url: url })
                    .then(function(response) {
                    }, function (response) {
                        alert("Fail CancelSelections=" + response);

When I run this code, I get

Object {data: "<ExportShareOutputModel xmlns="…><success>true</success></ExportShareOutputModel>", status: 200, headers: function, config: Object}

<ExportShareOutputModel xmlns="" xmlns:i=""><ErrorMessage i:nil="true" xmlns=""/><IsValid xmlns="">true</IsValid><message/><success>true</success></ExportShareOutputModel>

Question by:jackjohnson44
1 Comment
LVL 82

Accepted Solution

leakim971 earned 500 total points
ID: 39956799
Yes is a string, an XML string
Test page :

var response = {data: "<ExportShareOutputModel xmlns=\"\"><success>true</success></ExportShareOutputModel>", status: 200, headers: function(){}, config: {}};
var data =;
var ExportShareOutputModel = jQuery.parseXML(data);
var success = $("success",ExportShareOutputModel).text();


Open in new window


Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now