473,406 Members | 2,390 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

remoting client -> interface based question

Tom
I have a question.. I am using remoting but on my client side I chose to use
an interface. As a result I was wondering if its still possible to place the
configuration details into a xml config file ?

I have not seen any examples of this does anyone know how I can do this ?
All I've seen are example such as below where an interface calling the
server as such. but I would like to not use this and instead call the config
file as its easily changed without the need to recompile

IRemotingExampleService resService
=(IRemotingExampleService)Activator.GetObject(

typeof(IRemotingExampleService),

"tcp://localhost:9988/RemotingExampleService");

Console.WriteLine("RESUME:\n"+ resService.GetFormattedResume());

Thanks

Tom
Nov 22 '05 #1
1 1407
Instead of using the remoting config on the client side (which apart from setting up channel/formatter combinations other than the defaults is only really used for redirecting new for a type - this doesn't work for interfaces) why not use the appSettings section

<configuration>
<appSettings>
<add key="URL" value="tcp://localhost:9988/RemotingExampleService"/>
</appSettings>
</configuration>

Then your code can look like this

string url = ConfigurationSettings.AppSettings["URL"];
IRemotingExampleService resService =(IRemotingExampleService)Activator.GetObject( typeof(IRemotingExampleService), url);
Console.WriteLine("RESUME:\n"+ resService.GetFormattedResume());

Regards

Richard Blewett - DevelopMentor
http://staff.develop.com/richardb/weblog

nntp://news.microsoft.com/microsoft.public.dotnet.languages.csharp/<41***********************@news.optusnet.com.au>

I have a question.. I am using remoting but on my client side I chose to use
an interface. As a result I was wondering if its still possible to place the
configuration details into a xml config file ?

I have not seen any examples of this does anyone know how I can do this ?
All I've seen are example such as below where an interface calling the
server as such. but I would like to not use this and instead call the config
file as its easily changed without the need to recompile

IRemotingExampleService resService
=(IRemotingExampleService)Activator.GetObject(

typeof(IRemotingExampleService),

"tcp://localhost:9988/RemotingExampleService");

Console.WriteLine("RESUME:\n"+ resService.GetFormattedResume());

Thanks

Tom

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.770 / Virus Database: 517 - Release Date: 27/09/2004

[microsoft.public.dotnet.languages.csharp]
Nov 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dicky Cheng | last post by:
Hi, I am using .net remoting technology. I set up a .net remoting client and server in IIS. When the client calls the server, the server will run a long duration method (30-60seconds). I have a...
3
by: Deepal | last post by:
Hi; I'm doing an example program from a book regarding .NET Remoting. Both the Client and Server are C# Console Applications. Server Code is using System; using System.Runtime.Remoting;...
1
by: vijay | last post by:
Hello I am learnign Dot NEt I have implemted 1. remote object 2.Listener 3.Client Listener started and listening to requests Client started and able to nstantiate remote object But when a...
4
by: GTi | last post by:
I have a program that will act as an Remoting server AND client. This program can be loaded on one macine or it can be loaded on several machines. But it will only be one master program...
0
by: Martijn Damen | last post by:
Hi, At the moment I am trying to develop an application that uses another app over .net remoting and having some problems with it (ok, that is ofcourse why I am here), hope somebody can shine a...
0
by: MS Newsgroups | last post by:
Hi, I am trying to get my head around remoting. I have managed to configure the samples on MSDN and that is working fine. I have now tried to build my own remoting application to test this and i...
4
by: Sharon | last post by:
Hi, I'm using the remoting, and I have a remoting object that has a public event that other processes should register to it. But when the client process is registering to the remote event, it...
1
by: Michael Bray | last post by:
Ok guys here's a tough one... I have a client/server application that uses remoting for communication. I am using Activator.GetObject to create a remoting instance with an URL that specifies the...
9
by: swartzbill2000 | last post by:
Hello, I am trying to build and run the Remoting Sample from MSDN. Everything compiles. The Listener appears to run. The Client throws this RemotingException: A first chance exception of type...
6
by: Palvinder Singh | last post by:
Hello google group peeps, I am new to remoting, but have a grasp of it. I am trying to create a server/client application, which will be deployed over an intranet. I have upwards of five...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.