Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7444317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:29:04+00:00 2026-05-29T11:29:04+00:00

My task is to parse some JSON which was created by running an XML

  • 0

My task is to parse some JSON which was created by running an XML to JSON conversion tool on an XML WADL. I’m able to parse the data returned in the response into JSON and I’m able to obtain the top level NSDictionary from the data. I can get an array from the dictionary and an NSDictionary from the Array ( it includes the key value but thats it) and thats as deep as I can go. I’ve done parsing in the past but this particular JSON format I am having no luck? Here is the code I’m using..

// Decode the data
NSError *parseError = nil;
NSData *jsonData = [request responseData];
NSDictionary *responseDict = [NSJSONSerialization JSONObjectWithData:jsonData options:0 error:&parseError];
if (parseError) {
    NSLog(@"Error: %@", [parseError localizedDescription]);

    // other stuff..
    return;
}

NSLog(@"JSON=: %@", responseDict.description);
NSArray *messageBoxResponse = [responseDict objectForKey:@"messageBoxResponse"];
NSLog(@"messageBoxResponse=: %@", messageBoxResponse);
NSUInteger count = messageBoxResponse.count;
for (NSDictionary* messages in messageBoxResponse) {

    NSLog(@"Messages=: %@", messages.description);
    NSArray *message = [messages objectForKey:@"message"];

    // get SIGABRT
    count = message.count;

    // If I comment out above line and introduce this I get SIGABRT also
    for (NSDictionary* something in message) {
        NSLog(@"Somthing=: %@", something.description);


}

Here is the JSON I’m attempting to parse.. IPs have been changed :):

{
messageBoxResponse =     {
    messages =         {
        link =             {
            href = "http://1.1.1.1:80/services/messageboxes/63358/messages";
            rel = self;
        };
        message =             (
                            {
                flags =                     {
                    answered = 0;
                    link =                         {
                        href = "http://1.1.1.1:80/services/messageboxes/63358/messages/<4F3131A3.6040204@sc-msg1-msg.sc.sc>/flags";
                        rel = self;
                    };
                    taggedForDeletion = 0;
                    unread = 0;
                };
                from = "Suren.1@sc-msg1-msg.sc.sc";
                link =                     {
                    href = "http://1.1.1.1:80/services/messageboxes/63358/messages/<4F3131A3.6040204@sc-msg1-msg.sc.sc>";
                    rel = self;
                };
                parts =                     {
                    link =                         {
                        href = "http://1.1.1.1:80/services/messageboxes/63358/messages/<4F3131A3.6040204@sc-msg1-msg.sc.sc>/parts";
                        rel = self;
                    };
                    part =                         {
                        link =                             {
                            href = "http://1.1.1.1:80/services/messageboxes/63358/messages/<4F3131A3.6040204@sc-msg1-msg.sc.sc>/parts/0";
                            rel = self;
                        };
                        mimeType = "TEXT/PLAIN";
                        name = "text.txt";
                        size = 564;
                    };
                };
                receivedDate = 1328624061000;
                sentDate = 1328624035000;
                subject = test;
            },
                            {
                flags =                     {
                    answered = 0;
                    link =                         {
                        href = "http://1.1.1.1:80/services/messageboxes/63358/messages/<24346739.35.1328562602976.JavaMail.mango@sc-msg1-msg.sc.sc>/flags";
                        rel = self;
                    };
                    taggedForDeletion = 0;
                    unread = 0;
                };
                from = "Suren.1@sc-msg1-msg.sc.sc";
                link =                     {
                    href = "http://1.1.1.1:80/services/messageboxes/63358/messages/<24346739.35.1328562602976.JavaMail.mango@sc-msg1-msg.sc.sc>";
                    rel = self;
                };
                parts =                     {
                    link =                         {
                        href = "http://1.1.1.1:80/services/messageboxes/63358/messages/<24346739.35.1328562602976.JavaMail.mango@sc-msg1-msg.sc.sc>/parts";
                        rel = self;
                    };
                    part =                         (
                                                    {
                            link =                                 {
                                href = "http://1.1.1.1:80/services/messageboxes/63358/messages/<24346739.35.1328562602976.JavaMail.mango@sc-msg1-msg.sc.sc>/parts/0";
                                rel = self;
                            };
                            mimeType = "TEXT/PLAIN";
                            name = "text.txt";
                            size = 6;
                        },
                                                    {
                            content =                                 {
                                href = "http://1.1.1.1:80/services/messageboxes/63358/messages/<24346739.35.1328562602976.JavaMail.mango@sc-msg1-msg.sc.sc>/parts/1/2c3a3400620f218d5378607260dc2749.wav";
                                rel = content;
                            };
                            duration = 3;
                            link =                                 {
                                href = "http://1.1.1.1:80/services/messageboxes/63358/messages/<24346739.35.1328562602976.JavaMail.mango@sc-msg1-msg.sc.sc>/parts/1";
                                rel = self;
                            };
                            mimeType = "AUDIO/WAV";
                            name = "Audio_Recording_S000551_002.wav";
                            size = 31190;
                        },
                                                    {
                            link =                                 {
                                href = "http://1.1.1.1:80/services/messageboxes/63358/messages/<24346739.35.1328562602976.JavaMail.mango@sc-msg1-msg.sc.sc>/parts/2";
                                rel = self;
                            };
                            mimeType = "APPLICATION/MS-TNEF";
                            name = "winmail.dat";
                            size = 656;
                        }
                    );
                };
                receivedDate = 1328562604000;
                sentDate = 1328562596000;
                subject = "Voice Message from Suren 1 (63357)";
            }
        );
    };
};

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T11:29:05+00:00Added an answer on May 29, 2026 at 11:29 am

    Its because the json is not valid. It should look more like this:

    {
        "messages": {
            "link": {
                "href": "http: //1.1.1.1: 80/services/messageboxes/63358/messages",
                "rel": "self"
            }
        }
    }
    

    the ‘=’ need to be ‘:’ there are semicolons that shouldn’t be there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm actually doing a little browser which should be able to parse some code,
TASK : I have an existing xml document (UTF-8) which uses xml namespaces and
I have some problem with CompletionService. My task: to parse parallely for about 300
I am (too) often confronted with the task of having to parse textual data
In my app, I read/parse data that takes some time. While that process is
I parse XML data and put it into an object. This takes fairly long
I am a beginner to Java and my first task is to parse some
I am attempting to parse some json I am getting back from a service.
So I know how to parse some XML structures but I am currently trying
Below is some sample XML showing the basic setup I am trying to parse.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.