C#web services byte []> 20k [英] C# web services byte[]>20k

查看:73
本文介绍了C#web services byte []> 20k的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨我使用带有java的C#web服务,当我发送数据时,它的工作正常,但是当我发送byte []> 20k

时,我需要
>
错误:

线程AWT-EventQueue-0中的异常javax.xml.ws.soap.SOAPFaultException:格式化程序在尝试反序列化消息时引发异常:反序列化时出错操作''simage''的请求消息正文。读取XML数据时已超出最大数组长度配额(16384)。通过更改创建XML阅读器时使用的XmlDictionaryReaderQuotas对象上的MaxArrayLength属性,可以增加此配额。第1行,第40290位。



ph

hi i use C# web services with java when i send data it''s work fine but
when i send byte[]>20k

err:
Exception in thread "AWT-EventQueue-0" javax.xml.ws.soap.SOAPFaultException: The formatter threw an exception while trying to deserialize the message: Error in deserializing body of request message for operation ''simage''. The maximum array length quota (16384) has been exceeded while reading XML data. This quota may be increased by changing the MaxArrayLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 1, position 40290.

p.h

推荐答案

错误信息似乎相当具体 - 它甚至解释了你必须解决的问题。



鉴于你已经在这里待了六年,你真的应该有能力解决这个问题你自己!
The error message does seem to be rather specific - it even explains what you have to do you fix the problem.

Given that you have been here for six years, you really should have been capable of working this out for yourself!


if you use NetFrameWork 4.0, you need to remove "name=myBinding" . I don't know why, but it works.

Service Side:

 

<system.serviceModel>
 <bindings>
  <basicHttpBinding>
  <binding maxReceivedMessageSize="2147483647">
   <readerQuotas
   maxDepth="2147483647"
   maxStringContentLength="2147483647"
   maxArrayLength="2147483647"
   maxBytesPerRead="2147483647"
   maxNameTableCharCount="2147483647" />
   
  </binding>
  </basicHttpBinding>
 </bindings>
 <behaviors>
  <serviceBehaviors>
  <behavior>
   <!-- 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="true"/>   
  </behavior>
  </serviceBehaviors>
 </behaviors>
 <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
 </system.serviceModel>



Thanks you


这篇关于C#web services byte []&gt; 20k的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆