So simple in theory, but I have never been a wiz at WCF configuration. What I am trying to do is this: I have a WCF method that matches this signature:
[OperationContract]
[WebInvoke(Method = "POST")]
Stream PostPackets(Stream rawPackets);
All I really care about is getting a byte array from an Android/iPhone/Blackberry/any other type of device, to my wcf service, process the array and then send back a different array of bytes. For all I care, it could look like:
[OperationContract]
[WebInvoke(Method = "POST")]
byte[] PostPackets(byte[] rawPackets);
Though all examples I see seem to use Stream.
I have read many different articles and posts with no straight answer on how to do this outside the context of a file transfer (which is not my intention). Here are the problems I am facing:
1- I assume I need to use webHttpBinding to make this service RESTful. Is this right? If so, can you point me to a sample configuration?
2 - (And this is absolutely what I cannot find anywhere!) I need to be sure that this is not going to be a huge pain for the device developers to consume. Can you show me examples of both Android and iPhone devices consuming a RESTful service AND (very important) how they would send a byte array to my service?
Please forgive my noobiness... WCF configuration is one of those things I don't get to do every day. Once I get my configuration figured out, I generally move on and never have to touch it until my next project (which could be a very long time). Please help!
UPDATE
My colleague suggested that we use http handlers instead of wcf. Do we really have to resort to that?
e.g.:
public void ProcessPackets (HttpContext context)
UPDATE 2:
I am wondering, is there any way to do this without JSON? Is there any downside/alternative to posting the array as type "text/plain"?