I am new to web services and especially WCF, so bear with me.
I am writing an API that takes several parameters, such as username, apikey and some parameters, but I also need to send it a string, which can be several thousand words, which is processed and transmitted as a stream. It didn't make sense to just put it in the query string, so I thought I just wanted the body of the message to be sent to the service.
There seems to be no easy way to do this ...
My job contract is as follows
[OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Bare, UriTemplate="Method1?email={email}&apikey={apikey}"+ "&text={text}&quality={qual}", BodyStyle = WebMessageBodyStyle.Bare)] Stream Method1(string email, string apikey, string text, string qual);
And it works. But this is the βtextβ parameter, which I want to pull out and have in the body of the message. One thing I read said that the thread has one more parameter, for example:
Stream Method1(string email, string apikey, string qual, Stream text);
which I could then read. But this generates an error saying that if I want to have a stream parameter, then it should be the only parameter.
So, how can I achieve what I'm trying to do here, or is it not a big deal to send a few thousand words to the query string?