且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用webservice相同的应用程序多个环境

更新时间:2022-06-02 21:41:33

我的想法是,您可以创建一个来管理3个Web服务。然后使用添加/服务参考添加您的Web服务,然后在新的中添加您可以创建所有函数管理3网络服务。



在你的项目中只需要创建一个对象并调用所有网络服务中的函数



My idea is, you can create a class for manage the 3 webservice. Then you add your webservice with Add/Service Reference and then in the new class you can create all the functions for management the 3 webservice.

In your project only need create one object and call the functions in all the webservices.

public class WebService 
{
   #region webservice1
   //functions
   #endregion
   #region webservice2
   //functions
   #endregion
   #region webservice3
   //functions
   #endregion
}

public void GetNames()
{
   WebService ws = new WebService();
   string[] names1 = ws.webservice1_GetNames();
   string[] names2 = ws.webservice2_GetNames();
   string[] names3 = ws.webservice3_GetNames();
}



我希望我能帮到你。

快乐编码


I hope I can help you.
Happy codding