1

我希望将 Credit Safe 与 Sage 集成。我试过这个测试代码

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

    }

但得到错误

HTTP 请求未使用客户端身份验证方案“匿名”进行授权。从服务器收到的身份验证标头是“Basic realm="creditsafe.com"

4

1 回答 1

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>

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

于 2015-04-20T21:02:56.647 回答