tags:

views:

445

answers:

4

I have a WCF service that I have to reference from a .net 2.0 project.

I have tried to reference it using the "add web reference" method but it messes up the params. For example, I have a method in the service that expects a char[] to be passed in, but when I add the web reference, the method expects an int[].

So then I tried to setup svcutil and it worked... kind of. I could only get the service class to compile by adding a bunch of .net 3.0 references to my 2.0 project. This didn't sit well with the architect so I've had to can it (and probably for the best too).

So I was wondering if anyone has any pointers or resources on how I can setup a .net 2.0 project to reference a WCF service.

+2  A: 

One of those instances that you need to edit the WSDL. For a start a useful tool

http://codeplex.com/storm

A: 

Thanks for the resource. It certainly helped me test out the webservice, but it didn't much help with using the WCF service in my .net 2.0 application.

What I eventually ended up doing was going back to the architects and explaining that the 3.0 dll's that I needed to reference got compiled back to run on the 2.0 CLR. We don't necessarily like the solution, but we're going to go with it for now as there doesn't seem to be too many viable alternatives

lomaxx
+1  A: 

What binding are you using - I think if you stick to the basicHttp binding you should be able to generate a proxy using the "add web reference" approach from a .net 2 project?

Perhaps if you post the contract/interface definition it might help?

Cheers Richard

A: 

Hi richard,

I was using the basicHttp binding but the problem was actually with the XMLSerializer. It doesn't properly recognize the wsdl generated by WCF (even with basicHttp bindings) for anything other than basic value types.

We got around this by added the reference to the 3.0 dll's and using the datacontract serializer.

lomaxx