Click here to Skip to main content
15,887,987 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I keep getting stuck with this error on my postman api where I want to send a large string as one of the parameters to my web service when it is hosted on a local server. When I test the service on localhost it works fine. http://i.stack.imgur.com/O2Fgl.png[^]

The web service is supposed to return the path of an image that is saved in the server. http://i.stack.imgur.com/47se0.png[^]
The above string worked because it is a much smaller string of around 4000 characters unlike the string I used before which is almost 14000 characters long.

Searching on the internet and I found that I need to make changes in my Web.config file specifically the maxJsonLength maxRequestLength but this did not work for me.

Any suggestions?

What I have tried:

Made changes to httpRuntime executionTimeout, maxRequestLength in my web.config file and still it doesn't work for large strings. Also made changes to jsonSerialization maxJsonLength in my web.config file and it still doesn't send the large string.
Posted
Updated 5-Jul-16 22:08pm
v3
Comments
xszaboj 6-Jul-16 6:44am    
what is the actual error? It might be something else than the size problem
Member 12597529 6-Jul-16 8:06am    
The error is shown in: http://i.stack.imgur.com/O2Fgl.png
It should be a size issue because it works for a smaller string like : http://i.stack.imgur.com/47se0.png
xszaboj 6-Jul-16 9:44am    
in that case try to enable custom errors in wcf config file, and you should get more specif error message then just 400 bad request.
Madhu Nair 7-Jul-16 2:56am    
Have you checked the error logs in the server? Try calling the method from the server where the service is hosted using the localhost instead of the public url and see if you are getting any error details.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900