views:

185

answers:

2

Our company currently has a web site which is deployed in Windows 2000 OS, which means that we could only install .NET 2.0 on that machine. Upgrading the Webserver OS is out of the question, since this web server also hosts other web applications in our country. As also part of our IT's policy, for security reasons the web sites are not allowed to directly access data to our database. That 's why to comply with this restrictions, We have another Server where the Web services is deployed. This "app server" currently has .Net 3.5 SP1 installed, hence WCF Services is possible.

My question is if it is possible to add a web reference on WCF Web services through our ASP.NET Web site that hosts only .NET 2.0.

+3  A: 

Of course you can. If the WCF service uses the basicHttpBinding binding, then it will be compatible with all SOAP 1.1 clients, including "Add Web Reference".

John Saunders
+2  A: 

I did this a fair bit of time ago, it is possible, but here's some stumbling blocks that i had to overcome

  1. Use [XmlSerializer] instead of DataContractSerializer, .net 2.0 does not include System.Runtime.Serialization 3.0, which is neccessary to use [DataContract] attibute, which is a .net 3.0 namespace, and for some reason .net 2.0 cant read XML encoded using DataContractSerializer
  2. when you declare your service contracts, ie. [ServiceContract] also declare the attribute [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1, EmitConformanceClaims = true)]
  3. You can encrypt the data using Transport security, requires a working certificate
  4. Generate Service reference using svcutil, use this switch when doing so /targetClientVersion:Version30
Neil
Thanks. I'm a complete noob using WCF, but I'll keep that in mind :).
cless