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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:39:31+00:00 2026-06-01T05:39:31+00:00

I am sending JSON: [ { Description: A kud ces bolje, ItemID: 1, Name:

  • 0

I am sending JSON:

[
{
    "Description": "A kud ces bolje",
    "ItemID": 1,
    "Name": "Banane",
    "NewPrice": 91.99,
    "OldPrice": 161.99,
    "SaleEnds": "9/1/2013",
    "SaleStarts": "9/1/2012"
},
{
    "Description": "Rastu na stablu",
    "ItemID": 2,
    "Name": "Kruske",
    "NewPrice": 93.99,
    "OldPrice": 117.99,
    "SaleEnds": "9/1/2013",
    "SaleStarts": "9/1/2012"
},
]

But I want to have a name so that it looks like

"Some_Name":[
{
    "Description": "A kud ces bolje",
    "ItemID": 1,
    "Name": "Banane",
    "NewPrice": 91.99,
    "OldPrice": 161.99,
    "SaleEnds": "9/1/2013",
    "SaleStarts": "9/1/2012"
},
{
    "Description": "Rastu na stablu",
    "ItemID": 2,
    "Name": "Kruske",
    "NewPrice": 93.99,
    "OldPrice": 117.99,
    "SaleEnds": "9/1/2013",
    "SaleStarts": "9/1/2012"
},
]

I return List<Item>:

[OperationContract]
[WebGet(UriTemplate = "/items/{id}", ResponseFormat = WebMessageFormat.Json)]
List<ItemService> GetItems(string id);

and the Item is:

[DataContract]
public class ItemService
{
    [DataMember]
    public int ItemID { get; set; }

    [DataMember]
    public string Name { get; set; }

    [DataMember]
    public string Description { get; set; }

    [DataMember]
    public Decimal OldPrice { get; set; }

    [DataMember]
    public Decimal NewPrice { get; set; }

    [DataMember]
    public string SaleStarts { get; set; }

    [DataMember]
    public string SaleEnds { get; set; }
}
  • 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-01T05:39:32+00:00Added an answer on June 1, 2026 at 5:39 am

    You can’t name the JSon data itself. You would need a small wrapper class containing the name:

    class Wrapper { public Some_Name List<ItemService> {get;set;}
    

    Wrap your list in the wrapper and return the wrapper.

    The resulting JSon would be somehting like:

    {
    "Some_Name":[
    {
        "Description": "A kud ces bolje",
        "ItemID": 1,
        "Name": "Banane",
        "NewPrice": 91.99,
        "OldPrice": 161.99,
        "SaleEnds": "9/1/2013",
        "SaleStarts": "9/1/2012"
    },
    {
        "Description": "Rastu na stablu",
        "ItemID": 2,
        "Name": "Kruske",
        "NewPrice": 93.99,
        "OldPrice": 117.99,
        "SaleEnds": "9/1/2013",
        "SaleStarts": "9/1/2012"
    },
    ]}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Am am successfully parsing and sending JSON values from my client for my server
I'm sending the following JSON string to my server. ( { id = 1;
The data I am sending my page is encoded in JSON, parsed using Javascript
I am trying to receive a json object back from php after sending data
I am having trouble sending JSON to a WebMethod. Here is the way that
I am sending a json array by POST to an R script. The array
I'm writing an application which uses ASP.NET MVC with JSON.NET as the server, sending
I am sending a json request to a server as below: $.getJSON(prod_search.php?type=getCustInfo&custID=+custID, function(json) {
I'm sending a JSON object to PHP using jQuery via $.ajax({ url: myURL, type:
I am preparing and sending a JSON string from my PHP file to my

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.