objective c - how to parse soap response in JSON Array in iOS -


how parse soap response in json array soap response string :-

nsstring *string=@"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/xmlschema-instance\" xmlns:xsd=\"http://www.w3.org/2001/xmlschema\">http://tempuri.org/\">[{\"rest_id\": 1, \"rest_name\": \"canteen 21\", \"rest_address\": \"janakpuri\",\"clientid\": 1, \"rest_lat\": \"28.619713\",\"rest_long\": \"77.088404}]";

nsdata *webdata = [string datausingencoding:nsasciistringencoding]; nserror *e = nil; nsarray *jsonarray = [nsjsonserialization jsonobjectwithdata: webdata options: nsjsonreadingallowfragments error: &e]; 

use nsjsonserialization .

as per docs use nsjsonserialization class convert json foundation objects , convert foundation objects json.

[{\"rest_id\": 1, \"rest_name\": \"canteen 21\", \"rest_address\": \"janakpuri\",\"clientid\": 1, \"rest_lat\": \"28.619713\",\"rest_long\": \"77.088404}]"

this part json , can parsed make code portion string , parsing


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -