我一直在過去幾天設置Streaming服務,每次回到任務時,我一直打到400 Bad Request的同一堵牆。我在網上搜索了很多帖子,看起來這是一個常見問題,但每種情況都不一樣。以下是我的綁定設置的當前狀態 - 我覺得這應該是我忽略的小事。Streaming WCF - 400 Bad Request
從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>
任何新鮮的觀點肯定會有所幫助。
編輯:我更新了配置上述考慮以下的建議後,但我仍然得到在探查同樣的問題在沒有匹配的標籤被發現,只是這一次我相信我設置是否正確?顯然不是因爲它現在可以工作不會吧,呃?
想法?
嘆了口氣,我認爲這讓我朝着正確的方向前進。在客戶端設置它似乎對我來說是錯誤的。將得到這個工作,並讓你知道。提前致謝。 – buildtehawesome
雖然我覺得這是正確的船,但仍有一些東西。 – buildtehawesome