今天調適一個webservice,發現我的WinForm一直都在調用局域網的Webservice,突然想到,要是我的WinForm程序,想要運行在不同網斷,那應該如何配置我的webservice?

方案一:
1.用一個公用的Webservice.就是把Webservice發布到Internet上,然後,WinForm調用Inernet上的Webservice.

2.在每個局域網都建立Webservice,動態的配置Webservice.  每個Webservice引用后,都會生成一個Reference.cs,然後,在Reference.cs裡面,更改Url或者讀取事先寫在.config文件的Url,編譯成各個局域網的運行程序.

3.建立WebService虚拟代理,使用xml登记WebService的引用地址。实现动态引用WebService.

!

WinForm中動態調用Webservice的問題using System;
WinForm中動態調用Webservice的問題
using System.Reflection ;
WinForm中動態調用Webservice的問題
using System.Web .Services .Description ;
WinForm中動態調用Webservice的問題
using Microsoft.CSharp;
WinForm中動態調用Webservice的問題
using System.CodeDom ;
WinForm中動態調用Webservice的問題
using System.CodeDom.Compiler ;
WinForm中動態調用Webservice的問題
using  System.IO ;
WinForm中動態調用Webservice的問題
using  System.Text ;
WinForm中動態調用Webservice的問題
using System.Xml ;
WinForm中動態調用Webservice的問題
using System.Net ;
WinForm中動態調用Webservice的問題
using WebServiceProxy;
WinForm中動態調用Webservice的問題
WinForm中動態調用Webservice的問題
namespace WebServiceProxy





4.動態調用webservice       (Copy from http://doc.readmen.com/1/133950.shtml)



兄弟們,還有其他的解決方案嗎?一起討論!




 

相关文章: