Thursday, July 28, 2005

Going for a walkabout with - VB6, COM, COM+, Transactions and Indigo (Part 4 o f X)

When it comes to the Indigo enabling of a COM+ Interface, you have 4 options. 3 of which are very automated and by automated I mean they setup the service contract for you, with an initial default configuration (i.e. the bindings etc..) which can be altered, but it also important to point out there is a 4th option requiring some manual handcrafting of code etc.., which I will cover later, as it is an advanced option.

I breakdown the 3 main/automated options that are based on the usage of the ComSvcConfig.exe tool in the following way:

/hosting:complus – This leverages the COM+ hosting process and therefore requires explicit application activation. i.e. the COM+ application must be a Server application, with the “Run as a NT service” enabled or perhaps manually started, with “Leave running when idle” enabled

/hosting:was – While in reality this is one option, I currently like to think of it as two distinct modes/options, as there are considerations with how the activation of the COM+ is configured.
The basics of this option is that the “Indigo” service for the Interface is now hosted by IIS rather than COM+. So for this option to be used, you obviously have to have a Web directory setup etc…
The reason that I like to think of this option as two distinct modes/options, is that there are differences to how this option works and it is dependant on the Activation setting for the COM+ application. When the COM+ app is configured to be a library, then IIS becomes the full/complete host (In-Proc hosted), but when the COM+ application is configured to be a server application, the COM+ application is Out-Proc, hosted by DLLHOST.EXE and therefore will incur the performance cost of cross process hops (i.e. marhsalling, context switching etc..) when messages arrive or are sent to/by the service contract that is exposed as a representation of a COM interface.
It is important to note that for either of these option for WAS hosted services, WAS will handle the activiation in both cases.

When it comes to the mapping of Indigo services to COM object, as pointed out in the current Indigo Beta 1 RC1 documentation that is online and available at this link,

When an interface on a COM+ component is exposed as a Web service, the specification and contract of these services are determined by an automatic mapping to be performed at application initialization time. The conceptual model for this mapping is as follows:

  • There is one service for each exposed COM class.
  • The contract for the service is derived directly from the selected component's interface definition.
  • The operations in that contract are derived directly from the methods on the component's interface definition.
  • The parameters for those operations are derived directly from the COM interop type corresponding to the component's method parameters
     

As one would expect when moving from a Distributed Object world, with distributed object references etc..; to a world of message orientation, with explicit declaration of schema and contract, there are going to be aspects of code that can not be handled in a automated fashion and/or cannot be handled at all, as it would require the sharing of class/implementation.

Example of these would include the following:

Some restrictions on the what can exposed as a Indigo Beta 1 RC1 service are as follows (from documentation at this link):

  • Interfaces that accept object references as parameters
  • Interfaces that accept types that are not compatible with the .NET Framework COM Interop conversions
  • Interfaces for applications that have application pooling enabled when hosted by COM+
  • Interfaces of components that are marked as "private" to the application
  • COM+ infrastructure interfaces
  • Interfaces from the system application
  • Interfaces from managed components that have not been added to the Global Assembly Cache
     

Moving on to some examples of exposing COM+ interface from the Market sample, as Indigo services ……………………….

 – Paul


 |  |  |  |  |  |  | 
Thursday, July 28, 2005 4:03:39 PM UTC | # | Disclaimer | Comments [0] | Tracked by:
"re:Going for a walkabout with - VB6, COM, COM , Transactions and Indigo (Part 5... [Trackback]
"Followup to Irish Developer Network Event - Indigo for the COM, COM+ and MSMQ D... [Trackback]
"76d.topeew" (76d.topeew) [Trackback]
Comments are closed.