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 8242795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:17:20+00:00 2026-06-07T21:17:20+00:00

This is my JSON file that contains multiple objects of Application: {Application:[{appid:0,appname:application0}, {appid:1,appname:application1}, ….

  • 0

This is my JSON file that contains multiple objects of “Application”:

{"Application":[{"appid":"0","appname":"application0"},
                {"appid":"1","appname":"application1"},
                ....
               ]} 

I’m receiving it from Android code into my WCF REST service method:

[WebInvoke(Method = "POST", UriTemplate = "/AcceptApp", RequestFormat = WebMessageFormat.Json,  
    ResponseFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
[OperationContract]
string AcceptApplication(Stream jsonstring);

And here’s method definition:

public string AcceptApplication(Stream inputStream)
{
    StreamReader r = new StreamReader(inputStream);
    string jsonstring = r.ReadToEnd();
    try
    {
       List<ApplicationEntity> list = JsonConvert.DeserializeObject<List<ApplicationEntity>>(jsonstring);
       for (int i = 0; i < list.Count; i++)
       {
         // using data
       }
    }
    catch (Exception E)
    {
        Logger.Error(E.Message);
    }

My ApplicationEntity:

public class ApplicationEntity
{
    public string appid { get; set; }
    public string appname { get; set; }
} 

I’m getting jsonstring , but error I’m getting:

Newtonsoft.Json.JsonSerializationException: Cannot deserialize the current JSON object (e.g.    
{"name":"value"}) into type  
'System.Collections.Generic.List`1[ApplicationEntity]' because the  
type requires a JSON array (e.g. [1,2,3]) to deserialize correctly.
To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so
that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array 
or List<T>) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type 
to force it to deserialize from a JSON object.
  • 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-06-07T21:17:23+00:00Added an answer on June 7, 2026 at 9:17 pm

    The JSON string you are trying to parse is not a list or an array. It is an object with a property called "Application" that is an array.
    Try this:

    public class ApplicationObject
    {
        public List<ApplicationEntity> Application { get; set; }
    }
    ...
    var apps = JsonConvert.DeserializeObject<ApplicationObject>(jsonstring);
    

    Now you can access the list on apps.Application.

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

Sidebar

Related Questions

This the model that I want to create using json file Ext.define('Users', { extend:
I have this swf (flash) file that provides the json that needs to be
I have a JSON file which contains a pound symbol in it. This json
I have a json file exported from phpmyadmin, it looks like this(utf-8 file): [{user_email:
This works fine: var vm = {}; $.getJSON('file.json', function (data) { vm.objects = data;
I am fetching a .js file from a remote site that contains data I
I have a file that contains some JSON with an extension of .json. I
I have a php file that contains switch/case which is in JSON I believe.
I am parsing this JSON file (correctly, it works with the UITextFields): {longitude:[37.786793,39.388528],latitude:[-122.395416,-78.887734]} ind
I am trying to loop through this external JSON file(locally stored), but I cannot

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.