tags:

views:

135

answers:

0

Exact duplicate of: http://stackoverflow.com/questions/1799143/problem-accessing-wcf-service-when-hosted-in-iis

Reply Edit Favorites Contact Report abuse Quick Reply Problem accessing WCF service 11-25-2009 5:23 PM |

I have a problem accessing WCF service that I added for my silverlight project. Here is what I did 1. Created the silverlight project and enabled the project's default web setting to use "Use local IIS web server".

  1. Then I added a WCF enabled web service (Service1.svc) in the web project.This created the service with the default custom binding which looks like

  2. Then I added the reference in my silverlight project to the service (Service1.svc) I created in the web project.

  3. Set the authentication mode to "Anonymous" at the virtual directory level in IIS ( I have IIS 5.1 on WinXP Prof).

  4. Added a button in the silverlight to call the function of the WCF service (Service1.svc).

  5. Now whenever I click the button for the first time, IE pops up the message box asking Username & Password which it usually does during basic authentication! Any subsequent click works fine without popping up the credential box. Next I created another web service and added one more button to call this new webservice. Clicking either of the button for the first time pops-up the credential box but thenafter it goes smooth.

My question is why it pops up the credential box whenever trying to call the web service for the first time with this default "Custom Binding"? As far as I know the security value is set to none in default custom mode.

Next I tried doing the same with basicHttpBinding. In this case the credential IE box pops up again but the call fails all the time giving security error! Can someone please explain why this basicHttpBinding is failing all the time? I am using VS2008 SP1, WinXP Prof, IIS 5.1