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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:44:28+00:00 2026-06-05T20:44:28+00:00

When this quick one hour project came up I never thought that 2 days

  • 0

When this “quick one hour” project came up I never thought that 2 days later I would be on Stackoverflow asking this question. However, here we go…

I have a number of external client applications (java, perl, php, c#) that are currently calling GET methods on a WCF REST service that returns JSON. This is working fine and is implemented exactly as you would expect.

I now have a requirement for these same applications to POST JSON into an new method on the original service interface. The C# app uses WebClient, Perl and PHP are using CURL, Java is using some magic that I am not involved with. All of them generate the JSON as a string and then call basic HTTP functionality to POST the data to an endpoint.

The issue is that the JSON we are using does not have a C# class associated with it (for reasons that can’t be changed), as such we intend to use strings and json.net to parse/handle the incoming data. As an example, the endpoint could be:

https://magic.myserver.com/service/dataaggregator/

the external applications post a JSON string to this and in the underlying code we parse and handle as necessary.

So the question is a very simple one, how would this be implemented from a service interface perspective? I can handle serialisation/management of the JSON string within the service code without any problems the question is how do I get that string of JSON into the service code in the first place.

At the moment I am thinking that these can’t be done using a “normal” WCF REST interface, rather I will have to implement a lower level HTTP listener where I can access the incoming post data directly.

  • 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-05T20:44:31+00:00Added an answer on June 5, 2026 at 8:44 pm

    If you want to accept arbitrary JSON, look here:

    http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/071f73bb-e141-4a68-ae61-05635382934f

    If that’s not what you want, then you may need to clarify your goals in the question.

    See also, https://stackoverflow.com/a/7360619 and https://stackoverflow.com/a/2330219

    The service interface is like this:

    [OperationContract]
    public Whatever  MyMethod(DataPacket rawJSON)
    { 
         ....
    }
    
    [DataContract]
    public class DataPacket
    {
      [DataMember]
      public JsonDictionary Registration { get; set; }
    }
    

    …where JsonDictionary is defined according to this answer.

    You can also code the method to accept a stream, like this:

    [OperationContract]
    public Whatever  MyMethod(Stream rawJSON)
    { 
         ....
    }
    

    …and parse the JSON yourself, according to this answer.

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

Sidebar

Related Questions

Just a quick one, hopefully. I've coded up this: <script> $(div.design-project).css('display', 'none'); function InsertContent(tid)
Just a quick and specific question, this has stumped me for half an hour
Hopefully this is a quick question. I'm making a simple rock paper scissors game.
I hope this is a quick question I hope. I need to write some
This is just a quick question to understand correctly what happens when you create
This is just a quick question in C#. I have a scenario where I
This is probably a quick question. I'd like to run the YUI compressor so
hope this will be a quick easy question, I've just tried my app on
Hopefully this is a quick one! I have an editable grid using 'clientSide' (local)
Hopefully this is a quick one, and Easy if you know how... I'm writing

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.