WCF 4 REST 模板和 base64 字符串 - HTTP 400
我正在尝试使用 Microsoft 提供的 wcf 4 REST 模板将长(大约 155000 个字符)base64 字符串提交到 WCF REST 服务。每当我尝试通过 post 方法从客户端应用程序或 fiddler 提交 XML 时,我都会收到 HTTP 状态代码 400 作为对我的请求的响应。我有适当的 web.config 设置,这些设置是从各种博客文章和其他 stackoverflow 文章中拼凑而成的。
<bindings>
<webHttpBinding>
<binding name="httpBinding" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" transferMode="Streamed" openTimeout="00:25:00" closeTimeout="00:25:00" sendTimeout="00:25:00" receiveTimeout="00:25:00">
<readerQuotas maxDepth="64"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647"/>
</binding>
</webHttpBinding>
</bindings>
我在这里缺少什么?其他一切都很好;我向服务提交 text/xml 格式的请求,只要我不使用 base64 字符串,其他所有内容都会返回 200。我知道还有一百万个关于 wcf 消息大小的其他帖子,但如果有人能快速浏览一下我的帖子,我将不胜感激。
这是我试图让 wcf 服务处理的示例请求的链接。
我很感激任何人可能有的任何想法。
I am trying to submit a long (approx. 155000 characters) base64 string to a WCF REST service using the wcf 4 REST template made available by Microsoft. Whenever I try submitting the the the XML through the post method either from the client application or fiddler I get a HTTP status code 400 in response to my request. I have the appropriate web.config settings, pieced together from various blog posts and other stackoverflow posts.
<bindings>
<webHttpBinding>
<binding name="httpBinding" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" transferMode="Streamed" openTimeout="00:25:00" closeTimeout="00:25:00" sendTimeout="00:25:00" receiveTimeout="00:25:00">
<readerQuotas maxDepth="64"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647"/>
</binding>
</webHttpBinding>
</bindings>
what am I missing here? Everything else works great; I submit requests that are text/xml format to the service and everything else returns 200, as long as I'm not working with the base64 string. I know there are a million other posts about wcf message size, but I would appreciate it somebody would take a quick look at mine.
Here is a link to the sample request I am trying to get the wcf service to handle.
I would appreciate any thoughts anybody might have.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试在服务器端启用跟踪以查看导致服务器拒绝请求的原因。另外,请仔细检查:
元素具有值为“httpBinding”的bindingConfiguration
属性
服务的元素name
属性,它与服务类的完全限定名称相匹配(即,使用命名空间,本质上与您在 .svc 文件中使用的值相同) )。Try enabling tracing at the server side to see what is causing the server to reject the request. Also, double check that:
<endpoint>
element for your service has abindingConfiguration
attribute with value "httpBinding"<service>
element for your service aname
attribute which matches the fully-qualified name of the service class (i.e., with the namespace, essentially the same value you use in the .svc file).