So aku google la as always... tp sume suggestion yg aku try, sume x jalan...most of suggestion suh aku increased length of maxJsonLength dekat web.config... this is the code...
>system.web.extensions>
>scripting>
>webServices>
>jsonSerialization maxJsonLength="50000000"/>
>/webServices>
>/scripting>
>/system.web.extensions>
tp bila tukar pun still error jugak..macam x function jer..sengal giler!!!
berminggu gakla xsolve bende nih...aku bosan giler...
so aku solve error lain dulu...bila come back to this error aku still stuck giler...da suh team mate tgkkn pun die xleh solve...plus die pun ade lots of projects to handle currently...so die suh aku tukar manually...giler nk tukar manually...lg susah aku rase...n die akan jd slow...user mane suke bende slow2 nih..
but now, by hook or by crook i have to solve it as my manager want the "Work Order" yg register dkt iSi7 to be signed and verified by client...mcm nk pecah pale aku carik solution...
luckily i stumble into this website . so when i applied this line of code dekat web service page tu, wallaa error solve. Yeay!!!... im a happy girl in the world...ya i know its lame...kahkahkah...tp pedulik ape aku...ahhahha
owhhh...below are the lines of code that i applied.
String confString = HttpContext.Current.Request.ApplicationPath.ToString(); Configuration conf = WebConfigurationManager.OpenWebConfiguration(confString); ScriptingJsonSerializationSection section = (ScriptingJsonSerializationSection)conf.GetSection("system.web.extensions/scripting/webServices/jsonSerialization"); section.MaxJsonLength = Int32.MaxValue; conf.Save();
Basically, above code die akan resetting blk maxJsonLength tu kepada max value of integer which is 2147483647 (2 GB).
Then, as usual, lps dpt solve error aku akan wat housekeeping..remove sume trial n error aku wat utk solve the error tuh sume yg xjadi/xjln...then baru aku find out that yg aku ubah maxJsonLength tu rupenyer aku ubah salah file..duhhhhhh...i felt so stupid...but the default is at the web service web.config bukannyer dekat connection web.config...duhhhh lg skali...geramnyer...
so i remove the resetting maxJsonLength code tu and keep the proper setting for maxJsonLength dekat webconfig jer...as for me its better and proper...but i just comment jer line coding tu utk future reference...hehe..
Anyway, its a good finding tough...so im decide to put it in my dusty blog as reminder and as reference also...haha....
that's all folks...till we meet again my blog...have a nice day...daaa
Assalamualaikum..
No comments:
Post a Comment