.NET
  Home arrow .NET arrow Page 5 - 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 
Dedicated Servers 
Moblin 
JMSL Numerical Library 
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: 4 stars4 stars4 stars4 stars4 stars / 12
    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 Web Services


    (Page 5 of 6 )

    I want to demonstrate a very simple web service (like the first COM+ application) first.  Let us consider the following code:

    <WebMethod()> _
            Public Function getSum(ByVal a As Integer, ByVal b As
    Integer)
            Return (a + b)
        End Function
        <WebMethod()> _
            Public Function getProduct(ByVal a As Integer, ByVal b As
    Integer)
            Return (a * b)
        End Function

    Really, it is very exciting to work with Web Services within the Visual Studio environment.  You cannot just leave it, once you get habituated.  It is such a productive environment that you can develop a simple web service (like the one above) in a minute or less.

    Coming to the above scenario, all the methods within a web service are to be preceded with an attribute “<WebMethod()>”.  This lets IIS know that the method could be accessed by any other remote access client through http!

    The client code to access the same is very simple.  You can take a look at the following:

    Private Sub btnSum_Click(ByVal sender As System.Object, ByVal e
    As System.EventArgs) Handles btnSum.Click
            Dim srv As New Calculate.CalcService
            lblResult.Text = srv.getSum(CInt(Me.txtFirst.Text), CInt
    (Me.txtSecond.Text))
        End Sub
     
        Private Sub btnProduct_Click(ByVal sender As System.Object,
    ByVal e As System.EventArgs) Handles btnProduct.Click
            Dim srv As New Calculate.CalcService
            lblResult.Text = srv.getProduct(CInt(Me.txtFirst.Text),
    CInt(Me.txtSecond.Text))
        End Sub

    The web service is named “Calculate.CalcService”.  Just create an object on that and access the members!

    More .NET Articles
    More By Jagadish Chaterjee


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

    .NET ARTICLES

    - 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
    - Introducing LINQ to SQL Designer using Visua...
    - Beginning LINQ to SQL Using Visual Studio 20...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway