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.