简体   繁体   中英

Web Service vs. WCF - different objects when consumed

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 - "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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM