I am trying to unit test wcf REST Service that accepts both xml content and stream parameter. The rest service call when it accepts just file name (instead of XML) and stream it works fine but passing xml contents through the URL it fails. The reason for XML is there is lot more information about the file that needs to be sent. I understand that sending just the xml parameter would require the bytes to be sent over the request.
I tried various options like embedding CDATA, Convert to base64 and send over and none passed and I get error code 400. Also tried sending request content type as multipart form data multipart/form-data and then embed xml as bytes and then sending stream as bytes but didnt work. I am wondering how I can pass both the xml content as string when the wcf method accepts stream
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "ProcessFile/{xmlContents}")]
string ProcessFile(string xmlContents, Stream uploadStream);
