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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:11:02+00:00 2026-05-23T10:11:02+00:00

Im working with a WCF in which i return JSON. But i get messages

  • 0

Im working with a WCF in which i return JSON. But i get messages looking like

"{\"ids\":[\"id\":1,\"id\":34,\"id\":67,\"id\":100,\"id\":133,\"id\":166,\"id\":199]}"

How do I get rid of the first and last qoutation marks?

EDIT:

public class Ids {
   public IdDetails[] ids{get;set}
}
public class IdDetails{
   public int id {get;set}
}

And here I return JSON

public string GetIds(){
   Ids ids = new Ids();
   List<IdDetails> idd = new List<IdDetails>();
   for(int i=0;i<10; i++){
      idd.add(new IdDetails(i+1*33));
   }
   ids.ids = idd.ToArray();
   JavaScriptSerializer jSerialize = new JavaScriptSerializer();
   string json = jSerialize.Serialize(ids);
   return ids;
}

*EDIT 2: SOLVED *

The method shouldn’t return a string. It should return a Ids-object. No need to serialize.
Set the ResponseFormat = WebMassageFormat.Json and it will work.

Thanks anyways!

  • 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-23T10:11:03+00:00Added an answer on May 23, 2026 at 10:11 am

    JavaScriptSerializer Class

    The JavaScriptSerializer class is used internally by the asynchronous communication layer to serialize and deserialize the data that is passed between the browser and the Web server. You cannot access that instance of the serializer. However, this class exposes a public API. Therefore, you can use the class when you want to work with JavaScript Object Notation (JSON) in managed code.

    To serialize an object, use the Serialize method. To deserialize a JSON string, use the Deserialize or DeserializeObject methods. To serialize and deserialize types that are not natively supported by JavaScriptSerializer, implement custom converters by using the JavaScriptConverter class. Then register the converters by using the RegisterConverters method.

    I’ve used it in non-web applications.

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

Sidebar

Related Questions

I have a project using WCF which was working fine, but I moved the
I have been working on a WCF service which will return a Base64 encoded
I'm working on a self-hosted WCF service for which encrypted communications is an option.
I am using WCF and REST, and I have complex types, which are working
I'm trying to get this sample for AJAX to WCF working, with the following
Running a simple JQuery.get (Version 1.6.2) against a C# WCF Service which returns a
I am working on a project in which a WCF service will be consumed
Can anybody point me in the right direction to get Ninject working with WCF
I have a WCF service, which works if I use one login, but throws
I am attempting to get the WCF Rest Service Template 40 (CS) which is

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.