【问题标题】:Standalone Web Service authentication error独立 Web 服务身份验证错误
【发布时间】:2015-10-14 03:11:00
【问题描述】:

我目前有一个独立的网络服务,一切都很好,除非我尝试使用远程机器上的一种方法。

我正在使用 wcftestclient 进行测试。

我收到一条身份验证错误消息:

“调用者未通过服务的身份验证”

我可以从远程计算机访问 Web 服务,这些方法填充在 wcftestclient 中,但是当我尝试调用它时,我得到了身份验证错误。

任何帮助将不胜感激。

谢谢,

这是我的 app.config 文件:

    <?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.serviceModel>
    <services>
      <!-- This section is optional with the new configuration model
           introduced in .NET Framework 4. -->
      <service name="Microsoft.ServiceModel.Samples.CalculatorService" behaviorConfiguration="CalculatorServiceBehavior">
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8000/ServiceModelSamples/service"/>
          </baseAddresses>
        </host>
        <!-- this endpoint is exposed at the base address provided by host: http://localhost:8000/ServiceModelSamples/service  -->
        <endpoint address="" binding="wsHttpBinding" contract="Microsoft.ServiceModel.Samples.ICalculator" />
        <!-- the mex endpoint is exposed at http://localhost:8000/ServiceModelSamples/service/mex -->
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="CalculatorServiceBehavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="False"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

【问题讨论】:

  • 您是否尝试将includeExceptionDetailInFaults 设置为true?这可能有助于为您指明正确的方向

标签: c# web-services wcf web service


【解决方案1】:

把安全模式改成none试试

      <security mode="None">
            <transport clientCredentialType="None" />
        </security>

【讨论】:

  • 感谢一切正常!我创建了一个客户端并添加了 Web 服务,它为我创建了一个 app.config,它就像一个魅力!再次感谢
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-07-01
  • 1970-01-01
  • 2012-04-18
  • 1970-01-01
相关资源
最近更新 更多