I’m working on a project that uses wcf webapi to expose all it’s functionality as web services. I then consume these with various views (well two for now). One of these views is a legacy asp.net 2.0 project that will eventually be phased out once this new project has feature parity. I’m trying to consume these services by adding a service reference to the project but can’t get it to work because the wcf api uses basic http auth and I can’t configure that in the wizard. How do I manually add the service reference to my asp.net project?
Thanks!
When working with WCF Web API, you don’t use service references but the new HttpClient instead e.g.:
If you need to use .NET 2.0, you can use the HttpWebRequest (the HttpClient sample relies on .NET 4.0 as it is part of WCF Web API):