Dealing with .NET Enterprise Services: .NET Remoting, Web Services and Service Components
(Page 1 of 6 )
This article will give you a kick start for learning advanced concepts for .NET Enterprise services such as .NET Remoting, Web Services and Service Components (COM+).
A downloadable file for this article is available
here.
All demonstration solutions have been developed using SQL Server 2000 Enterprise Edition and Visual Studio 2003 Enterprise Architect on Windows Server 2003 Standard Edition. Please note that I didn’t really test the solution on any other versions/editions of similar Microsoft products.
It has been a while since I contributed an article on “Building a Robust and Highly Scalable Distributed Architecture in VB.NET” which you can read at this link: http://www.aspfree.com/c/a/VB.NET/Building-a-Robust-and-Highly-Scalable-
Distributed-Architecture-using-VB-NET/. In that article, I mixed all of the technologies together, or, to put it another way, I integrated them. Now in this article, I would like to provide samples of each of those technologies individually, showing them in ways that are not at all related each other. The previous article gave you enough of an explanation about each of these technologies that I won't repeat myself.
I strongly suggest you go to that link to read a brief overview on the technologies if you are not familiar with them.
Working with the .NET Remoting Server
.NET Remoting is simply a next generation DCOM. Those who are familiar with DCOM, can simply consider .NET Remoting to be something like DCOM+.NET BCL + “some extras too.”
For any Remoting application, there will generally be a server and client (apart from a Remote Object). The Remoting server will continuously listen to the incoming requests of the Remoting client and pass the messages (or info) accordingly. Let us go through the code for the Remoting Server. You can skip to the next section, if you would like to view the definition of “Remoting Object” which is being used by this Remoting Server.
Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnStart.Click
Dim chan As New TcpChannel(8085)
ChannelServices.RegisterChannel(chan)
RemotingConfiguration.RegisterWellKnownServiceType( _
GetType(RemoteObject.HelloServer), _
"SayHello", WellKnownObjectMode.SingleCall)
MessageBox.Show("Server started succesfully...." &
ControlChars.CrLf & "click OK to stop the server")
ChannelServices.UnregisterChannel(chan)
End Sub
It is simply a Windows desktop-based application, which starts to listen to any request from the Remoting client. The Remoting service (according to the above coding) listens at the 8085 port (or TcpChannel).
Next: Working with the Remoting Client and Remoting Object >>
More .NET Articles
More By Jagadish Chaterjee