开发者

Web Service vs. WCF - different objects when consumed

开发者 https://www.devze.com 2022-12-12 00:49 出处:网络
I\'m new to the WCF, and I\'m looking for some advice.In my web app I consumed a web service (R+Click on project开发者_Python百科 - \"Add Web Reference\") and started coding.My web app is really big,

I'm new to the WCF, and I'm looking for some advice. In my web app I consumed a web service (R+Click on project开发者_Python百科 - "Add Web Reference") and started coding. My web app is really big, so it was taking forever to compile each time I wanted to debug, so I built a stripped down WinForm using the same code.

In VS2008 there is no "Add Web Reference" option when using the 3.5 framework, so I just chose "Add Service Reference" and used the same url. The objects/methods that I now have access to are completely different when compared to the objects/methods in the web app after consuming this as a web service.

Is that normal? Is this somehow related to the WCF?

Thanks


You can still add web references.

Do

Add Service Refernce

Hit the "Advanaced" button on the bottom left

Hit "Add Web Reference" on the bottom left.


Yes this is related to WCF. When your project target is >= .NET 3.0 the Add Service Referemce option will be available which will use svcutil.exe to generate client classes, otherwise you will have the Add Web Reference option which uses wsdl.exe. WCF clients use different classes to call a web service and that's why you get different classes generated.

0

精彩评论

暂无评论...
验证码 换一张
取 消