how to consume JSON data from restful wcf webservice

Hello! Experts,

       I have a scenario where a restful wcf service running at one domain and i want to consume that restful service from my application (running in different domain) through "jquery ajax call" , i am able to hit the web service method  which returns json format but i am not able to get the response json data from the web service .

        I'm  not even getting alert's fired in  success and failure ,so please find the below code where i have tried jquery ajax call in my aspx page and please help me with some information were i'm going wrong along with some sample code or example.

       <script type="text/javascript">

     $(document).ready(function () {

                type: "GET",
                url: url,
                data: "{ }",
                contentType: "application/json; charset=utf-8",
                dataType: "jsonp",
                crossDomain: true,
                success: function(data) {

                failure: function(data) {




Open in new window

Thank you!
Who is Participating?
smeghammerConnect With a Mentor Commented:
Cross domain standard AJAX won't work. You will need something server-side on your site that makes the HTTP request to the remote domain. Your ajax block then would call this local domian URL as a proxy.

Alternatively, there is a couple of newer techniques that address this. See

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
It would be a great help if you can post a link to your sample page.  More then likely the issue is another javascript error is preventing this from firing.   You will have to post a link for us to see.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.