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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:03:12+00:00 2026-06-04T14:03:12+00:00

I am using IPWorks nsoftware for creating service. In it, to call a service

  • 0

I am using IPWorks nsoftware for creating service. In it, to call a service I am using

        Rest rest = new Rest();
        rest.Accept = "application/json";
        rest.ContentType = "application/json";
        rest.User = "UserName";
        rest.Password = "Password";
        rest.Get(@"http://Foo.com/roles.json");
        string result = rest.TransferredData;
        var listRoles = JsonSerializer.DeserializeFromString<List<role>>(result);

I am getting the Json response as a string

[{“role”:{“name”:”Administrator”,”created_at”:”2012-02-11T09:53:54-02:00″,”updated_at”:”2012-04-29T23:43:47-04:00″,”id”:1″}},{“role”:{“name”:”NormalUser”,”created_at”:”2013-02-11T08:53:54-02:00″,”updated_at”:”2013-04-29T23:43:47-03:00″,”id”:2″}}]

Here the json string contains my domain object “role” which gets appended to my response (i.e the body style of the message is wrapped) .
I am using ServiceStack.Text’s Deserializer to convert the response string to my object. But since it’s wrapped, the deserilization is incorrect.

Is there anything that I am missing here ? Is there any “BodyStyle” attribute which could be added to the Rest request?

  • 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-04T14:03:13+00:00Added an answer on June 4, 2026 at 2:03 pm

    The GitHubRestTests shows some of the different ways you can deserialize a 3rd party json API with ServiceStack’s JSON Serializer.

    If you want to deserialize it into typed POCOs then judging by your JSON payload the typed POCOs should look something like:

    public class RolePermissionWrapper 
    {
        public Role Role { get; set; }
        public Permission Permission { get; set; }
    }
    
    public class Role 
    { 
        public long Id { get; set; } 
        public string Name { get; set; } 
        public DateTime? Created_At { get; set; } 
        public DateTime? Updated_At { get; set; } 
    } 
    
    var listRoles = JsonSerializer.DeserializeFromString<List<RolePermissionWrapper>>(result);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using C#, I need a class called User that has a username, password, active
using (var file_stream = File.Create(users.xml)) { var serializer = new XmlSerializer(typeof(PasswordManager)); serializer.Serialize(file_stream, this); file_stream.Close();
Using android 2.3.3, I have a background Service which has a socket connection. There's
Using Android TelephonyManager an application can obtain the state of data activity over the
using xmltextreader, how would I load a hashtable. XML: <base><user name=john>2342343</user><user name=mark>239099393</user></base> This was
Using restlet, I want to make a post to android's c2dm service. I have
Using the http://www.ifans.com/forums/showthread.php?t=132024 post from another question i am allowing the user to enter
using VB.Net2010 I need to call a C# DLL The problem I have is
Using Android 2.1+. I have a service that gets killed from time to time
Using Server.Transfer to show a page that informs the user that the web site

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.