public class MyService : System.Web.Services.Protocols.SoapHttpClientProtoc ol {/// <res/> public MyService() { this.Url = "http://sha-schang-01/myservice/myservice.asmx"; }
做法需要2步: 1,添加引用,在引用的属性里设置url为动态引用,此时会自动在 Web.config里<appSettings><add key="MyWebApp.localhost.Service1" value=http://localhost/MyWebService/Service1.asmx/></appSettings> 发布的时候只需要修改这个即可具体参考 http://www.microsoft.com/china/MSDN/library/archives/library/dv_vstechart/html/vbtchredirectingapplicationtotargetdifferentXMLWebServiceduringinstallation.asp在安装期间将应用程序重定向到不同的 XML Web services
System.Web.Services.Protocols.SoapHttpClientProtoc ol {/// <res/>
public MyService() {
this.Url = "http://sha-schang-01/myservice/myservice.asmx";
}
1,添加引用,在引用的属性里设置url为动态引用,此时会自动在 Web.config里<appSettings><add key="MyWebApp.localhost.Service1"
value=http://localhost/MyWebService/Service1.asmx/></appSettings>
发布的时候只需要修改这个即可具体参考
http://www.microsoft.com/china/MSDN/library/archives/library/dv_vstechart/html/vbtchredirectingapplicationtotargetdifferentXMLWebServiceduringinstallation.asp在安装期间将应用程序重定向到不同的 XML Web services