我正在尝试创建一个WCF服务与匿名身份验证。当我将服务部署到目前不在我当前域的目标服务器时,我尝试调用它时收到以下错误:WCF服务绑定wsHttp与基本没有身份验证
内容类型application/soap + xml; charset = utf-8不支持 服务http://myserver.com/page.svc。 客户端和服务绑定可能是 不匹配。
因为目前的情况是我在为我服务的web.config文件中的以下部分:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
</modules>
</system.webServer>
我一直在尝试不同的绑定(的wsHttpBinding和basicHttpBinding的),但我要么收到上述错误(使用basicHttpBinding)或“访问被拒绝”消息(使用wsHttpBinding)。以下是我在使用wsHttpBinding时试图使用的web.config部分
<system.serviceModel>
<services>
<service behaviorConfiguration="AMP.MainBehavior" name="AMP.Main">
<endpoint address="" binding="wsHttpBinding" contract="AMP.IMain">
<identity>
<dns value="myservice.com"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="AMP.MainBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
该服务已使用.NET 4.0框架创建。我需要它是匿名的,但我不确定我错过了什么。我是WCF的新手,所以我没有连续排好所有的鸭子。
谢谢
什么是客户端的配置? – 2010-09-29 11:43:33