0

Win 8.1 / VS for Web 2012

Hello,

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?

Thanks, Jason

Kul-Tigin
  • 16,728
  • 1
  • 35
  • 64

1 Answers1

0
  1. 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)
  2. 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.
  3. 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
  4. 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.

Eugene P.
  • 2,645
  • 19
  • 23
  • Performed a rebuild, then published again, was able to see the information from Chrome on http://localhost:50959. But new error when trying to add the service reference to my asp.net project, "404 - Not Found" & "405 Method Not Allowed". Hrmph!! –  Jan 31 '14 at 20:53
  • hmmmm do you have opened fiddler or etc? it's usually error causes by proxies like fidder – Eugene P. Jan 31 '14 at 20:56
  • Don't have fiddler open –  Jan 31 '14 at 20:59
  • feel save like live support :) , okay. 1. can you post your service code? 2. can you just right click on service and open in browser. without any publish for now – Eugene P. Jan 31 '14 at 21:04
  • 1) The service is a separate WCF solution, which part would you like to see (ie: Service1.svc.vb or IService1.vb?) 2) Yes I can. Just updated my earlier comment. What's strange now, it let me add it as a "Web Reference" but not as a "Service Reference". Wondering what the difference is? –  Jan 31 '14 at 21:12
  • not familiar with VB unfortunatelly, but I believe there is no big deal with annotation stuff. IService.vb nice to see. – Eugene P. Jan 31 '14 at 21:17
  • Thanks, in the end I had to add it as a "Web Reference" instead of a "Service Reference". It'll do for now, although I still don't know the difference between the two. –  Jan 31 '14 at 21:30
  • http://stackoverflow.com/questions/2158106/web-reference-vs-service-reference take a look. – Eugene P. Jan 31 '14 at 21:31