Sooraj PM
6/13/2004 5:41:00 AM
Hi
The client activated type example:
The web.config content:
<system.runtime.remoting>
<application name = "NameOfApplication">
<client url = "tcp://localhost:12345">
<activated type ="NameSpace.Class,Class"/>
</client>
<channels>
<channel ref = "Tcp"/>
</channels>
</application>
</system.runtime.remoting>
The Code:
Dim CustObject As NameSpace.Class
Dim CustomerMessage As String
RemotingConfiguration.Configure(name of config file)
CustObject = Activator.CreateInstance(GetType(NameSpace.Class))
Sooraj PM
Micorosft India Community Star
"TIBM" wrote:
> Hello. I used remoting as the distributed system in a 3-tier architecture; I actually used the factory pattern and things are looking good.
> However, I didn''t fancy config files in the beginning and now it''s come back to haunt me.
> So, basically, I just need to ask a very basic question about how to use config files for my application.
>
> In my Global.asax.vb, all I have is (for a singleton factory remote object):
> Dim memFactory As IMemberFactory
> memFactory = CType(Activator.GetObject( _
> GetType(IMemberFactory), _
> "tcp://192.168.40.40:9000/MemberFactory.rem"), _
> IMemberFactory)
> What do I need to put in my webconfig file? What am I going to have in the global.asax.vb file?
>
> In my server console host, I have:
> Dim channel As New TcpChannel(9000)
> ChannelServices.RegisterChannel(channel)
> RemotingConfiguration.RegisterWellKnownServiceType( _
> GetType(Member), _
> "MemberFactory.rem", _
> WellKnownObjectMode.Singleton)
> What should I have into a config file, and how should I call those settings?
>
> What I find weird about config files is that they define settings which is ok, but how do they solve assignment (eh memFactory = CType...)?!
>
> Thanks in advance.
> TIBM