function ServiceProxy(b){var c=this;var a=60000;this.serviceUrl=b;this.invoke=function(h,g,k,f,d,i){if(g!=null&&g.req!=null){g.req.UserBrowser=navigator.userAgent}var j=JSON2.stringifyWcf(g);var e=c.serviceUrl+h;if(i){a=i}if(d){d.show()}return $.ajax({url:e,data:j,type:"POST",processData:false,contentType:"application/json",timeout:a,dataType:"text",success:function(l){if(d){d.hide()}if(l==null||l==""){return}if(!k){return}setTimeout(function(){try{var m={};m=JSON2.parse(l);k(m)}catch(n){PublishStringClientError(n)}},0);return},error:function(q,l){try{if(l!="timeout"){}else{if(d){d.hide()}if(!f){return}if(!q.responseText){}else{if(q.responseText!=""){var r={IsJSON:false,JSONResponse:null,HtmlResponse:null};var n;try{n=JSON2.parse(q.responseText);r.IsJSON=true;r.JSONResponse=n}catch(p){n=q.responseText;r.IsJSON=false;r.HtmlResponse=n}if(h!="Log"){try{var m=new ServiceProxy(c.serviceUrl);setTimeout(function(){m.invoke("Log",{req:{Message:q.responseText,Module:h,JSONData:JSON2.stringify(g)}},function(){},function(){})},0)}catch(o){}}}else{}}return}}catch(o){}}})}};

