![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Dear all, I have build a remote object host in a windows service. Everything work fine when the client call the remote object. Now I try to make the client part more configurable in the sense that I would like to not hard coded the URl pass to the Activator.GetObject For that I have added a client entry in my Client application config file as follow : client wellknown type="Maillefer.Remote.Data.Event,EventStorage" url="tcp://localhost:8090/Event" / /client |
|
Second how to retrive the url part ? |
#3
| |||
| |||
|
|
calderara schreef: Dear all, I have build a remote object host in a windows service. Everything work fine when the client call the remote object. Now I try to make the client part more configurable in the sense that I would like to not hard coded the URl pass to the Activator.GetObject For that I have added a client entry in my Client application config file as follow : client wellknown type="Maillefer.Remote.Data.Event,EventStorage" url="tcp://localhost:8090/Event" / /client (Under the assumption that client is under configuration system.runtime.remoting > application it seems ok, ) ?xml version="1.0" encoding="utf-8" ? configuration system.runtime.remoting application client wellknown mode="SingleCall" type="Be.TimVanWassenhove.Demo.PersonContract.IPer sonService, PersonContract" url="http://localhost:2849/PersonService.rem"/ /client channels channel ref="http" useDefaultCredentials="true" clientProviders formatter ref="binary"/ /clientProviders /channel /channels /application /system.runtime.remoting /configuration Second how to retrive the url part ? // load configuration from App.config RemotingConfiguration.Configure(AppDomain.CurrentD omain.SetupInformation.ConfigurationFile, false); // get an instance private static object GetService(string fullName) { // get all the configured types WellKnownClientTypeEntry[] wellKnownClientTypeEntries = RemotingConfiguration.GetRegisteredWellKnownClient Types(); foreach (WellKnownClientTypeEntry welknownClientTypeEntry in wellKnownClientTypeEntries) { if (welknownClientTypeEntry.ObjectType.FullName == fullName) { return Activator.GetObject(welknownClientTypeEntry.Object Type, welknownClientTypeEntry.ObjectUrl); } } } } -- Tim Van Wassenhove - Read my mind <url:http://www.timvw.be/ |
#4
| |||
| |||
|
|
Thnaks for your sample tim...I appreciate.. But one more question, why are you also specifing the WellKnown mode in your client configuation ? |
|
An other thing why ar you seeting your end point with the .rem extension ? this extension is used only if remote object is host under IIS right ? |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |