C# 使用webservice重定向到http地址
所以我有一个例子,我有一个Web服务,它应该接收一个调用方,从调用中执行不同的操作,然后将调用方重定向到一个特定的地址C# 使用webservice重定向到http地址,c#,web-services,redirect,C#,Web Services,Redirect,所以我有一个例子,我有一个Web服务,它应该接收一个调用方,从调用中执行不同的操作,然后将调用方重定向到一个特定的地址 public Response myWebservice(jsonObject json) { { //Do other stuff } //Redirect to http://www.myaddress.com/myaddress } 到目前为止,我已经尝试使用一些HttpContext.Current.Respon
public Response myWebservice(jsonObject json)
{
{
//Do other stuff
}
//Redirect to http://www.myaddress.com/myaddress
}
到目前为止,我已经尝试使用一些HttpContext.Current.Response.Redirect(“地址”);但它并没有真正把我带到任何地方,所以我想在这里寻求一些指导,也许能让我走得更远。试试下面的代码:
public Response myWebservice(jsonObject json)
{
{
//Do other stuff
}
//Redirect to http://www.myaddress.com/myaddress
Context.Response.StatusCode = 307;
Context.Response.AddHeader("Location","http://www.myaddress.com/myaddress");
return null;
}
找到代码并Response.Redirect(“http://www.microsoft.com/gohere/look.htm”);您是否也指定了shema??http