I am able to bind XML data that is built locally (e.g. http://www.igniteui.com/data-source/xml-binding) to a datasource and then bind that datasource to a grid. But when I change the ig.datasource's dataSource to a Web API URL returning the same exact XML string, I consistently get an error such as this:
Error: There was an error parsing the XML data and applying the defined data schema: data.evaluate is not a functionhttp://localhost:53008/igniteui/js/modules/infragistics.datasource.jsLine 37
I've also seen the same error with an inner message suggesting the problem is instead related to root.IterateNext, but attempting to apply this fix (http://ko.infragistics.com/community/forums/p/69866/353775.aspx) does not work.
Initially, I had thought that the issue was the Web API's XMLFormatter alone, but if I observe the XML in Firebug, it is identical to the XML that I had used successfully when constructed locally. In other words, I don't see any obvious issue in the construction of the XML.
I have attempted to eliminate as many factors as possible, such as:
#1) It doesn't matter whether I bind to the grid or not. It's strictly an issue with the datasource.#2) It doesn't matter whether I pass across an xmlstring or xmldocument.#3) It doesn't matter if I remove the JSONFormatter entirely from the Web API configuration.#4) It doesn't matter if I use datasource or xmldatasource.
I'm at a loss for what's wrong here. The Infragistics samples are seriously lacking real-life remote data retrieval scenarios, so I haven't found anything to help.
Jason
Hello Jason,
Please let me know if you need further assistance with this issue.
Hi Jason,
Please see my attached sample that demonstrates one way to use the same xml data from your provided code.
I make an Ajax callback and wait for the response until I create the igDataSource using the xml data. I had to workaround with this since I was receiving errors about not being able to serialize an XmlDocument from my WebAPI Get.
The xml data is passed into the igDataSource and it is then parsed out into the html table through our template.
If you still need assistance with this issue, as I mentioned in my update yesterday, if you can please provide more information regarding the response data you are receiving, I will be able to look into the original error you were receiving.
If you have any other questions or concerns with this, please let me know.
I am currently investigating the format of the response to determine how the data should be received and how it may be getting parsed. I am testing with the code you provided and I am receiving a different error than yours. It would help if you could please let us know what the response data looks like when the request to the WebAPI returns. You can view this from the Net tab in Firebug.
Could you please also let me know what version of IgniteUI you are experiencing these errors with? You should be able to find this at the top of our script files.
I will have another update on my findings for you tomorrow after looking into this further.
Doing our due diligence.
We have built almost exclusively large-scale, data-intensive three-tier applications over the years and have grown comfortable with ADO and, to a lesser extent, XML. We've seen the pros and cons of using JSON versus XML, and while we understand why JSON is the "preferred format" for many developers, we wanted to evaluate performance of the Ignite controls (the grid and datasource, in particular) under various conditions, including data format. I had hoped that Infragistics would have published a white paper regarding performance concerns, but I haven't seen any, so we're sorting it out ourselves.
If you're telling me that the combination of Ignite and XML is a nonstarter, that's fine; your rather limited documentation suggests that you support it, but perhaps not really.
While we're investigating your issue I want to ask you a the following question:
Is there any particular reason that you're using XML in favor of JSON? There are tons of reason why JSON is the preferred format for the web.
Best regards,Martin PavlovInfragistics, Inc.