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, 5221👍, 0💬
Popular Posts:
How To Give a User Read-Only Access to a Database? - MySQL FAQs - Managing User Accounts and Access ...
How do I install JUnit? First I will download the lastest version of JUnit. Then I will extract all ...
Can Sub Procedure/Function Be Called Recursively? - Oracle DBA FAQ - Creating Your Own PL/SQL Proced...
What does address of operator do in background? The AddressOf operator creates a delegate object to ...
How To Enter Characters as HEX Numbers? - MySQL FAQs - Introduction to SQL Basics If you want to ent...