2009-05-22 105 views
0

IIS 5.0下運行與服務器我有一個Windows 2008機器上的IIS 7下運行的.Net 3.5 SP1 WCF服務。當我嘗試從IIS 5.0(Windows XP).Net 3.5 SP1下運行的IIS託管的WCF服務連接到此服務時,出現以下錯誤:錯誤WCF客戶端在Windows 2008

令牌提供程序無法獲取目標的令牌:http://(URL for WCF服務)

我已經建立了可以使用完全相同的配置成功地連接到WCF服務的簡單控制檯應用程序。我還在WebDev服務器(Visual Studio 2008附帶的ASP.Net服務器)下構建了一個簡單的Web應用程序,並且它能夠成功連接到WCF服務。當我配置了一個虛擬目錄IIS(Windows XP中)內點於同一目錄中Webdev的服務器,我收到以下錯誤:

無憑證可用的安全包

但是,如果我將web.config設置爲關閉使用我的登錄憑據的模擬,它工作正常。由於顯而易見的原因,這不是一個好的長期解決方案。我已經注意到IIS和WebDev服務器之間的一個區別是每個進程正在運行的用戶。 IIS在ASPNet帳戶下運行,WebDev在我的帳戶下運行。

下面是客戶端上的WCF部分的配置:

<system.serviceModel> 
<behaviors> 
    <serviceBehaviors> 
    <behavior name="mexBehavior"> 
     <serviceMetadata httpGetEnabled="true" /> 
     <serviceDebug includeExceptionDetailInFaults="true" /> 
     <serviceThrottling maxConcurrentCalls="200" maxConcurrentSessions="200" /> 
    </behavior> 
    </serviceBehaviors> 
</behaviors> 
<bindings> 
    <wsHttpBinding> 
    <binding name="FABindings" maxReceivedMessageSize="2147483647"> 
     <readerQuotas maxStringContentLength="300000"/> 
     <security mode="Message"> 
     <message clientCredentialType="Windows" negotiateServiceCredential="false" establishSecurityContext="false" /> 
     </security> 
    </binding> 
    </wsHttpBinding> 
</bindings> 
<client> 
    <endpoint address="http://<server url>/FinancialAggregator/v3/Services/FAService.svc" 
     binding="wsHttpBinding" bindingConfiguration="FABindings" 
     contract="ServiceReference1.IFilteredService" name="FAServiceEndpoint"> 
    <identity> 
     <servicePrincipalName value="<UsernameRunningTheAppPoolOnW2k8>" /> 
    </identity> 
    </endpoint> 
</client> 

這裏的服務器配置(的要求):

<system.serviceModel> 
<bindings> 
    <wsHttpBinding> 
    <binding name="wsHttpBinding" maxReceivedMessageSize="2147483647"> 
     <security mode="Message"> 
     <message establishSecurityContext="false" negotiateServiceCredential="false" /> 
     </security> 
    </binding> 
    </wsHttpBinding> 
</bindings> 
<behaviors> 
    <serviceBehaviors> 
    <behavior name="mexBehavior"> 
     <serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" /> 
     <serviceDebug includeExceptionDetailInFaults="true" /> 
     <serviceThrottling maxConcurrentCalls="200" maxConcurrentSessions="200" /> 
    </behavior> 
    </serviceBehaviors> 
</behaviors> 
<services> 
    <service behaviorConfiguration="mexBehavior" name="FCSAmerica.Financial.Aggregator.Service.FilteredService"> 
    <endpoint name="FAServiceEndpoint" address="" binding="wsHttpBinding" bindingConfiguration="wsHttpBinding" contract="FCSAmerica.Financial.Aggregator.Service.IFilteredService"> 
    </endpoint> 
    </service> 
</services> 

上的任何想法這個錯誤的原因?

謝謝!

+0

什麼是服務器端配置? – 2009-05-22 14:28:50

回答

0

我想這個問題的最終答案是簡單地升級到一個操作系統,該操作系統允許您設置應用程序池的標識,這在很久以前就已經完成了。

感謝您的考慮。

Matt

0

當你通過IIS訪問服務,以冒充= false,那麼它是用於訪問Windows 2008機器上的服務ASPNET帳戶。

ASPNET帳戶是本地帳戶,因此不具備2008計算機上的權限。

有3種方式,你可以解決這個問題:

  • 允許annonymous訪問服務的Windows 2008機器上
  • 使用冒充= true時(你有)
  • 變化的身份從aspnet到具有所需訪問權限的域帳戶的應用程序池。
+0

謝謝你的迴應!但是,我仍然有點困惑。當你說使用impresonate = true(如你所知),這是否意味着我不應該得到這個錯誤?此外,爲了解決您的其他問題,在此環境中允許匿名訪問是不可接受的,並且我無法更改應用程序池的標識,因爲我的開發環境是運行IIS 5.1的Windows XP,它沒有應用程序池。 再次感謝! Matt – 2009-06-25 12:48:34