How can i parse following data in iPhone? - iphone

Hello i am working on web service base iPhone application but the problem is my client provide web service which is in following formate and i don't know how to parse it. i will appreciate for any help or anybody share their experience.
{"message":"[{\"APPROVER_ID\":\"DAMIN_V\",\"APPROVER_USER_NAME\":\"DAMIN\",\"START_DATE\":\"04/04/12\",\"END_DATE\":\"
\",\"SUBSTITUTE_ID\":\"HLAD\",\"SUBSTITUTE_USER_NAME\":\"James\"},{\"APPROVER_ID\":\"DAMIN_V\",\"APPROVER_USER_NAME\":\"DAMIN\",\"START_DATE\":\"06/01/12\",\"END_DATE\":\"
\",\"SUBSTITUTE_ID\":\"LucyE\",\"SUBSTITUTE_USER_NAME\":\"Lucy\"},{\"APPROVER_ID\":\"HLAD\",\"APPROVER_USER_NAME\":\"James\",\"START_DATE\":\"04/16/12\",\"END_DATE\":\"
\",\"SUBSTITUTE_ID\":\"HT\",\"SUBSTITUTE_USER_NAME\":\"HTx\"},{\"APPROVER_ID\":\"HLAD\",\"APPROVER_USER_NAME\":\"James\",\"START_DATE\":\"06/13/12\",\"END_DATE\":\"
\",\"SUBSTITUTE_ID\":\"SUPERMAN\",\"SUBSTITUTE_USER_NAME\":\"james\"},{\"APPROVER_ID\":\"MY
ORG USER\",\"APPROVER_USER_NAME\":\"My ORG user
1\",\"START_DATE\":\"06/13/12\",\"END_DATE\":\"06/16/12\",\"SUBSTITUTE_ID\":\"NFALPR1\",\"SUBSTITUTE_USER_NAME\":\"Prince\"},{\"APPROVER_ID\":\"PEK\",\"APPROVER_USER_NAME\":\"Lucy
E\",\"START_DATE\":\"03/01/12\",\"END_DATE\":\"08/08/12\",\"SUBSTITUTE_ID\":\"HRL\",\"SUBSTITUTE_USER_NAME\":\"James\"},{\"APPROVER_ID\":\"PNAIR\",\"APPROVER_USER_NAME\":\"Carl\",\"START_DATE\":\"03/01/12\",\"END_DATE\":\"03/09/12\",\"SUBSTITUTE_ID\":\"SCHITRE\",\"SUBSTITUTE_USER_NAME\":\"Fun
bobby\"},{\"APPROVER_ID\":\"LucyE\",\"APPROVER_USER_NAME\":\"Lucy\",\"START_DATE\":\"03/01/12\",\"END_DATE\":\"03/31/12\",\"SUBSTITUTE_ID\":\"HLAD\",\"SUBSTITUTE_USER_NAME\":\"James\"},{\"APPROVER_ID\":\"LucyE
E\",\"APPROVER_USER_NAME\":\"Lucy\",\"START_DATE\":\"04/01/12\",\"END_DATE\":\"04/30/12\",\"SUBSTITUTE_ID\":\"DAMIN_V\",\"SUBSTITUTE_USER_NAME\":\"DAMIN\"},{\"APPROVER_ID\":\"LucyE
E\",\"APPROVER_USER_NAME\":\"Lucy\",\"START_DATE\":\"05/04/12\",\"END_DATE\":\"05/25/12\",\"SUBSTITUTE_ID\":\"JOSHIA\",\"SUBSTITUTE_USER_NAME\":\"Joye\"}]","statusFlag":true}
Thanks In Advance,
Nitin.

this is JSON data.
use SBJSON.h http://stig.github.com/json-framework/ to parse, which is light and easy

You can use the jsonkit for json parsing.
Here is the code for the json kit library which is editing my simple class added and create one demo you can download the demo and easily identify the your problem
Download the Demo from here.
Also refer the tutorial for the how to use json kit from here.

Related

Save images for my web server in SPIFFS on esp32-S2

Hi it's my first time using esp32-S2 because now its not recommended to use esp32. I'm looking for saving images in SPIFFS for my web server. In esp32 i used to use esp32fs plugin (https://github.com/me-no-dev/arduino-esp32fs-plugin) but it doesn't work for esp32-S2. I would like to know if there is any plugin like esp32fs and if not how can i save my images (I'm using arduinoIDE 1.8.19). I've been searching but i didn't found anything. Any orientation is welcomed. Thank you for your time and assistance.
You can try my ESP32_FSWebServer_DRD or ESP_FSWebServer example of ESP_WiFiManager library
Follow the instructions in ESP_FSWebServer Example
You can use either deprecated SPIFFS or the better LittleFS

How to generate code form .raml with raml2code

I am trying to generate a code from .raml file using raml2code (https://github.com/gextech/raml2code).
Unfortunately the description isn't very good and I can't figure out how to do that.
Can anyone show me any example?
Hi I added more documentation, and also I'm working in a example project:
https://github.com/atomsfat/raml2codeFullSpringExample
Hope this help you

OpenCV and iOS - Getting started

I am new to iOS development and apologies for a basic question. I am trying to convert an image to grayscaled and threshold it using openCV in iOS. So far, I have imported and setup the framework on xcode. What I am trying to do now is to implement the following features:
http://www.youtube.com/watch?feature=player_embedded&v=Ko3K_xdhJ1I
at 0:24 and 0:53
I tried to follow the tutorial which points to the above youtube video :
http://docs.opencv.org/doc/tutorials/ios/image_manipulation/image_manipulation.html
and wasn't sure where to paste the above code and in which file?
Many thanks.
Kind Regards.
These are helper methods and best written in a separate file. Quite simply,
http://answers.oreilly.com/topic/631-how-to-get-c-and-objective-c-to-play-nicely-in-xcode/
Put all that image manipulation code in say ImageManipulationHelper.mm and create a header file for the same
Create a nice little category for UIImage.
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/CustomizingExistingClasses/CustomizingExistingClasses.html
which can call these methods in turn to create any image manipulation you might want.
Easy does it. And yeah, read up a bit more on using C++ in objectiveC, if you get into trouble and also about categories. They are some of the niftier features of objectivec
I achieved the same,using the help of this awesome link
Let me know if you need any further help.
Cheers!!
Edit :
Check this out ImageFiltering

Drupal rest services in Json format

I am working on drupal 7. I created a rest services in drupal views. I want to consume this service in my android app. When i try to view my service
http://mysite.com/ubercart/?q=rest/views/doctor
am getting response like this
[{,"foaf:Document"],"title":{"predicates":["dc:title"]},"created":{"predicates":["dc:date","dc:created"],"datatype":"xsd:dateTime","callback":"date_iso8601"},"changed":{"predicates":["dc:modified"],"datatype":"xsd:dateTime","callback":"date_iso8601"},"body":{"predicates":[""vid":"12","uid":"1","title":"raja","log":"","status":"1","comment":"2","promote":"0","sticky":"0","nid":"12","type":"doctor","language":"und","created":"1351849158","changed":"1351849158","tnid":"0","translate":"0","revision_timestamp":"1351849158","revision_uid":"1","field_rating":{"und":[{"value":"4"}]},"field_place":{"und":[{"value":"Guntur","format":null,"safe_value":"Guntur"}]},"rdf_mapping":{"rdftype":["sioc:Item","foaf:Document"],"title":{"predicates":["dc:title"]},"created":{"predicates":["dc:date","dc:created"],"datatype":"xsd:dateTime","callback":"date_iso8601"},"changed":{"predicates":["dc:modified"],"datatype":"xsd:dateTime","callback":"date_iso8601"},"body":{"predicates":["content:encoded"]},"uid":{"predicates":["sioc:has_creator"],"type":"rel"},"name":{"predicates":["foaf:name"]},"comment_count":{"predicates":["sioc:num_replies"],"datatype":"xsd:integer"},"last_activity":{"predicates":["sioc:last_activity_date"],"datatype":"xsd:dateTime","callback":"date_iso8601"}},"cid":"0","last_comment_timestamp":"1351849158","last_comment_name":null,"last_comment_uid":"1","comment_count":"0","name":"admin","picture":"0","data":"b:0;","uc_order_product_id":false,"ucnc_product_nid":false},{"vid":"11","uid":"1","title":"ravi","log":"","status":"1","comment":"2","promote":"0","sticky":"0","nid":"11","type":"doctor","language":"und","created":"1351849131","changed":"1351849131","tnid":"0","translate":"0","revision_timestamp":"1351849131","revision_uid":"1","field_rating":{"und":[{"value":"5"}]},"field_place":{"und":[{"value":"Hyderabad","format":null,"safe_value":"Hyderabad"}]},"rdf_mapping":{"rdftype":["sioc:Item","foaf:Document"],"title":{"predicates":["dc:title"]},"created":{"predicates":["dc:date","dc:created"],"datatype":"xsd:dateTime","callback":"date_iso8601"},"changed":{"predicates":["dc:modified"],"datatype":"xsd:dateTime","callback":"date_iso8601"},"body":{"predicates":["content:encoded"]},"uid":{"predicates":["sioc:has_creator"],"type":"rel"},"name":{"predicates":["foaf:name"]},"comment_count":{"predicates":["sioc:num_replies"],"datatype":"xsd:integer"},"last_activity":{"predicates":["sioc:last_activity_date"],"datatype":"xsd:dateTime","callback":"date_iso8601"}},"cid":"0","last_comment_timestamp":"1351849131","last_comment_name":null,"last_comment_uid":"1","comment_count":"0","name":"admin","picture":"0","data":"b:0;","uc_order_product_id":false,"ucnc_product_nid":false},{"vid":"10","uid":"1","title":"sree","log":"","status":"1","comment":"2","promote":"0","sticky":"0","nid":"10","type":"doctor","language":"und","created":"1351849109","changed":"1351849109","tnid":"0","translate":"0","revision_timestamp":"1351849109","revision_uid":"1","field_rating":{"und":[{"value":"4"}]},"field_place":{"und":[{"value":"Hyderabad","format":null,"safe_value":"Hyderabad"}]},"rdf_mapping":{"rdftype":["sioc:Item"content:encoded"]},"uid":{"predicates":["sioc:has_creator"],"type":"rel"},"name":{"predicates":["foaf:name"]},"comment_count":{"predicates":["sioc:num_replies"],"datatype":"xsd:integer"},"last_activity":{"predicates":["sioc:last_activity_date"],"datatype":"xsd:dateTime","callback":"date_iso8601"}},"cid":"0","last_comment_timestamp":"1351849109","last_comment_name":null,"last_comment_uid":"1","comment_count":"0","name":"admin","picture":"0","data":"b:0;","uc_order_product_id":false,"ucnc_product_nid":false}]
Actually i need response like this
{"nodes":{"0":{"node":{"title":"raja","field_place":"Guntur","rating":"4"}},"1":{"node":{"title":"ravi","field_place":"Hyderabad","rating":"5"}},"2":{"node":{"title":"sree","field_place":"Hyderabad","rating":"4"}}}}
Can any one help me out?
I find the sollution above.. Some sites took me in wrong direction. The url is
http://mysite.com/ubercart/?q=rest/doctor
I got the format which i need. Also i found servces 3x version has some troubles with json format weservices. It worked good for me in xml formatter.

i want to parse data using SOAP and libxml2 so how it possible?

i have soap based Xml using that soap message i want to perform libxml parsing also perform lazy loading so how can i perform it please any one have idea about it then please help me.
Look at this sample code:
http://sourceforge.net/projects/mtgr8-a3/
Hope it helps.