473,383 Members | 1,762 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,383 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 1406
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.