This is a migrated thread and some comments may be shown as answers.

Errors binding DataSource to WCF service

1 Answer 149 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 02 May 2012, 11:52 AM
I have a WCF RESTful service (http://localhost:8000/AccountService/GetAccounts) outputting valid JSON data:

[
{"Department":"Manager","ID":"1","Name":"Alexandre Heuze","Position":"General Manager"},
{"Department":"Accouting","ID":"2","Name":"Pengli Liu","Position":"Accounting Manager"},
{"Department":"Human Resources","ID":"5","Name":"Jie Wu","Position":"HR Administrator"},
{"Department":"Sales and Purchasing","ID":"6","Name":"Fei He","Position":"Sales Manager"},
{"Department":"R and D Department","ID":"10","Name":"Jun Zuo","Position":"R and D Engineer"}
]

The following code does not bind the JSON output to the Grid Widget:

var wcfDS = new kendo.data.DataSource({
    transport: {
        read: {
            url: "http://localhost:8000/AccountService/GetAccounts",
            dataType: "json"
        }
    },
    error: function(e) {
        alert(e.toString());
    }
});
$("#grid").kendoGrid({
    dataSource: wcfDS, 
    columns: [...]
});

The most relevant error message I can see is e.errorThrown = "No Transport". Your thoughts?

1 Answer, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 02 May 2012, 12:46 PM
Hello Michael,

Not sure what is causing the error. Bellow is a sample that works with provided JSON:
http://jsfiddle.net/2YX9S/1/

All the best,
Nikolay Rusev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Data Source
Asked by
Michael
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Share this question
or