title: HttpContext is not available - Calling Webservice asychronously
body: <p>I currently have a web application project that also includes web services within the same project. I currently have a requirement to call the web service asynchronously. Since, I haven't added the web service as a web reference within the same project, I tried to call the web service method using delegates and I see an exception "HttpContext is not available.   This class can only be used in the context of an ASP.NET request" when I tried to access the Application property in my web service method call.</p>
  
  <pre><code>Web Method in MyWebServices Class
  Public Function ProcessRequest() As Boolean
    If Application(STRING_KEY) Is Nothing Then 'Exception happens here'
       Return True
    Else
       Return False
    End If
  End Sub
  
  .ASPX Codebehind File
  Public Delegate Function ProcessRequestDelegate() As Integer
  
  Protected Sub btnSender_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles sender.Click
    Dim del As ProcessRequestDelegate
    del = New ProcessRequestDelegate(AddressOf ProcessRequest)
    del.BeginInvoke(null, null)
  End Sub
  
  Protected Function ProcessRequest() As Boolean
      Dim services As MyWebService
      services = New MyWebService()
      Return services.ProcessRequest()
  End Function
  </code></pre>
  
  <p>Is what I am trying to do here is the right way to invoke a web method asyncrohously?</p>
  
  <p>Thanks,
  Javid</p>