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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:12:10+00:00 2026-06-14T06:12:10+00:00

From my Main question at Consuming web service with RESTKIT , I’ve learned some

  • 0

From my Main question at Consuming web service with RESTKIT, I’ve learned some stuff, and came across many more obstacle in learning how to use RestKit.

One of the obstacle now is making my asmx file return the data in JSON. (Following a few method from http://williamsportwebdeveloper.com/cgi/wp/?p=494)

[WebMethod]
    [ScriptMethod( ResponseFormat = ResponseFormat.Json)]
    public string testText()
    {
        string name = "Herro World";
       // return name;
        JavaScriptSerializer js = new JavaScriptSerializer();
        string strJSON = js.Serialize(name);
        return strJSON;

    }

However, the return when I invoke in browser is still <string xmlns="http://tempuri.org/">"Herro World"</string>

I am currently using .net 4.0. I tried reading up on diff article and SO thread, and tried to adapt their setting, but to no avail.

  • 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-14T06:12:11+00:00Added an answer on June 14, 2026 at 6:12 am

    After looking closely at the example given in http://williamsportwebdeveloper.com/cgi/wp/?p=494 and reading up some information and articles, it turns out that we have to parse object. Meaning string could not be parse. The problem is solved by adding in an object to store the string.

    [WebMethod]
    [ScriptMethod( ResponseFormat = ResponseFormat.Json)]
    public string testText()
    {
        string name = "Testing for Json!";
        List<string> arrayList = new List<string>();
        arrayList.Add(name); 
        JavaScriptSerializer js = new JavaScriptSerializer();
        string strJSON = js.Serialize(arrayList);
        return strJSON;   
    }
    

    and this will return <string xmlns="http://tempuri.org/">["Testing for Json!"]</string>

    Hope it help any new comer like me, who are trying to change the return format.

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

Sidebar

Related Questions

The main question: How many digits? Let me explain. I have a number in
Apart from main thread, I've ThinkerThread object _thinker whose finished() signal is connected to
I'm navigating from: Main activity to Activity 2 Activity 2 to Activity 3 Activity
i'm trying to pass a string from main to another function. this string is
How can i control all my forms from main () Form1 frm1 = new
I have 2 classes 'Main' and 'FOR'. From 'Main' I will call method 'display'
what is the difference between calling a mapreduce job from main() and from ToolRunner.run()
I'm trying to copy data from an array of character that send from main
How can I store and pass the contents of r from main to two
I have created a piece of code which takes an IP address (from main

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.