Trying to add service reference to a WCF on IIS
Win 8.1 / VS for Web 2012
I've recently published a VERY simple WCF (just 1 method) to localhost (IIS - Default Web Site). When I publish I'm returned the following:
=== Publish: 1 succeeded, 0 failed, 0 skipped ===
So one would think I could easily add a reference from my ASP.NET project, by right-clicking and adding a service reference. NOPE! When I get the dialog box, it can't find anything in localhost.
So I poked around in Service via Control Panel, thinking I might have to start the service. Not even listed in there.
It's been quite a while since I've worked with WCF's and ASP, can someone help me out and tell me what I'm doing wrong?
- First you need to identify, exactly, on which port you have published your service. Just go to IIS Manager Console and look around. Open Props window and see needed stuff (url, port)
- Verify your service works OK, just post the url to any browser you have.If all is OK you'll get some peace of information of service about how to create a proxy,etc.
- Verify service operations work OK. This can be done by 2 ways at least : using Fiddler Composer, or more sweet thing for these cases like WCF test Client
- Open your VS. Navigate to solution Service Reference folder. Add Service Reference. Pass link you got from step #1. (If I'm not mistaken 'discover' button does not take any affect, as it looks through possible endpoints inside project, NOT AT IIS)
That's all. hope that helps.