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

DataSource, no 'slice' method in xml response

1 Answer 115 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Fabián
Top achievements
Rank 1
Fabián asked on 29 Jan 2014, 01:57 PM
Hello, I´m new using kendo mobile and I´m trying to invoke a wcf rest service, using xml.

For instance, this login invocation:
            
             var username = "admin";
             var password = "admin";

             var remoteDataSource = new kendo.data.DataSource({
                type: "xml",
                schema: {
                    type: "xml",
                    data: function (response) {
                        return response;
                    }
                },
                transport: {
                    read: "http://localhost/MyService.svc/Security/Login?" +
                        "user=" + username + "&password=" + encrypted,
                    success: function (result) {
                        options.success(result);
                    },
                    error: function (result) {
                        options.error(result);
                    }
                }
            });

            remoteDataSource.fetch();

Where service response has this structure:

<UserData>
    <IsSuccess>true</IsSuccess>
</UserData>

That code is executed in a button event and when debugging, success and error functions are never reached.
This call remoteDataSource.fetch() raises an unhandled exception: "Javascript exception: object has no method 'slice'"

Any help is appreciated about using DataSource when response is xml data.

Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 31 Jan 2014, 08:33 AM
Hello Fabian,

The Kendo UI DataSource, does not have implemented the success and error functionality that you are trying to use. Please check this documentation article that will get you more familiar with the dataSource API:

http://docs.telerik.com/kendo-ui/api/framework/datasource

As for the XML data, please check the following demo, showing how to implement Kendo UI DataSource binding to XML:

http://demos.telerik.com/kendo-ui/web/datasource/xml-data.html

Regards,
Kiril Nikolov
Telerik
Icenium is now Telerik AppBuilder, and is part of the Telerik Platform. For more information on the new name, and to learn more about the Platform, register for the free online keynote and webinar on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT)
Tags
General Discussions
Asked by
Fabián
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or