title: How to throw an exception to the client over wcf callback
body: <p>I have a wcf service which has a one way operation and it sends the result in a callback. Here is my service definition</p>
  
  <pre><code> [ServiceContract(CallbackContract = typeof(IIrmCallback), SessionMode = SessionMode.Required)]
      public interface IFileService
      {
         [OperationContract(IsOneWay = true, IsInitiating = false, IsTerminating = false)]
         [ServiceKnownType(typeof(StatementFile))]
         [ServiceKnownType(typeof(InvoiceFile))]
         void UploadFile(IFile file);
      }
  
      public interface IFileCallback
      {
         [OperationContract]
         void FileProcessed(string result);
      }
  
  public MyService : IFileService
  {
    IFileCallBack callbackchannel;
    object result;
    public void UploadFile(IFile file)
  {
     callbackChannel = OperationContext.Current.GetCallbackChannel&lt;IIrmCallback&gt;();
     Task.Factory.StartNew(() =&gt; ProcessFile(file));
  }
  private ProcessFile(IFile file)
  {
  // file gets processed
   callbackChannel.FileProcessed(result)
  }
  }
  </code></pre>
  
  <p>So now if there is some error during the file processing is there someway I can throw an exception back to the caller in the callback?</p>