I create a service that is host on a server that have .Net 3.5 installed and I need to call this service from a client that only have .Net 2.0 installed
Is there a way I can do this ?
I'm using c#
I create a service that is host on a server that have .Net 3.5 installed and I need to call this service from a client that only have .Net 2.0 installed
Is there a way I can do this ?
I'm using c#
Yes of course - the service being hosted on .NET 3.5 doesn't require the same version of the .NET framework on the client. Heck - you can even call such a service from Java or PHP! That's the whole POINT of Service Oriented Architecture! :-)
You need to define your service contract (what's the service called; what methods are available to be called on it) and you need to decide how to host it, e.g. at what address can you call this service, and what parameters are required (e.g. HTTP vs. TCP, secured or not secured etc.) - that's a lot of work, even in WCF.
Here are three introductory articles for WCF - check them out!
But calling that service from a .NET 2.0 client is ABSOLUTELY no problem!
Marc
If your WCF service exposes an endpoint using basicHttpBinding, then it should be possible for the .NET 2.0 client to consume it. As Marc said, "no problem".
Yes you can do it. There are some caveats, however:
You have to use protocols that match. The standard .NET 2.0 libraries don't support many secure web service features; in fact, you're pretty much stuck with using only basicHttpBinding on the WCF service if you want to be consumed by a default install of .NET 2.0. That is a severe limitation in many enterprise scenarios. However, it may be all you need.
If you need more security but are still using .NET 2.0, there are alternatives. Again, your WCF service must accommodate your .NET 2.0 client, but your .NET 2.0 client will also need to take advantage of an external library. Specifically, you'll need the Web Service Enhancements put out by Microsoft. Keep in mind, however, that these libraries implement a beta version of some SOAP protocols, while WCF (the successor to WSE in many ways) implements the standards by default. Since there were some breaking changes in the protocols (particularly WS-Addressing), you'll have to offer a customBinding endpoint on your WCF service to accommodate.
Unfortunately, I can't tell you which you'll use, as it'll depend on which protocol you want to accommodate on the service, but most of your problems will be solved by changing the messageVersion of the textMessageEncoding for the custom binding. This is not the best scenario, but it could buy you something if you're trying to integrate a client.
Bottom line, there's a lot of work to get a .NET 2.0 client to talk to a WCF service for anything other than basicHttpBinding. In many cases, basicHttpBinding may be enough. For many enterprise scenarios, it will not. I can't speak as to which will help you or not, but it is possible to get it to work -- I've done it successfully.
But it's a big pain. Look for an alternative if you can.
In theory Marc is correct. Web services are supposed to be independent of the client however Microsoft web services are not TRUE web services. They are proprietary web services which are only compatible with .Net and with the specific version the service is written in. Not all clients can consume a Microsoft web service. They are only dll's in a different wrapper.