.NET Framework Bookmark and Share   
 index > Windows Communication Foundation > Why when consuming my WCF service am I being promted for credentials from the deployemtn server??
 

Why when consuming my WCF service am I being promted for credentials from the deployemtn server??

I have a WCF service that is hosted in IIS on one of our servers inside our AD domain. Why when I want to add the WCF service reference to my .NET app am I being presented with the following message and login boxes?

"The server needs to authenticate your request. Your credentials will be sent to the server in clear text. Do you want to continue?"

If I press continue, I get the login box that states:

"The Service 'http://MyServerName.mycompany.com/MyWCFService.svc' at MyCompany requires a username and password."

Now in the IIS security I have all security turned off, and only "Enable Anonymous acess" checked. I do not have any additional security in the web.config that should present this either. This WCF service should be consumable without credentials as I have intended. I also have "Everyone" marked with permission to the directory.

Here is the WCF section from my web.config:

<system.serviceModel>
<services>
<servicename="MyWCFService.MyServiceClass"
behaviorConfiguration="ServiceBehavior">
<!--ServiceEndpoints-->
<!--NOTE:CurrentlySilverlight2onlysupports"basicHttpBinding"andmustbesetbeforeconsumingbySLapp-->
<endpointaddress=""
binding="basicHttpBinding"
contract="MyWCFService.IMyServiceClass">
<!--
Upondeployment,thefollowingidentityelementshouldberemovedorreplacedtoreflectthe
identityunderwhichthedeployedserviceruns.Ifremoved,WCFwillinferanappropriateidentity
automatically.
<identity>
<dnsvalue="localhost"/>
</identity>
-->
</endpoint>
<endpointaddress="mex"
binding="mexHttpBinding"
contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behaviorname="ServiceBehavior">
<!--Toavoiddisclosingmetadatainformation,setthevaluebelowtofalseandremovethemetadataendpointabovebeforedeployment-->
<serviceMetadatahttpGetEnabled="true"/>
<!--Toreceiveexceptiondetailsinfaultsfordebuggingpurposes,setthevaluebelowtotrue.Settofalsebeforedeploymenttoavoiddisclosingexceptioninformation-->
<serviceDebugincludeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<bindingname="BasicHttpBinding"
openTimeout="00:01:00"
receiveTimeout="00:05:00"
sendTimeout="00:01:00"
maxBufferSize="65536"
maxBufferPoolSize="524288"
maxReceivedMessageSize="65536"
messageEncoding="Mtom"
transferMode="Streamed">
<securitymode="None">
<transportclientCredentialType="None"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>

Does anybody know why this would occur and what I can do to fix it?

Thanks!

atconway
I think I figured this out. It seemed that the "ServiceReferences.ClientConfig" file that was being created in the client project consuming the service, was using the server's DNS name rather than the IP of the service. This was causing the credentials prompt.

So endpoint address="http://MyServerName/MyWCFService.svc"

was changes to... endpoint address="http://100.100.1.100/MyWCFService.svc"


Now once I mapped my IP to a DNS, I was able to change the endpoint in the client configuration as follows:

endpoint address="http://MyDNSServiceName/MyWCFService.svc"

  • Marked As Answer byatconway Monday, March 02, 2009 3:36 PM
  •  
atconway
I think I figured this out. It seemed that the "ServiceReferences.ClientConfig" file that was being created in the client project consuming the service, was using the server's DNS name rather than the IP of the service. This was causing the credentials prompt.

So endpoint address="http://MyServerName/MyWCFService.svc"

was changes to... endpoint address="http://100.100.1.100/MyWCFService.svc"


Now once I mapped my IP to a DNS, I was able to change the endpoint in the client configuration as follows:

endpoint address="http://MyDNSServiceName/MyWCFService.svc"

  • Marked As Answer byatconway Monday, March 02, 2009 3:36 PM
  •  
atconway

You can use google to search for other answers

Custom Search

More Threads

• Possible to change Windows Service parameters through ASP.NET App?
• which binding config settings apply to a wcf client?
• Communicate WCF to Windows Services
• WCF release webservice can not add web reference on other computers
• Unsecured or incorrectly secured fault
• Problem with callback
• Thread Safety / Concurrency Explanation
• Migration of WSE (with Soap filters) to WCF
• How to do Mixed Mode Security just like SQL Server in a self hosted tcp service?
• Client install requirements for Web applications that utilise WCF callbacks