我该如何解决:在WCF中没有命名的端点行为? [英] How can I fix: There is no endpoint behavior named in WCF?
本文介绍了我该如何解决:在WCF中没有命名的端点行为?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有一个错误:没有名为'webHttpBehavior'的端点行为。
这是代码,但有一个名为'webHttpBehavior'的端点。
There is an error:There is no endpoint behavior named 'webHttpBehavior'.
Here is the code, but there is a endpoint named 'webHttpBehavior'.
<?xml version="1.0"?>
<configuration>
<system.web>
<authorization>
<deny users="?"/>
</authorization>
<compilation debug="true" targetFramework="4.0"/>
<httpRuntime/>
</system.web>
<system.serviceModel>
<services>
<service name="WebApplication2.Service.Service1">
<endpoint address="" binding="webHttpBinding" contract="WebApplication2.Service.IService1" bindingConfiguration="ApiQuotaBinding" behaviorConfiguration="webHttpBehavior"></endpoint>
<host>
<baseAddresses>
<add baseAddress="http://localhost:11008/Service"/>
</baseAddresses>
</host>
</service>
</services>
<bindings>
<!-- Customizations for REST service -->
<webHttpBinding>
<!-- Limits set to 10 MB (specified value in bytes) -->
<binding name="ApiQuotaBinding" maxReceivedMessageSize="1048576000" maxBufferPoolSize="1048576000" maxBufferSize="1048576000" closeTimeout="00:03:00" openTimeout="00:03:00" receiveTimeout="00:10:00" sendTimeout="00:03:00">
<readerQuotas maxDepth="32" maxStringContentLength="104857600" maxArrayLength="1048576000" maxBytesPerRead="1048576000" />
<security mode="None" />
</binding>
</webHttpBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="webHttpBehavior">
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>
有人可以帮我找到问题吗?
我从 https:// www复制代码。 youtube.com/watch?v=7oM_68cbip0 [ ^ ]给我WCF。
推荐答案
嗨Iris Shing,
您的代码有2个错误 -
1.它正在阅读webHttpBehavior as webHttpBehav-ior
2.它正在读取ApiQuotaBinding作为ApiQuotaBinding ing
所以只需重新命名它们手动,它将开始正常工作。
Hi Iris Shing,
your code is having 2 error-
1. It is reading webHttpBehavior as webHttpBehav-ior
2. It is reading ApiQuotaBinding as ApiQuotaBind-ing
So just rename them again manually, and it will start working fine.
这篇关于我该如何解决:在WCF中没有命名的端点行为?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文