3 Mar 2012 7:29 AM #1
Answered: XMLReader with legacy XML server API and non-standard successProperty
I need to create an Ajax proxy and XMLReader to parse XML from a legacy server API. The server's XML responses have a success element, but it is not of the form <success>true</success>. Instead, each response has a <status>success</status> or <status>error</status> element. It seems I can't use XMLReader's successProperty config to notify my store of an error, correct? If not, do I just need to do my own custom error processing by parsing out the <status> element in the response?
Here are examples of success and error:
<rest generator="xml_writer" version="1.0"> <status>error</status> <message>Already logged in as demo.</message> </rest>
<rest generator="xml_writer" version="1.0"> <status>success</status> <response> <sessid>*****</sessid> <user> <uid>0</uid> <hostname>****</hostname> <roles> <item id="1">anonymous user</item> </roles> </user> </response> </rest>
Yes, you would need to do your own error checking to match against success or error string.
4 Mar 2012 6:23 AM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
Yes, you would need to do your own error checking to match against success or error string.Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services email@example.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.