title: Upload file together with multiple parameters using restful wcf
body: <p>I am trying to create a wcf rest service using visual studio 2012 and .net framework 4.5.
  The service will try to upload a file together with 4 or more parameters. I want to do this in only one call. I want to use the http "put" method. But I keep having these 2 errors. </p>
  
  <p>Operation 'AddFile' in contract 'IRestBasketService' has multiple request body parameters, one of which is a Stream. When the Stream is a parameter, there can be no other parameters in the body.
  (When I am using BodyStyle wrapped)</p>
  
  <p>and </p>
  
  <p>Operation 'AddFile' of contract 'IRestBasketService' specifies multiple request body parameters to be serialized without any wrapper elements. At most one body parameter can be serialized without wrapper elements. Either remove the extra body parameters or set the BodyStyle property on the WebGetAttribute/WebInvokeAttribute to Wrapped.
  (When I am using BodyStyle bare)</p>
  
  <p>What should I do ?</p>
  
  <p>Bellow are the 2 signatures giving me the errors</p>
  
  <pre><code> [WebInvoke(Method = "PUT",
              BodyStyle = WebMessageBodyStyle.Bare,
              ResponseFormat = WebMessageFormat.Json,
              UriTemplate = "AddFile?key={key}&amp;email={email}&amp;fileName={fileName}&amp;groupID={groupID}&amp;ID={objectID}")]
    Response AddFile(string key, string email, string fileName, string type, string objectID, string groupID, Stream fileStream );
  
  [WebInvoke(Method = "PUT",
             BodyStyle = WebMessageBodyStyle.Wrapped,
             ResponseFormat = WebMessageFormat.Json,
             RequestFormat = WebMessageFormat.Json,
             UriTemplate = "/AddFile")]
   Response AddFile(AddFileRequest request, Stream FileStream);
  </code></pre>
  
  <p>I'm using the webHttpBinding and the webHttp behaviour in the web.config.</p>