访问从Windows的形式ASMX服务为最大请求长度错误 [英] Accessing a asmx service from windows-forms gives max request length error
问题描述
我尝试使用ASMX服务从Windows的形式上传文件。我已指定在web.config中的最大请求长度,其中ASMX服务托管。该服务效果很好,当我试着上传从那里ASMX服务托管的Web格式的文件。
I try to upload a file using asmx service from windows forms. I have specified max request length in web.config where asmx service is hosted. The service works well when i try to upload a file from a web form where asmx service is hosted.
现在的问题是,当我尝试使用Windows上载文件形成它给了我最大请求长度错误。
Now the issue is when i try to upload a file using windows forms it gives me max request length error.
Windows应用程序的app.config的code是:
The code of app.config of windows application is as:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="MySiteServiceSoap" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="655360000" maxBufferPoolSize="5242880000" maxReceivedMessageSize="655360000"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="81920000" maxArrayLength="163840000"
maxBytesPerRead="40960000" maxNameTableCharCount="163840000" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://mysite2.mydomain.com/mysiteservice.asmx"
binding="basicHttpBinding" bindingConfiguration="MySiteServiceSoap"
contract="MySiteService.MySiteServiceSoap" name="MySiteServiceSoap" />
</client>
</system.serviceModel>
我增加maxbufeerlenth等大小,但它不能正常工作。
I increase the size of maxbufeerlenth etc but it does not work.
我试图上传的文件大小只有7 MB
The file i am trying to upload is of size 7 MB only
有关较小的文件(小于1 MB)是没有问题的。
For smaller files (of less than 1 MB) there is no problem.
还有一点我想补充的是,我在Windows窗体中添加服务作为一个添加服务引用向导。
One more point i want to add is i add a service in windows forms as a "ADD SERVICE REFERENCE WIZARD".
任何帮助是AP preciated。
Any help is appreciated.
推荐答案
这是与请求限制IIS配置问题
This is an issue with IIS configuration for Request Limits
本Q&安培; A 使用jQuery 添加行可以帮助你。
this Q&A Add row using jquery helps you
这是的http://www.iis.net/ConfigReference/system.webServer/security/requestFiltering/requestLimits你找到更详细的信息。
and this is http://www.iis.net/ConfigReference/system.webServer/security/requestFiltering/requestLimits where you find more detailed information
这篇关于访问从Windows的形式ASMX服务为最大请求长度错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!