I have WCF services exposed using WebGet and WebInvoke that require the data to be wrapped in xml. I would prefer to be able to return raw data without it being wrapped in xml and also allow clients the ability to invoke my service without needing to wrap the request in xml.
I'm serializing the data using protocol buffers and converting the result to a base64String so a WebGet response looks like:
<BinVehicleResp xmlns="http://schemas.datacontract.org/2004/07/NTouchServices.Binary_Types" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<BinVehicle>CgsxMjMtNDU2LTc4ORIFNDQwMDAaBUJsYWNrIgVKZXR0YVIJCJrYqoXAShAE (BINARY DATA)</BinVehicle>
</BinVehicleResp>
And a WebInvoke input must look at a minimum like:
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/"> BINARY DATA </string>
I really just want the BINARY DATA part, especially for the WebInvoke. I can live with the WebGet how it is. Does anyone have any suggestions on how I can allow clients to be able to do an HTTP POST using WebInvoke without the need to wrap the request in xml? Thanks.