아래와 같은 오류가 발생하면 Web.Config에서 설정값 변경작업을 해야한다.
[원인]
자바스크립트로 웹서비스의 WebMethod 호출시 아래와 같은 오류가 발생
이런 형태로 리턴값을 받을때 JSON형태로 리턴을 한다.(Fiddler로 확인 가능)
[오류내용]
- 한글
JSON JavaScriptSerializer를 사용하여 serialize 또는 deserialize하는 동안 오류가 발생했습니다. 문자열의 길이가 maxJsonLength 속성에 설정된 값을 초과합니다.
- 영문
Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
...
<system.web.extensions>
<scripting>
<webServices>
<jsonSerialization maxJsonLength="500000" />
</webServices>
</scripting>
</system.web.extensions>
...
</configuration>
<configuration>
...
<system.web.extensions>
<scripting>
<webServices>
<jsonSerialization maxJsonLength="500000" />
</webServices>
</scripting>
</system.web.extensions>
...
</configuration>