首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web Service >

WebService有关问题

2012-03-28 
WebService问题自己写了一个WebService,发布后在一个命令行程序里面调用 即SOAP方式调用WebService出现错

WebService问题
自己写了一个WebService,发布后在一个命令行程序里面调用 即SOAP方式调用WebService

出现错误:

Maximum message size quota for incoming messages (65536) has been exceeded.

中文为 已超过传入消息(65536)的最大消息大小配额。若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性。

网上说有修改WebConfig的方法,尝试了 未果 求解

代码

C# code
ServiceReference1.PageInputPortalSrvRequest request = new PortalWSTest.ServiceReference1.PageInputPortalSrvRequest();            #region structure request            ServiceReference1.MsgHeader msgHeader = new PortalWSTest.ServiceReference1.MsgHeader();            msgHeader.SUBMITDATE = DateTime.Now.ToLocalTime();            msgHeader.SOURCESYSTEMID = "SourceSystemID";            request.MsgHeader = msgHeader;            ServiceReference1.WaitLineInfo[] waitLines = new PortalWSTest.ServiceReference1.WaitLineInfo[1000];            for (int i = 1; i <= 1000; i++)            {                ServiceReference1.WaitLineInfo waitLine = new PortalWSTest.ServiceReference1.WaitLineInfo();                waitLine.WAITID = "testForWS" + i.ToString();                waitLine.USERNAME = "UserName" + i.ToString();                waitLine.SENDER = "Sender" + i.ToString();                waitLine.URL = "URL" + i.ToString();                //if (i >= 6)                //{                    waitLine.STATUS = "1";                //}                //else                //{                //    waitLine.STATUS = "0";                //}                waitLine.TITLE = "Title" + i.ToString();                waitLines[i - 1] = waitLine;            }            request.WAITLINES = waitLines;            #endregion            ServiceReference1.PageInputPortalSrvSoapClient test = new PortalWSTest.ServiceReference1.PageInputPortalSrvSoapClient();            DateTime d1 = DateTime.Now;            [color=#FF0000]ServiceReference1.PageInputPortalSrvResponse response = test.Process(request);[/color]            DateTime d2 = DateTime.Now;            TimeSpan time = d2 - d1;            Console.WriteLine("Time:" + time.Milliseconds.ToString());            Console.ReadKey();


在线静候

[解决办法]
沙发。回复肯定太短了。
[解决办法]
不會 
幫你頂哈 ···
[解决办法]
就是超过最大范围了。。。改长点应该就行了啊。。。
[解决办法]
没有高过 帮顶
[解决办法]
http://blog.csdn.net/faunjoe/archive/2009/10/06/4636074.aspx
[解决办法]
参考楼上!

[解决办法]
在Web.config中设置MaxReceivedMessageSize 这个值试试。

[解决办法]
<readerQuotas maxDepth="32" maxStringContentLength="6553600" maxArrayLength="6553600"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />

不够再加!
[解决办法]
<configuration><system.serviceModel><bindings><basicHttpBinding>
<binding ...>
...
</binding>
</basicHttpBinding></bindings></system.serviceModel></configuration>
[解决办法]
修改Web.Config文件,其中的MaxReceivedMessageSize 

C# code
  <system.serviceModel>    <bindings>      <wsHttpBinding>        <binding name="CalculatorBinding" maxBufferPoolSize="2000000"maxReceivedMessageSize="2000000000"  >          <security mode="Transport" >            <transport clientCredentialType="Windows"   />          </security>            <readerQuotas maxDepth="2000000" maxStringContentLength="2000000"maxArrayLength="2000000"              maxBytesPerRead="2000000"maxNameTableCharCount="2000000" />        </binding>      </wsHttpBinding>    </bindings> 

热点排行