这是我的web.config文件:
<bindings>
<basicHttpBinding>
<binding
name="ExtremeBinding"
maxBufferSize="12354000"
maxReceivedMessageSize="12354000" />
</basicHttpBinding>
</bindings>
<services>
<service name="WcfService3.Service1" behaviorConfiguration="myServiceBehaviour">
<endpoint
address=""
binding="basicHttpBinding"
bindingConfiguration="ExtremeBinding"
contract="WcfService3.IService1"
behaviorConfiguration="epBehavior"/>
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="epBehavior">
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="myServiceBehaviour">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above 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" />
如果我像这样保存它,并运行WCF测试客户端,一切都会正常工作。
但是如果我在endPoint行为中添加任何东西,例如:
<behavior name="epBehavior">
<callbackDebug includeExceptionDetailInFaults="true"/>
</behavior>WCF测试客户端失败,并显示以下错误:
Failed to add a service. Service metadata may not be accessible. Make sure your service is running and exposing metadata.属性中放入什么似乎并不重要。例如:
<behavior name="epBehavior">
<webHttp/>
</behavior>我很清楚我遗漏了一些基本的东西,但我不知道它是什么。非常感谢。
发布于 2013-01-05 01:02:59
我不知道发生这种情况的确切原因,但我认为您可以通过添加serviceMetadata行为来解决此问题:
<behaviors>
<serviceBehaviors>
<behavior name="NewBehavior">
<serviceMetadata httpsGetEnabled="true"
httpsGetUrl="https://myComputerName/myEndpoint" />
</behavior>
</serviceBehaviors>
</behaviors>来自:http://msdn.microsoft.com/en-us/library/ms731317.aspx
https://stackoverflow.com/questions/14160835
复制相似问题