C# Client calling remote COM+ Component
Messages   Related Types
This message was discovered on ASPFriends.com 'ngfx-remoting' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Cenon Del Rosario
How do I use an existing MTS component or an imported .NET equivalent on an
MTS Server with .NET installed on it and create it from a C# client running
on a different machine ?

This would be easy in VB6 using CreateObject and specifying which server to
create the object in. I cannot find any document or sample on how to get the
C# client to create the MTS component on a different machine. I have also
looked at other books with no success as well.

Thanks in advance.

Reply to this message...
 
    
Dan Green (VIP)
In the past, I wrote up a v. simple .net remoting primer --
http://dotnetdan.com/articles/misc/mbrI.htm

It attempts to show that .NET remoting is actually *easier* to more
precisely configure than say DCOM and it's just as transparent when
using a configuration file.

It doesn't cover MTS, client activated objects or hosting in IIS but it
may help you find the right classes to do a search on within the MSDN
help.

Hope it helps.

Dan Green
[ http://dotnetdan.com -- putting the dan in .net ]

[Original message clipped]

Reply to this message...
 
    
Cenon Del Rosario
Thank you.

Unfortunately, this code / example still does not answer the problem. I
would hate to think that MS will not support this requirement, a lot of
shops use MTS (or COM+ Services) and not having these legacy components
available remotely to .NET clients will be a big mistake !

I have searched a lot and could not find anything regarding this matter. If
anyone can help please contact me as we are evaluating .Net with a view of
using existing components in relation to Web Services. This is why we need
to acccess these legacy components residing on MTS servers from a Web
Service most likely written in C#. If this does not work, it looks like
Delphi 6 will win !

----- Original Message -----
From: "Dan Green" <Click here to reveal e-mail address>
To: "ngfx-remoting" <Click here to reveal e-mail address>
Sent: Saturday, November 10, 2001 1:50 PM
Subject: [ngfx-remoting] RE: C# Client calling remote COM+ Component

[Original message clipped]

Reply to this message...
 
    
Dan Green (VIP)
> I would hate to think that MS will not support this requirement

I guess I don't actually understand your requirement (it may be a
language issue). What are you actually trying to do, again? Please
spell it out for me.

.NET provides access to:
- COM+ Services (just inherit from ServicedComponent)
- COM objects (use tlbimp.exe)
- .NET remoting (see my article)
- Web Services (different to .NET remoting)

All these bits of functionality are *different* and I'm not sure which
of them is the one you're having trouble with.

[Original message clipped]

Try the following:
- Use tlbexp.exe to obtain a Runtime Callable Wrapper (RCW) for your COM
object.
- Use code or a config file (as explained in my .net remoting writeup)
to access the generated RCW remotely.

If you haven't tried the above, then you haven't even started. :-)
If you did try and failed, let us know what problems you had (please
include as much detail as possible) and we may be able to help.

Have you prototyped accessing COM objects from .NET on the same machine?
If not, do that before trying to get it to work remotely. But again,
perhaps I'm completely misunderstanding the problems you're having.
Sorry.

> Service most likely written in C#. If this does not work, it looks
like
> Delphi 6 will win !

BTw, were you aware that Borland are looking to enter the .NET space
with an IDE and Delphi.NET?

Dan Green
[ http://dotnetdan.com -- putting the dan in .net ]

[Original message clipped]

Reply to this message...
 
    
Cenon Del Rosario
I am trying to create a Web Service on one machine that needs to use
business objects residing on an MTS Server on another mahine. Also, we plan
to use C# for any new in-house front-end applications. These applications
will also used the business objects; at the moment we don't have to do any
Type Library registrations to around 500+ remote client machines because we
use IDispatch calls and we create the business objects remotely.

I know Net can do this with new components residing in a Web Server /
Service or Console App but can it do it in COM+ Services and if so, how ?

----- Original Message -----
From: "Dan Green" <Click here to reveal e-mail address>
To: "ngfx-remoting" <Click here to reveal e-mail address>
Sent: Sunday, November 11, 2001 11:47 AM
Subject: [ngfx-remoting] RE: C# Client calling remote COM+ Component

[Original message clipped]

Reply to this message...
 
    
Dan Green (VIP)
[Original message clipped]

OK. As I've stated, this is absolutely possible using RCWs and the
System.Runtime.Remoting framework classes.

[Original message clipped]

Just so I have this straight, I assume this means you're currently doing
VB6 CreateObject object call, specifying the remote machine to create
the instance on. You're doing late binding, yes?

In the .NET world, we can create the RCWs of the COM objects and
distribute them with the rest of the application (that has to be
deployed to the client machines, anyway). As a side-benefit, you get
the benefits of early-binding without any of the registration hassles
(RCWs *don't* have to be registered).

Can you confirm that you've successfully achieved the following two
things:
- Used tlbexp.exe to do local COM interop
- Used Activator.CreateInstance to do .NET remoting without COM interop

[Original message clipped]


Yes. Combine the bits from the two steps above (tlbexp.exe +
Activator.CreateInstance) and you should be sweet regardless of whether
the remote COM object is hosted inside COM+ or not.

I'm sorry but I don't have the time to put together an example and I'm
getting into a loop of saying the same things over and over. Hopefully
someone else will provide you a better answer than I.

Dan Green
[ http://dotnetdan.com -- putting the dan in .net ]

[Original message clipped]

Reply to this message...
 
    
Cenon Del Rosario
[Original message clipped]


Reply to this message...
 
    
Dan Green (VIP)
> But how do you tell .NET which machine to create the objects at
runtime ?

The answer is in the article I originally referenced --
http://dotnetdan.com/articles/misc/mbrI.htm

It uses Activator.GetObject rather than Activator.CreateInstance, but
that may well be the appropriate call for your needs, anyway.

I'd recommend you read also the MSDN help on remoting (watch wrapping)
--
ms-help://MS.VSCC/MS.MSDNVS/cpguide/html/cpconaccessingobjectsinotherapp
licationdomainsusingnetremoting.htm

Dan Green
[ http://dotnetdan.com -- putting the dan in .net ]

[Original message clipped]

Reply to this message...
 
 
System.Activator
System.EnterpriseServices.ServicedComponent




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com