I have a .net web service that takes some xml data.
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.
I am not having any luck doing this.
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'.
I have also tried Context.Response.Redirect(url, end); which generate a 302 exception(Object moved).
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.
// 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 "<retcode>somecode</retcode>";
}
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?
Thanks
Mike