title: WCF RESTful Post with Stream return
body: <p>I have WCF Web service using https. It has next interface:</p>
  
  <pre><code>[ServiceContract]
  class Service
  {
      [OperationContract]
      [WebInvoke(UriTemplate="Method", BodyStyle=WebMessageBodyStyle.Bare)]
      byte[] Method(Stream request)
      {
          // ... Some logic ...
          return someBytes;
      }
  }
  </code></pre>
  
  <p>This works good but has one little issue. After method completition it closes up https connection. I have another method in service with WebGet. It returns Stream object, and this one doesn't close https connection.
  I've tried to use same approach in my first Method and rewrited it as follows:</p>
  
  <pre><code>[ServiceContract]
  class Service
  {
      [OperationContract]
      [WebInvoke(UriTemplate="Method", BodyStyle=WebMessageBodyStyle.Bare)]
      Stream Method(Stream request)
      {
          // ... Some logic ...
          return new MemoryStream(someBytes);
      }
  }
  </code></pre>
  
  <p>But when I'm trying to consume Method with a client the service responds: "Method not allowed. Allowed: GET, HEAD".
  Please tell me if I'm doiing it wrong by returning Stream object, or I have missed something.</p>
  
  <p>UPD:
  I also appreciate in any hints about tracing down this problem.</p>