.NET
  Home arrow .NET arrow Page 2 - Dealing with .NET Enterprise Services: .NE...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
.NET

Dealing with .NET Enterprise Services: .NET Remoting, Web Services and Service Components
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 13
    2006-02-08

    Table of Contents:
  • Dealing with .NET Enterprise Services: .NET Remoting, Web Services and Service Components
  • Working with the Remoting Client and Remoting Object
  • Working with a basic COM application
  • Working with a database-based COM application
  • Working with Web Services
  • Working with database based Web Services

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Dealing with .NET Enterprise Services: .NET Remoting, Web Services and Service Components - Working with the Remoting Client and Remoting Object


    (Page 2 of 6 )

    Now let us go through the code of the Remoting Client.

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
    As System.EventArgs) Handles Button1.Click
     
            Dim chan As New TcpChannel
            ChannelServices.RegisterChannel(chan)
     
            Dim obj As HelloServer = _
                CType(Activator.GetObject(GetType(HelloServer), _
                    "tcp://localhost:8085/SayHello"), HelloServer)
     
            Try
                MessageBox.Show(obj.HelloMethod(Me.TextBox1.Text))
            Catch ex As Exception
                MessageBox.Show("Server could not be located or
    communication error")
            End Try
            ChannelServices.UnregisterChannel(chan)
        End Sub

    You can clearly observe from the above program that the client is trying to contact through the “tcp” protocol (and that too at the 8085 port) with the service name “SayHello.”  Once the client receives the proxy of the server remote object, it can directly execute the methods (“HelloMethod”), as if they are locally available.

    Considering the issue of the “RemoteObject,” it is simply a class which is used for distributed programming.  It is defined as follows within the solution:

    Imports System
    Imports System.Runtime.Remoting
    Imports System.Runtime.Remoting.Channels
    Imports System.Runtime.Remoting.Channels.Tcp
     
    Public Class HelloServer
        Inherits MarshalByRefObject
     
        Public Function HelloMethod(ByVal name As String) As String
            Return "Hi there, " & name
        End Function
     
    End Class

    Every “RemoteObject” (or the class used by the Remoting server to create and share with clients) should be extended from “MarshalByRefObject” (just to give “remote” access).

    More .NET Articles
    More By Jagadish Chaterjee


       · Hai, the article guides you in working with .NET enterprise distributed computing. ...
     

    .NET ARTICLES

    - Using CrystalReportViewer to Display Crystal...
    - Creating Summary .Net Crystal Reports
    - More on Commands, Input and the WPF
    - Grouping and Aggregating When Querying LINQ ...
    - Commands, Input and the WPF
    - Keyboard and Ink Input with WPF
    - Mouse Input and the WPF
    - Input with Windows Presentation Foundation
    - Introducing LINQ with XML and Databases
    - An Introduction to LINQ
    - Querying LINQ to SQL: Basics
    - Completing a Simple Storefront with LINQ
    - Knowing Your Environment: the System.Environ...
    - Creating the Home Page for a Simple Storefro...
    - LINQ Quickly with Language Integrated Queries





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
    Stay green...Green IT