Invoking Windows Services

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Any help would be appreciated. I have come across an Architecture (not
implemented) in my Enterprise, that has a Windows Service (A) written on VB
COM that has to talk to another Windows Service (B) to be written on VB.Net.

I can imagine one can easily write B in VB.Net, but my questions is - is it
possible to invoke a Windows Service? A is supposed to pass an XML message to
B and B is supposed to invoke an array of Components.

To add to the woes, there is a .Net component called "B-Caller" with a CCW
(Com calleable wrapper) that will invoked from A. Do you think this
worthwhile?

Sorry, for the length of the message but to summarize -

1. Is it possible to invoke methods or events from a windows service?
2. Do you think B-Caller is necessary?

Please advice, if you could point me to a specific discussion board for this
- would be great.

Thank you,

Sameer
 
Sameer said:
Any help would be appreciated. I have come across an Architecture (not
implemented) in my Enterprise, that has a Windows Service (A) written on
VB
COM that has to talk to another Windows Service (B) to be written on
VB.Net.

I can imagine one can easily write B in VB.Net, but my questions is - is
it
possible to invoke a Windows Service? A is supposed to pass an XML message
to
B and B is supposed to invoke an array of Components.

To add to the woes, there is a .Net component called "B-Caller" with a CCW
(Com calleable wrapper) that will invoked from A. Do you think this
worthwhile?

Sorry, for the length of the message but to summarize -

1. Is it possible to invoke methods or events from a windows service?
2. Do you think B-Caller is necessary?

Yes, this looks to me like the way it needs to be done. Since A is a VB6
application you will definitely need a COM-callable wrapper in there to
allow it to access types in B, unless you use a sockets kind of approach.

Since this is not written yet, is it absolutely necessary that A be written
in VB6? If you could keep everything in .NET you could eliminate the CCW.

-- Alan
 
Alan,

Thanks for the reply. Could you please help me investigate if it is possible
to "invoke" methods from a Windows service - in this case the A has to pass
an XML message to B and has to receive a processed XML message back.

Sameer
 
Sameer said:
Could you please help me investigate if it is possible
to "invoke" methods from a Windows service - in this case the A has to
pass
an XML message to B and has to receive a processed XML message back.

One approach would be for B to expose a singleton object via .NET Remoting
that the B-Caller CCW would access as a Remoting client. When the B Service
starts up it creates an instance of the singleton then registers a TCP
channel for clients to access. Once the server's singleton is remotely
accessed from the client you can communicate with the service through it.

You will need a good book on .NET Remoting, such as Ingo Rammer's. Also you
can search the web for .NET singleton examples for Windows services.

-- Alan
 
Alan,

Thanks for the reply again. I was wondering if a Singleton handling just one
TCP channel handle multiple requests? A and B are very intensive
applications, handling 1000's of requests per second. Is there a more
scaleable solution?

Ravindran
 
Sameer said:
Thanks for the reply again. I was wondering if a Singleton handling just
one
TCP channel handle multiple requests? A and B are very intensive
applications, handling 1000's of requests per second. Is there a more
scaleable solution?

Ah I see. Then you may want to consider looking into .NET Enterprise
Services, which uses COM+. This would provide a publisher/subscriber event
model using loosely coupled events. You also get access to COM+
transactioning and security. Not sure, though, about the throughput
possible. I'm sure that depends on a lot of factors.

See the Further Reading section here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncomser/html/entsvcperf.asp

Good luck!

-- Alan
 
Back
Top