title: How to make WCF RESTful service work async?
body: <p>I'm building WCF rest service and it's client. I plan, that client does not know much about the service, just right URL's to call methods and expected results.</p>
  
  <p>My service contract is:</p>
  
  <pre><code>[WebInvoke(Method="POST", UriTemplate="/tasks")]
  [OperationContract]
  void SubmitTask(Transaction task);
  
  [WebGet(UriTemplate = "/tasks/{taskId}")]
  [OperationContract]
  [XmlSerializerFormat]
  Transaction GetTask(string taskId);
  </code></pre>
  
  <p>SubmitTask is realized like:</p>
  
  <pre><code>SubmitTask(Transaction task)
  {
     DoSomethingWithTask(task);
     task.Status = "SomeStatus";
     DoSomethingElseWithTaks(task);
     task.Status = "SomeOtherStatus";
  }
  </code></pre>
  
  <p>What I expect on client:</p>
  
  <pre><code>ButtonClick()
  {
     SubmitTask(task);
     while(true)
     {
        string status = Transaction GetTask(task.taskId).Status;
        Textbox.Text+= status;
        if(status==ok)
           break;
        Thread.Sleep(1000); 
     }
  }
  </code></pre>
  
  <p>The problem is - GetTask is not performed on service side, while all SubmitTask operations are completed, so I get only last task status on client side. How to realize asynchronos operation performing in this situation?</p>
  
  <p>Thanks in advance!</p>