【发布时间】:2013-01-16 17:40:11
【问题描述】:
基本上我都按照这个教程here
让一切都在我的本地机器上启动并运行并正常工作。我已将其部署在 IIS 中并允许必要的防火墙端口,因此我转到位于不同域中的客户端 PC。
我在这台机器上启动了 WCF 测试客户端并输入了 WSDL 的 URL,我能够查看服务调用没有问题。唯一的事情是当我实际尝试使用该方法并发送我的值时,我得到以下响应
“呼叫者未经服务验证”
奇怪 - 即使它仍然可以在本地工作,但它不会在另一台机器上工作。有没有一种特定的方法可以根据我在做什么来配置客户端??
这是我的 web.config
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<services>
<service name="WCF33.Service1">
<endpoint address ="" binding="wsHttpBinding" contract="WCF33.IService1" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8080/WCF33/Service1/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<!--
To browse web app root directory during debugging, set the value below to true.
Set to false before deployment to avoid disclosing web app folder information.
-->
<directoryBrowse enabled="true"/>
</system.webServer>
</configuration>
我遵循的教程在消息头中传递了一个密钥并基于该密钥进行身份验证,但这不是问题所在。我认为这与 wshttp 绑定有关,但我确实需要这种类型的加密。
谁能给我任何关于如何解决这个问题的信息/建议:)
【问题讨论】:
标签: c# wcf wcf-binding wcf-security wcf-client