DirkV
DirkV

Reputation: 353

Windows Service written in .NET accessible from VB6

I have to develop a Windows Service in .NET/C#. The service must be accessible from a VB6 application.

My first idea was to host a WCF service in a Windows Service, but the VB6 application needs a wrapper for the service to be able to consume it. This is not an option.

Now I'm thinking of using sockets, but is this the best approach? If not, what would be the best design?

I would like to know what my options are, and what are the pros and cons for these options?

Any advice is much appreciated

Upvotes: 2

Views: 684

Answers (2)

Simon Mourier
Simon Mourier

Reputation: 139256

The WCF service is still an option, but you would have to ensure the WCF configured binding is interoperable (choose BasicHttpBinding for example as seen here: WCF Bindings In Depth).

On the VB6 side, you can call an existing SOAP endpoint, as described here for example: How to Consume a SOAP Web Service in VB6?

Upvotes: 0

casperOne
casperOne

Reputation: 74560

You can host your WCF services as COM+ applications.

Once you have a WCF service hosted in COM+, you can generate a type library from the COM+ application and then reference that in your VB6 code.

Note that you'll have to have the .NET runtime installed on the machine that the WCF service is hosted on (but not on the machines that you install a COM+ proxy on if using distributed calls).

Upvotes: 2

Related Questions