在过去的几天里,我一直在设置流媒体服务,每次我回到任务时,我都会遇到同样的 400 错误请求。我在这里和网上搜索了许多帖子,这似乎是一个常见问题,但每种情况都不同。下面是我的绑定设置的当前状态 - 我觉得这必须是我忽略的一些小东西。
来自 WCF 分析器的信息:
- 调用服务时,会引发警告,说明“未找到配置评估上下文”。
- 下一个条目指出“未找到匹配的服务标签。添加了默认端点。”
这使我相信我设置的任何内容都没有应用于服务,因此抛出错误请求错误,因为它使用了我的流超过的 ~64kb 默认值。
<!-- Services Config -->
<system.web>
<httpRuntime maxRequestLength="2097150" executionTimeout="7200"/>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="StreamingService" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" transferMode="Streamed" >
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
<security mode="None">
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="StreamingService" behaviorConfiguration="StreamingServiceBehavior">
<endpoint address="http://localhost:50577/StreamingContent.svc"
binding="basicHttpBinding" bindingConfiguration="StreamingService"
contract="IStreamingContent" name="BasicHttpBinding_IStreamingContent" />
</service>
</services>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<!-- Web Server Config -->
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IStreamingContent" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:01:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
messageEncoding="Text" textEncoding="utf-8" transferMode="Streamed"
useDefaultWebProxy="true">
<readerQuotas maxDepth="128" maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:50577/StreamingService.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IStreamingService"
contract="StreamingService.IStreamingService" name="BasicHttpBinding_IStreamingService" />
</client>
任何新的观点肯定会有所帮助。
编辑:我在接受下面的建议后更新了上面的配置,但我仍然在探查器中遇到同样的问题,没有找到匹配的标签,只有这一次我相信我的设置是正确的.....显然不是因为它会工作现在不会了吧?
想法?