Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How can you specify remoting parameters using Config files
How can you specify remoting parameters using Config files ?
✍: Guest
Both remoting server and remoting client parameters can be provided through config files. Below is a sample of server config file which provides all remoting parameter values which we where providing through code.
<configuration> <system.runtime.remoting> <application name=”Server”> <service> <wellknown mode=”SingleCall” type=”Server.ClsServer, Server” objectUri=”RemoteObject” /> </service> <channels> <channel ref=”tcp server” port=”9000" /> </channels> </application> </system.runtime.remoting> </configuration>
Later this config file can be loaded using the following code.
RemotingConfiguration.Configure(AppDomain.CurrentDomain.SetupInformation.ApplicationBase
& “Server.config”)
Same way we also have client.config file for loading the client remoting parameters.
<configuration> <system.runtime.remoting> <application name=”Client”> <client url=”tcp://localhost:9000/RemoteObject”> <wellknown type=”CommonInterface.Icommon, Icommon” url = “tcp://localhost:9000/Server/RemoteObject”/> </client> <channels> <channel ref=”tcp client” /> </channels> </application> </system.runtime.remoting> </configuration> client remoting can then load the configuration file by using :- Dim IobjCommon As CommonInterFace.Icommon Dim StrData As String Dim objServiceEntries As WellKnownClientTypeEntry() RemotingConfiguration.Configure(AppDomain.CurrentDomain.SetupInformation.ApplicationBase & “Client.config”) objServiceEntries = RemotingConfiguration.GetRegisteredWellKnownClientTypes() IobjCommon = Activator.GetObject(GetType(Icommon), objServiceEntries(0).ObjectUrl.ToString()) StrData = IobjCommon.GetValue() Console.WriteLine(“ Serve side Data is “ & StrData) Console.ReadLine()
2007-10-23, 5305👍, 0💬
Popular Posts:
What Is the "@SuiteClasses" Annotation? "@SuiteClasses" is a class annotation defined in JUnit 4.4 i...
What will be printed as the result of the operation below: main() { int x=20,y=35; x=y++ + x++; y= +...
How To Get the Last ID Assigned by MySQL? - MySQL FAQs - Managing Tables and Running Queries with PH...
Why does malloc(0) return valid memory address? What's the use? malloc(0) does not return a non-NULL...
when should the volatile modifier be used? The volatile modifier is a directive to the compiler's op...