2010-02-02 85 views
0

我有一個WCF服務託管在Windows服務中,在我有苔蘚的同一臺服務器上。是否可以調用SharePoint中的Windows Service中託管的WCF服務?

WCF很適合從控制檯應用程序調用它,但是如果我從Sharepoint中的頁面調用它,它會引發超時異常。

我增加了如下配置到webconfig:

<system.serviceModel> 
    <bindings> 
     <wsHttpBinding> 
     <binding name="WSHttpBinding_IReplication" closeTimeout="00:10:00" 
      openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" 
      bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" 
      maxBufferPoolSize="524288" maxReceivedMessageSize="65536" 
      messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" 
      allowCookies="false"> 
      <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
       maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
      <reliableSession ordered="true" inactivityTimeout="00:10:00" 
       enabled="false" /> 
      <security mode="Message"> 
      <transport clientCredentialType="Windows" proxyCredentialType="None" 
       realm="" /> 
      <message clientCredentialType="Windows" negotiateServiceCredential="true" 
       algorithmSuite="Default" establishSecurityContext="true" /> 
      </security> 
     </binding> 
     </wsHttpBinding> 
    </bindings> 
    <client> 
     <endpoint address="http://localhost:8000/Replication/service" 
      binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IReplication" 
      contract="ServiceReference1.IReplication" name="WSHttpBinding_IReplication"> 
     <identity> 
      <servicePrincipalName value="host/mypc-f1d530f" /> 
     </identity> 
     </endpoint> 
    </client> 
    </system.serviceModel> 

正在發生的事情你知道嗎? 你有沒有人成功地做到了這一點?我在網上找不到任何樣本。

回答

0

你應該嘗試禁用環回檢查,通過創建HKLM\System\CurrentControlSet\Control\Lsa下名爲DisableLoopbackCheck一個DWORD,並給它的1值。不要忘記稍後重新啓動計算機。

相關問題