Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm having trouble consuming a WCF service from an .net 2.0 application. I can call the service but only string values are passed, all integer and doubles are zero etc. When i call the service from an .Net 4.0 application, everything works. Does any one have any ideas why only string values are passed?
Posted

My idea is to use .NET Framework 3.5 or later. The Framework is free re-distributable. There is no WCF in v. 2.0.

What's the reason for not using more modern version of the Framework and still using WCF service? You only have Windows Studio 2005? You can use oper-source MonoDevelop (see http://en.wikipedia.org/wiki/MonoDevelop[^], http://monodevelop.com/[^]), free of charge Visual Studio Express (http://en.wikipedia.org/wiki/Visual_Studio_Express[^], http://www.microsoft.com/visualstudio/en-us/products/2010-editions/express[^]) or develop without any IDE.

Last option is not so easy, but it's possible, I tried. Major compilers, MSBuild.EXE and all other required tools are bundled with free-of-charge redistributable .NET Framework, not Visual Studio. By the way, you can build any solution without Studio using the command line "MSBuild.EXE solution-file.sln [options]".

I have an alternative idea which might not be so easy to implement, but you can try. You can try to introduce a different implementation of WCF into your solution using .NET 2.0. You can download source code of this library from the source code of Mono and accurately add it to your solution. The problem is to find out and detect all source-code dependencies. See:
http://en.wikipedia.org/wiki/Mono_%28software%29[^], http://www.mono-project.com/Main_Page[^].

(It sounds scary, but I did something like that for debugging purposes. I wanted to debug some software having a problem when running only under Mono but using Visual Studio. I download part of library code from Mono sources and obtained mixed code — part of code was running .NET libraries working together with code extracted from Mono, so it replaced .NET code. I managed to run it together and actually solved my problem!)

—SA
 
Share this answer
 
I changed the serialization from DataContract to XmlSerializerFormat and it works. Strange that it could serialize the string values.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900