title: WCF Rest Webservice with stream
body: <p>I read the following post with interest as it is an exact replica of the problem I am experiencing (and driving me insane)
  "For request in operation UploadFile to be a stream the operation must have a single parameter whose type is Stream." -<a href="http://social.msdn.microsoft.com/Forums/en/wcf/thread/80cd26eb-b7a6-4db6-9e6e-ba65b3095267" rel="noreferrer">http://social.msdn.microsoft.com/Forums/en/wcf/thread/80cd26eb-b7a6-4db6-9e6e-ba65b3095267</a></p>
  
  <p>I have pretty much followed all code/examples I have found and yet still cannot get around this error -
  <a href="http://blogs.msdn.com/b/carlosfigueira/archive/2008/04/17/wcf-raw-programming-model-receiving-arbitrary-data.aspx" rel="noreferrer">http://blogs.msdn.com/b/carlosfigueira/archive/2008/04/17/wcf-raw-programming-model-receiving-arbitrary-data.aspx</a></p>
  
  <p>All I would like to achieve is to post an image(jpeg/png) from an android device using the standard filename/stream parameters.More than likely it is something simple that I have misconfigured, misunderstood or left out but I need to have a solution for proof of concept.  </p>
  
  <pre><code> public interface IConXServer
      {
      [OperationContract]
      [WebInvoke(UriTemplate = "UploadImage({fileName})", Method="POST")]
      void UploadImage(string fileName, Stream imageStream);
      }
  
   public class ConXWCFServer : IConXServer
      {
      public void UploadImage(string fileName, Stream imageStream)
         {
         //implement image save
         }
      }
  </code></pre>
  
  <p>web.config settings
      
         
            -->
            
            
         
      </p>
  
  <pre><code>&lt;standardEndpoints&gt;
     &lt;webHttpEndpoint&gt;
         &lt;standardEndpoint name="webHttpEndpoint" helpEnabled="false"/&gt;
     &lt;/webHttpEndpoint&gt;
  &lt;/standardEndpoints&gt;
  
  &lt;bindings&gt;
      &lt;webHttpBinding&gt;
          &lt;binding name="webHttpBinding" transferMode="Streamed"/&gt;
      &lt;/webHttpBinding&gt;
  &lt;/bindings&gt;
  
  &lt;behaviors&gt;
      &lt;endpointBehaviors&gt;
          &lt;behavior name="webHttpBehavior"&gt;
              &lt;webHttp/&gt;
          &lt;/behavior&gt;
      &lt;/endpointBehaviors&gt; 
      &lt;serviceBehaviors&gt;
          &lt;behavior&gt;
              &lt;serviceMetadata httpGetEnabled="false"/&gt;
              &lt;serviceDebug includeExceptionDetailInFaults="true"/&gt;
              &lt;serviceThrottling maxConcurrentCalls="2147483647"  maxConcurrentSessions="2147483647"/&gt;
          &lt;/behavior&gt;
      &lt;/serviceBehaviors&gt;
  &lt;/behaviors&gt;
  </code></pre>
  
  <p>Using vs2010 and IIS Express. If I comment out the above method all the others methods work and return data as well as the wsdl query </p>
  
  <p>Regards and thanks in advance 
  Kern</p>