tags:

views:

69

answers:

1

Hello all, I'm looking to a way to connect a COM+ legacy application to a WCF Service, i have been researching this since a couple of days and i haven been lucky to find any useful information, can anyone point me into the right direction on this?

I Need the old COM+ component to make calls to a new C# WCF Service so I Need some kind of proxy in the COM Component that abstracts the communication with the Service.

Thanks in advance, i really appreciate any help.

+1  A: 

I assume you mean that you have a WCF service, and that the code that runs your WCF service needs to make calls to your legacy application and send that data in/out of the WCF service, correct? If that's the case, then the WCF facet of your question is actually irrelevant.

What you're trying to solve is how to get your .NET application to speak COM to your legacy application.

Check out: Introduction to COM Interop and COM Interop Tutorials.

You'll need to generate type libraries for your COM component, reference them and System.Runtime.InteropServices in your C# project, and then you can make your calls across into COM boundaries of your legacy application code. There are a lot of other examples and tutorials out there if you search for COM Interop Tutorial, for example.


EDIT:

I thought more about your problem. You need to implement a proxy by creating a server that "looks" just like your old server (all the same COM+ interfaces etc etc), and then forwards the request (by crafting a new request) to your WCF service. You can do this in C#. I whiteboarded (archive) the basic idea around it from your original whiteboard.

Mike Atlas
Hello, actually is the other way around, i want the legacy applications to call the WCF Service, so i need to have a communication proxy on the COM to perform the calls to the WCF Service.
Bongo Sharp
Sorry about the confusion.
Mike Atlas
No problem, have you ever faced this same problem?
Bongo Sharp
Well, I suppose you can build your proxy using my answer as a starting point, right? You need some .NET code that can talk to your legacy app over COM, and then translate that data to calls on the WCF service?
Mike Atlas
Mike Atlas
this comes from a trouble were we have an adapter for a desktop application, so you have clients that are communicating to this adapter which then talks to a mainframe, the constraint in this problem is that we cannot change the client desktop code, so the only thing we can change is the actual adapter to communicate to the WCF service, ill take a look at the documentation you provided, thank you!
Bongo Sharp
Bongo Sharp
Mike Atlas
Thanks for you response Mike i really appreciate it, i think i got the idea, I'm going to implement it and let you guys know how it went :), again thanks
Bongo Sharp
You're welcome. An upvote is a great way to say thank you. If it gets you along far enough to solve your problem, then you can accept the answer (green check mark).
Mike Atlas
sure thing! I'll keep working on getting this worked thru
Bongo Sharp