簡體   English   中英

WCF:我不斷收到錯誤消息“呼叫者未通過服務驗證。”

[英]WCF : I Keep getting the error “The caller was not authenticated by the service.”

使用WCF Test Client執行測試時,我一直收到此錯誤:

呼叫者未通過服務認證。

我試圖將security mode none設置為none ,但是錯誤仍然存​​在

我不能使用basicHttpBinding因為據我所知它在.Net 4.5中

我已經花了幾個小時解決這個問題,但是即使我也遇到過一些關於SOF的類似話題,也還是沒有運氣,但是它們沒有幫助!

Web.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.serviceModel>
        <bindings>
            <wsHttpBinding>
                <binding name="ota2010AEndpoint" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
                    <readerQuotas maxDepth="32"/>
                    <reliableSession ordered="true"/>
                    <security mode="None" />
                </binding>
            </wsHttpBinding>
        </bindings>

        <services>
            <service behaviorConfiguration="CalculatorServiceBehavior" name="GWork_Service.Service1">
                <endpoint address="" binding="wsHttpBinding" contract="GWork_Service.IService1" />
                <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
                <host>
                    <baseAddresses>
                    <add baseAddress="http://xxx:8000/" />
                    </baseAddresses>
                </host>
            </service>
        </services>
        <behaviors>
            <serviceBehaviors>
                <behavior name="CalculatorServiceBehavior">
                    <serviceMetadata httpGetEnabled="true" />
                    <serviceDebug includeExceptionDetailInFaults="false" />
                </behavior>
            </serviceBehaviors>
        </behaviors>
    </system.serviceModel>
</configuration>

客戶端的應用程序配置:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <binding name="WSHttpBinding_IService1">
          <security mode="None" />
        </binding>
      </wsHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://xxx:8000/" binding="wsHttpBinding"
          bindingConfiguration="WSHttpBinding_IService1" contract="GWork_MER.ServiceReference1.IService1"
          name="WSHttpBinding_IService1" />
    </client>
  </system.serviceModel>
</configuration>

抱歉,我必須在此處添加更多字母,以便我可以通過SOF關於在問題中包含過多代碼的規則。我還沒有在這里添加更多

我不能使用basicHttpBinding,因為據我所知它在.Net 4.5中

這不是真的。

要解決此問題,請檢查您的客戶端和服務器上的日期是否同步。 只需在服務器和客戶端計算機上設置相同的時間即可。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM