2015-03-19 143 views
1

我期待將Credit Safe與Sage集成在一起。我想這個測試代碼將CreditSafe與Sage CRM集成

static void Main(string[] args) 
    { 
      CreditSafe.GlobalDataServiceClient creditSafe = new CreditSafe.GlobalDataServiceClient(); 
      CreditSafe.CountriesListingFilter f = new CreditSafe.CountriesListingFilter(); 
      CreditSafe.CountriesList countries = creditSafe.GetCountries(f); 

    } 

,但得到的錯誤

HTTP請求是unathorised與客戶端身份驗證方案「匿名」。從服務器收到的身份驗證標題爲'Basic realm =「creditsafe.com」

+0

錯誤在於:HTTP請求未通過客戶端身份驗證方案「匿名」。從服務器收到的身份驗證頭是'Basic realm =「creditsafe.com」' – DevSrb 2015-03-19 09:46:44

回答

1

我有同樣的問題。這是在配置文件中的一個設置,以防你沒有想到這一點。必須像這樣設置配置文件:

<binding name="BasicHttpBinding_GlobalDataService" closeTimeout="00:10:00" openTimeout="00:10:00" 
     receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false" 
     bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" 
     maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" 
     textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true" 
     messageEncoding="Text"> 
     <readerQuotas maxDepth="64" maxStringContentLength="2147483647" 
     maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> 
     <security mode="Transport"> 
     <transport clientCredentialType="Basic" proxyCredentialType="None" realm="" /> 
     <message clientCredentialType="UserName" /> 
     </security> 
    </binding> 

主要部分是安全模式部分。希望有所幫助!