tags:

views:

82

answers:

3

At the client end, I have generated a Proxy using SvcUtil.exe and it is working fine.

Then I have added a WebReference to the client assembly and calling the same method. But it is not working.

My program is running in console mode and the method is suppose to return a string. It is not returning the string. I just see a blank console window. No exception is thrown. And after setting a debug point on the method call I see that, program is halted on the method call for ever.

What should I look for to solve the problem?

I am using VS2005. And adding the webReference by right-clicking the client project and then clicking "Add Web Reference" pop-up menu.

A: 

Add Web Reference does not add a WCF proxy, but rather a proxy that uses the old, pre-WCF API.

Depending on the binding on the service, those old proxies may not work. Basically they only work if the service is using BasicHttpBinding.

Can't you use the proxy generated by SvcUtil instead?

Mark Seemann
I am testing whether it works or not.
JMSA
+1  A: 

"Add Web Reference" and "Add Service Reference" are not the same things. The later uses SvcUtil.exe (or something simillar, there is a discution about that here).

In short, one is use WCF framework the other one is using ASP.NET WebService stuff (wsdl.exe). It seems very strange that the service works fine with SvcUtil and not with wsdl.exe. The other way arround can happen with WSDL that are not compatible with DataContractSerializer, but I never had the cas where wsdl.exe didn't work...

You may want to test the service with theWcfTestClient, and maybe install the .NET 3.0 tools for Visual Studio 2005, see here.

Philippe
A: 

VS 2005 was originally made for framework 2.0.

For it to work with WCF you need: "The Visual Studio 2005 extensions for.NET Framework 3.0"

Shiraz Bhaiji