.NET
  Home arrow .NET arrow Page 3 - 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 a basic COM application


    (Page 3 of 6 )

    I already introduced COM+ issues in my earlier article.  So, at the moment, I don’t want to go into its details.  Let us directly attack the code.

    Imports System.EnterpriseServices
    Imports System.Reflection
    'c:...bin/> sn -k COMPlusEx1Srv.snk
    'regsvcs [/reconfig] /fc COMPlusEx1Srv.snk
     
    <Assembly: ApplicationName("COMPlusEx1Srv")>
    <Assembly: AssemblyKeyFile("../../bin/COMPlusEx1Srv.snk")>
    <Assembly: ApplicationAccessControl()>
     
    Public Class Test
        Inherits ServicedComponent
     
        Public Function getSum(ByVal a As Integer, ByVal b As
    Integer) As Integer
            Return (a + b)
        End Function
     
        Public Function getProduct(ByVal a As Integer, ByVal b As
    Integer) As Integer
            Return (a * b)
        End Function
    End Class

    Any COM+ application should be extended from the base class “ServicedComponent.”  And we also need to import “System.EnterpriseServices” and “System.Reflection.”  The most important issue to remember is that the COM+ application needs to be strongly signed.  In the above program, two lines of comments exist to assist you in creating the “strong name key pair” and registering our application with COM+ services.

    The two methods I defined in the above program are only for demonstration and not practical.

    It is quite simple to create an object based on a COM+ definition. The following code shows you how you can access the above COM+ application.

    Private Sub btnCal_Click(ByVal sender As System.Object, ByVal e
    As System.EventArgs) Handles btnCal.Click
            Dim obj As New COMPlusEx1Srv.Test
            MessageBox.Show(obj.getSum(CInt(Me.txtFirst.Text), CInt
    (Me.txtSecond.Text)))
            MessageBox.Show(obj.getProduct(CInt(Me.txtFirst.Text),
    CInt(Me.txtSecond.Text)))
        End Sub

    It is as simple as creating your own object and accessing its members.

    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 5 hosted by Hostway
    Stay green...Green IT