I'm trying to get a WCF service set up on our server using windows authentication and IIS 7. When calling the service I get the following error message.
Cannot open database "TestDB" requested by the login. The login failed. Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
Here is my config file for the WCF service.
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<customErrors mode="Off"/>
<authentication mode="Windows"/>
</system.web>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="binBulletin">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="BulletinBoardService.BulletinBehavior"
name="BulletinBoardService.BulletinService">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="binBulletin"
name="epBulletin_Basic" contract="BulletinBoardService.IBulletinService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="basicHttpBinding" bindingConfiguration="binBulletin"
name="epBulletin_Mex" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="BulletinBoardService.BulletinBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceAuthorization impersonateCallerForAllOperations="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<security>
<authentication>
<windowsAuthentication enabled="true"/>
</authentication>
</security>
</system.webServer>
</configuration>
Any tips would be appreciated.