[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

Re: How to get this done?Any clue or examples?

Allen Anderson

6/25/2004 5:21:00 PM

this is a very simple remoting client/server concept. You need to
host a 'remote object' in server B and consume it from server A. So
for the purposes of this discussion, server B becomes the real server
while server A becomes the client. Check out this example of how to
do a basic remoting server. Instead of hosting the objects in console
apps like I have done, host and consume them from your services.

http://www.glacialcomp.../ArticleDetail.aspx?articleID=Re...

Allen Anderson
http://www.glacialcomp...
mailto: allen@put my website url here.com


On Fri, 25 Jun 2004 08:47:35 -0700, "Sachi"
<Sachi@discussions.microsoft.com> wrote:

>Hi,
> I am having two windows services A, B.
> At certain point I need to invoke a method in B from A.
> I could search in documentations and see that it could be possible.
> As I am not any expert in remoting, here I am looking for some experts comments.
>
> Is there any example to show this kind of functionality?
>
>Thanks and Regards,
>Sachi

7 Answers

Sachi

6/28/2004 1:18:00 AM

0

Hi Allen,
Thanks for your update. Yes, I saw your example. Is there any example where i can see them as services A and B?
Hope you could help me out in this.

Thanks and Regards,
Sachi
"Allen Anderson" wrote:

> this is a very simple remoting client/server concept. You need to
> host a ''remote object'' in server B and consume it from server A. So
> for the purposes of this discussion, server B becomes the real server


Allen Anderson

6/28/2004 4:29:00 AM

0

Hi Sachi,

Putting these into service objects is really easy. Are you just
lookikng for examples of where to put it in the service object? I''m a
bit confused.

Cheers,
Allen Anderson
http://www.glacialcomp...
mailto: allen@put my website base here.com

On Sun, 27 Jun 2004 18:18:01 -0700, "Sachi"
<Sachi@discussions.microsoft.com> wrote:

>Hi Allen,
> Thanks for your update. Yes, I saw your example. Is there any example where i can see them as services A and B?
> Hope you could help me out in this.
>
>Thanks and Regards,
>Sachi
>"Allen Anderson" wrote:
>
>> this is a very simple remoting client/server concept. You need to
>> host a ''remote object'' in server B and consume it from server A. So
>> for the purposes of this discussion, server B becomes the real server
>

Sachi

6/28/2004 5:49:00 AM

0

Hi Allen,
Sorry, I could''nt get through that example which you had in your site. When using, you are using shareDLL concept. I could''nt get through in my application with two services.
That is the reason why I am looking for you to discuss on this issue.

Services are derived from ServiceProcess.ServiceBase. I am not sure for remoting should it be remoting marshalref should be used.

Looking for your comment.

Thanks and Regards,
Sachi
"Allen Anderson" wrote:

> Hi Sachi,
>
> Putting these into service objects is really easy. Are you just
> lookikng for examples of where to put it in the service object? I''m a
> bit confused.
>
> Cheers,
> Allen Anderson
> http://www.glacialcomp...
> mailto: allen@put my website base here.com
>
> On Sun, 27 Jun 2004 18:18:01 -0700, "Sachi"
> <Sachi@discussions.microsoft.com> wrote:

Sachi

6/28/2004 6:40:00 AM

0

Hi Allen,
Both the services are exe''s right.
Should I still want to follow that shareDLL logic to access method in serviceB from serviceA?

Thanks and Regards,
Sachi

"Allen Anderson" wrote:

> Hi Sachi,

Allen Anderson

6/28/2004 2:13:00 PM

0

the way you should set it up is exactly as follows, and yes you should
definitely use the shared.dll concept.


Create system service Project for Server A (hereafter mentioned as
CLIENT).

Create System service project for Berver B.

Create share.dll project.

Place the remote object proxy class in the share dll (like my example)
that inherits from marshalbyrefobject.

Create a new class in the server B that inherits from the proxy class,
this will be your remote object.

Go to the service run area of Service B of your system service (there
should be comment lines saying, put your code here or some such, i
forget exactly). Serve up your remote object there (check out my
example in the ''server'' portion of my example project on how to do
this.

Now go back to service A and whereever you want to ''use'' the remote
object residing in Service B, just use the client code I provided in
my example.

That should be all. One mistake I think you are making is you are
trying to serve the service object which you can''t do. You have to
serve up a seperate object INSIDE the service object to get access to
that service.

Cheers,
Allen Anderson
http://www.glacialcomp...
mailto: allen@put my website base here.com


On Sun, 27 Jun 2004 23:40:01 -0700, "Sachi"
<Sachi@discussions.microsoft.com> wrote:

>Hi Allen,
> Both the services are exe''s right.
> Should I still want to follow that shareDLL logic to access method in serviceB from serviceA?
>
>Thanks and Regards,
>Sachi
>
>"Allen Anderson" wrote:
>
>> Hi Sachi,

Allen Anderson

6/28/2004 2:36:00 PM

0

check my related answer to your other msg

On Sun, 27 Jun 2004 22:49:01 -0700, "Sachi"
<Sachi@discussions.microsoft.com> wrote:

>Hi Allen,
> Sorry, I could''nt get through that example which you had in your site. When using, you are using shareDLL concept. I could''nt get through in my application with two services.
> That is the reason why I am looking for you to discuss on this issue.
>
> Services are derived from ServiceProcess.ServiceBase. I am not sure for remoting should it be remoting marshalref should be used.
>
> Looking for your comment.
>
>Thanks and Regards,
>Sachi
>"Allen Anderson" wrote:
>
>> Hi Sachi,
>>
>> Putting these into service objects is really easy. Are you just
>> lookikng for examples of where to put it in the service object? I''m a
>> bit confused.
>>
>> Cheers,
>> Allen Anderson
>> http://www.glacialcomp...
>> mailto: allen@put my website base here.com
>>
>> On Sun, 27 Jun 2004 18:18:01 -0700, "Sachi"
>> <Sachi@discussions.microsoft.com> wrote:

Sachi

6/29/2004 6:57:00 AM

0

Hi Allen,
I solve it finally with the example provided by richerd.
Thanks a lot for updating me with your example too.

Cheers!
Sachi

"Allen Anderson" wrote:

> the way you should set it up is exactly as follows, and yes you should
> definitely use the shared.dll concept.
>
>
> Create system service Project for Server A (hereafter mentioned as
> CLIENT).
>
> Create System service project for Berver B.
>
> Create share.dll project.
>
> Place the remote object proxy class in the share dll (like my example)
> that inherits from marshalbyrefobject.
>
> Create a new class in the server B that inherits from the proxy class,
> this will be your remote object.
>
> Go to the service run area of Service B of your system service (there
> should be comment lines saying, put your code here or some such, i
> forget exactly). Serve up your remote object there (check out my
> example in the ''server'' portion of my example project on how to do
> this.
>
> Now go back to service A and whereever you want to ''use'' the remote
> object residing in Service B, just use the client code I provided in
> my example.
>
> That should be all. One mistake I think you are making is you are
> trying to serve the service object which you can''t do. You have to
> serve up a seperate object INSIDE the service object to get access to
> that service.
>
> Cheers,
> Allen Anderson
> http://www.glacialcomp...
> mailto: allen@put my website base here.com
>
>
> On Sun, 27 Jun 2004 23:40:01 -0700, "Sachi"
> <Sachi@discussions.microsoft.com> wrote:
>
> >Hi Allen,
> > Both the services are exe''s right.
> > Should I still want to follow that shareDLL logic to access method in serviceB from serviceA?
> >
> >Thanks and Regards,
> >Sachi
> >
> >"Allen Anderson" wrote:
> >
> >> Hi Sachi,
>
>