title: Redirecting to a Web Page from a Web Service call
body: <p>I have a .net web service that takes some xml data.  </p>
  
  <p>From within the web service, I want to manipulate the data and then call a web page that displays information to the user.  The web service should return after spaning the web page.  </p>
  
  <p>I am not having any luck doing this.  </p>
  
  <p>I have tried Server.Transfer(url, end);  Which generates the exception since my return has been trashed with the transfer:
     Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'.  </p>
  
  <p>I have also tried Context.Response.Redirect(url, end); which generate a 302 exception(Object moved).</p>
  
  <p>I have seen various desciptions on how to handle the 302 error.  However I dont have control over the client.  In this case, my service will be called from a java application so I cant wrap the client side call before making the Web Service call.  I need to do it from within the asmx.  </p>
  
  <pre><code>// this is very basic but the general gist
  [WebMethod]
  public string MyRequest(string someXML)
  {
      // process the xml, dump do database, invoke aspx page
  
      string url = "xxxx.aspx";
      bool end = false;
  
      Server.Transfer(url, end);
      //this.Context.Response.Redirect(url, end);
  
      return "&lt;retcode&gt;somecode&lt;/retcode&gt;";
  }
  </code></pre>
  
  <p>I have looked for examples of this situation or a way to asyncrounously call the web page from within the service and return. Can anyone point me to this pattern or an example?</p>
  
  <p>Thanks</p>
  
  <p>Mike</p>