asp.net WebService a workaround for remote access errors

Source: Internet
Author: User

<webservices >
<protocols >
<add name= "HttpSoap"/>
<add name= "HttpPost"/>
<add name= "HttpGet"/>
<add name= "Documentation"/>
</protocols>
</webServices>

If you want to make a normal call in the remote, you need to modify the web.config, add the following paragraph below the system.web section

Other netizens encounter problems

Requests from the page to the data presentation layer, the presentation layer of the request data sent to the WebService service layer, and webservice after a very simple processing, the data to the business layer, the data access layer.
But now I have an exception message when I save an article with an attachment. The program is completely normal between layers. I really don't know why.
An error occurred while saving data: Data presentation Layer Exception: Remote access Error!   System.Web.Services.Protocols.SoapException: An exception occurred while running the extension specified in the configuration file.   ---> System.Web.HttpException: exceeds the maximum request length. At System.Web.HttpRequest.GetEntireRawContent () in System.Web.HttpRequest.get_InputStream () at System.Web.Servic Es. Protocols.SoapServerProtocol.Initialize ()---the end of the inner exception stack trace---at System.Web.Services.Protocols.SoapServerProtoco L.initialize () at System.Web.Services.Protocols.ServerProtocol.SetContext (type type, HttpContext context, Http Request request, HttpResponse response) at System.Web.Services.Protocols.ServerProtocolFactory.Create (Type Typ E, HttpContext context, HttpRequest request, HttpResponse response, boolean& abortprocessing)

Solving method

WebService said the article or ASP tutorial. NET program, your problem should be attachment greater than 4m caused overflow

Add the HttpRuntime configuration section to the configuration file to change the size of the maxRequestLength, with the default value of 4000 representing 4m

<configuration>
<system.web>

Usefullyqualifiedredirecturl= "true"
Executiontimeout= "45"
versionheader= "1.1.4128"/>
</system.web>
</configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.