473,721 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Remoting object - "Requested Service Not Found"

Hi All,

I have a Windows Service that runs well. The service hosts a remote object.
The purpose of the object is so that I can "peak" into the service to see
what it's doing. I wrote a small Windows Application that connects to the
remote object and prints out status information.
Everything works fine when I first start the service. However, after some
period, when I attempt to connect to the remote object, I get "Requested
Service not Found" when I try to bind to it.

I can confirm that the Service is still running, because it is doing what it
is supposed to be doing (processing logfiles) but the Remote Object isn't
working. The Remote Object is instantiated in the main thread for the
service, so it's not that the remote object is getting destroyed.

Some more troubleshooting shows that it isn't on the second connection
attempt that I cannot connect. I thought it might be the local object
destroying the remote object when the "client" app closes. This doesn't seem
to be the case.

The instance of the remote object is populated by the service with
information as it is running. So I'm fairly certain the the actual instance
of the object still exists, because if it was destroyed, then the service
would probably crash, which it doesn't.

Anyone have any ideas on what I'm doing wrong or not doing?

Here is the server side code that creates the object: (Object name is
"AllStatus" )

HttpChannel channel = new
HttpChannel(Con vert.ToInt32(Co nfigurationSett ings.AppSetting s["StatusPort "])
);
ChannelServices .RegisterChanne l(channel);
ObjRef refl = RemotingService s.Marshal(AllSt atus,"objectlur i");

Here is the client code that attempts to connect to it:

string RemoteConnectio n = "http://" + this.textBox1.T ext + ":" +
this.textBox3.T ext + "/objectluri";

RemotingConfigu ration.Register WellKnownClient Type(typeof(Ses sionLogger.Serv i
ceStatus),Remot eConnection );
object1 = new SessionLogger.S erviceStatus();

To get the obvious questions out of the way, yes, I'm sure that the host and
port numbers are the same.

Thanks in Advance..

Steve



Nov 16 '05 #1
3 19710
Steve,

Is there a reason why you are not registering the type on the service
side? My guess is that you are marshaling a reference, and that the lease
is dying out. You should be configuring the type on the server to be
marshaled (using the static RegisterWellKno wnServiceType method on the
RemotingConfigu ration class).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Steve Lutz" <sl*********@co mcast.net> wrote in message
news:Of******** ******@TK2MSFTN GP12.phx.gbl...
Hi All,

I have a Windows Service that runs well. The service hosts a remote object. The purpose of the object is so that I can "peak" into the service to see
what it's doing. I wrote a small Windows Application that connects to the
remote object and prints out status information.
Everything works fine when I first start the service. However, after some
period, when I attempt to connect to the remote object, I get "Requested
Service not Found" when I try to bind to it.

I can confirm that the Service is still running, because it is doing what it is supposed to be doing (processing logfiles) but the Remote Object isn't
working. The Remote Object is instantiated in the main thread for the
service, so it's not that the remote object is getting destroyed.

Some more troubleshooting shows that it isn't on the second connection
attempt that I cannot connect. I thought it might be the local object
destroying the remote object when the "client" app closes. This doesn't seem to be the case.

The instance of the remote object is populated by the service with
information as it is running. So I'm fairly certain the the actual instance of the object still exists, because if it was destroyed, then the service
would probably crash, which it doesn't.

Anyone have any ideas on what I'm doing wrong or not doing?

Here is the server side code that creates the object: (Object name is
"AllStatus" )

HttpChannel channel = new
HttpChannel(Con vert.ToInt32(Co nfigurationSett ings.AppSetting s["StatusPort "]) );
ChannelServices .RegisterChanne l(channel);
ObjRef refl = RemotingService s.Marshal(AllSt atus,"objectlur i");

Here is the client code that attempts to connect to it:

string RemoteConnectio n = "http://" + this.textBox1.T ext + ":" +
this.textBox3.T ext + "/objectluri";

RemotingConfigu ration.Register WellKnownClient Type(typeof(Ses sionLogger.Serv i ceStatus),Remot eConnection );
object1 = new SessionLogger.S erviceStatus();

To get the obvious questions out of the way, yes, I'm sure that the host and port numbers are the same.

Thanks in Advance..

Steve



Nov 16 '05 #2
Are you instantiating the remoting object in Main() ??? That's probably not the right place to do it - try initialising your remoting layer in the OnStart() event

There's an article here that describes something similar to what you are doing
http://msdn.microsoft.com/library/de...et11272001.asp
Nov 16 '05 #3
Hi Nicholas,

I was able to figure out the problem, it WAS because the lease was dying. My
problem is that I needed the remote client to connect to the same instance
of the object, not a new one. I read that if I did a singleton, it would
only create one object of the class, but it seems that it was creating one
instance of the class for remote clients, and one for non-remote. This
wouldn't work, and this is the only way I could find to have a remote client
connect to the same instance of a local instantiated object.

I fixed it by overriding the default
MarshalByRefObj ect.InitializeL ifetimeService to return null, which tells
Remoting that the lease should never expire.

Unless you know of a way to have a remote object connect to an exisiting
instance of a class that the server created, I think I'm going to stick with
this method.

Thanks

Steve

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Steve,

Is there a reason why you are not registering the type on the service
side? My guess is that you are marshaling a reference, and that the lease
is dying out. You should be configuring the type on the server to be
marshaled (using the static RegisterWellKno wnServiceType method on the
RemotingConfigu ration class).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Steve Lutz" <sl*********@co mcast.net> wrote in message
news:Of******** ******@TK2MSFTN GP12.phx.gbl...
Hi All,

I have a Windows Service that runs well. The service hosts a remote object.
The purpose of the object is so that I can "peak" into the service to see what it's doing. I wrote a small Windows Application that connects to the remote object and prints out status information.
Everything works fine when I first start the service. However, after some period, when I attempt to connect to the remote object, I get "Requested Service not Found" when I try to bind to it.

I can confirm that the Service is still running, because it is doing what it
is supposed to be doing (processing logfiles) but the Remote Object

isn't working. The Remote Object is instantiated in the main thread for the
service, so it's not that the remote object is getting destroyed.

Some more troubleshooting shows that it isn't on the second connection
attempt that I cannot connect. I thought it might be the local object
destroying the remote object when the "client" app closes. This doesn't

seem
to be the case.

The instance of the remote object is populated by the service with
information as it is running. So I'm fairly certain the the actual

instance
of the object still exists, because if it was destroyed, then the service would probably crash, which it doesn't.

Anyone have any ideas on what I'm doing wrong or not doing?

Here is the server side code that creates the object: (Object name is
"AllStatus" )

HttpChannel channel = new

HttpChannel(Con vert.ToInt32(Co nfigurationSett ings.AppSetting s["StatusPort "])
);
ChannelServices .RegisterChanne l(channel);
ObjRef refl = RemotingService s.Marshal(AllSt atus,"objectlur i");

Here is the client code that attempts to connect to it:

string RemoteConnectio n = "http://" + this.textBox1.T ext + ":" +
this.textBox3.T ext + "/objectluri";

RemotingConfigu ration.Register WellKnownClient Type(typeof(Ses sionLogger.Serv i
ceStatus),Remot eConnection );
object1 = new SessionLogger.S erviceStatus();

To get the obvious questions out of the way, yes, I'm sure that the host

and
port numbers are the same.

Thanks in Advance..

Steve




Nov 16 '05 #4

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

Similar topics

1
1913
by: BKDotCom | last post by:
I'd like to serve an image-not-found image for images... that aren't found.. I'm already using a custom 404 handler page.. but this question could apply to images retrieved from a database or script or whatever... Anyhow, is the 1st method OK, or should #2 be used? ie, does the client/bot or whatever recognize the 404 on method 1? Or, does it think everything is dandy because of the redirect. header('HTTP/1.0 404 Not Found');
0
511
by: Ari Royce Hidayat | last post by:
Dear ALL, Is there some one ever faces this problem? And fix it? The scenario is: There's an html page that hosts a .net object (using object tag), and this page opens the second html page that also hosts a .net object (e.g. by click a hyperlink).
0
1706
by: Ari Royce Hidayat | last post by:
Tx a lot for idea. I've tried it, and still get not clue what causes it. I also tried to see the log file generated by IEHost (by adding IEHostLogFile to registry) and still get not clue what causes. It seems normal instead that before loading the second page (in third row from last row) there's a text read as:
2
1855
by: Andy Norman | last post by:
I have a strange problem. When I try to call the input property of the MSXML processor object from VBScript in an ASPX page I get the error "Member not found". The same code (with a few "set" statements added) works find in ASP. What on earth is going on ? I can't find anything in the knowledge base on it.
7
12030
by: hazz | last post by:
this is a repost with more concise code (well, for me) and better questions (I hope....) . given the following two classes, my intent is to use either Activator.CreateInstance or InvokeMember pass a token into the instantiated class DBPassword and return a string; ************************************** namespace DBPasswordProvider public class DBPassword {
5
2187
by: Nick | last post by:
Hi there, I despearately need to get IIS working with ASP.NET, but I still can't see any "Web Service Extensions". My previous question regarding this ended in the decision to uninstall .NET Framework 1.1 then reinstall, unfortunately this seems to have done nothing. I've tried calling aspnet_regiis in a number of ways but that seems to do nothing either, even though it says that uninstallation and installation completes...
3
2596
by: Charles Law | last post by:
This is driving me mad. Can someone please put me out of my misery? I have a DataSet which I wish to use as the data source for a grid control (it is actually an Infragistics grid). When I assign to the DataSource property like this UltraGrid1.DataSource = MyDataSet I get the following exception:
3
18235
by: andersond | last post by:
I want input objects to have a light yellow background when they have focus. Here's how I call my function: input name="monthsVacant" id="monthsVacant" disabled="disabled" onFocus="yellowOn('monthsVacant')" And here's my function. function yellowOn(vObject){
6
6789
by: rahulsengupta895 | last post by:
. #define MIN(a,b) (a<b?a:b) #define MAX(a,b) (a>b?a:b) #include "Video.h" #define NO_HUE -1
0
8840
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8730
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9215
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9131
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8007
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4484
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4753
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3189
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2130
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.