title: Consume form data by wcf service sending by post
body: <p>I read some articles about this and I find that to achive that wcf get data from post request we add </p>
  
  <pre><code>[ServiceContract]
  public interface IService1 {
    [OperationContract]
    [WebInvoke(
        Method = "POST",
        BodyStyle = WebMessageBodyStyle.Bare,
        UriTemplate = "/GetData")]
    void GetData(Stream data);
  }
  </code></pre>
  
  <p>and in implementation </p>
  
  <pre><code>public string GetData( Stream input)
  {
      long incomingLength = WebOperationContext.Current.IncomingRequest.ContentLength;
      string[] result = new string[incomingLength];
      int cnter = 0;
      int arrayVal = -1;
      do
      {
          if (arrayVal != -1) result[cnter++] = Convert.ToChar(arrayVal).ToString();
          arrayVal = input.ReadByte();
      } while (arrayVal != -1);
  
      return incomingLength.ToString();
  }
  </code></pre>
  
  <p>My question is what should I do that in submit action in form request will send to my service and consume?</p>
  
  <p>In Stream parameter will I have post information from form to which I could get by Request["FirstName"]?</p>