I have recently started a project in Sencha touch with existing Web-services. Being very new to the technology, I am facing certain issues in accomplishing some functionality.
Problem I have to call login service and the request goes like:
http://domain.sub.com/Service.asmx/LoginService?body={"Username":"maj@smaj.com","Password":"p12345","Token":122112321123212123,"Method":"Login","LabId":"(null)","Hash":"fr3f33f3334348u8yy8hfuhdu8bdy7y89u89x8998c89789c87d78r9","DeviceType":"iPhone Simulator","DeviceId":"91BF3299-A94C-5AD3-9C35-A5C9BBBB6AA8","ApplicationType":"iPhone","Id":"998390494"}
but the response is coming in XML format as: RESPONSE:
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://domain2.sub2.com/MobileWebService/">{"Id":"null","Message":"Logged In.","Status":true,"LoggedIn":true}</string>
I have to parse this xml to json to get : {"Id":"null","Message":"Logged In.","Status":true,"LoggedIn":true}
out of the response.
then use the Status, LoggedIn and Id to verify the login.
My Idea I am not sure whether its right, I am trying to create two stores, xmlStore and JsonStore.
??
- How will I store the xml response inside a string.
- How Will I pass this string to Json Store (at the place of url?)
I may sound very naive to this, but this is my problem ;)
Please guide.
EDIT:
I realized tha I am diving cross domain request. is that what is causing problems or confusion. How to deal with it suppose I did not had cross domain requests?