//>>builtdefine("../_base/array ../_base/declare ../_base/Deferred ../_base/kernel ../_base/lang ../_base/url ../_base/xhr".split(" "),function(f,g,h,k,d,e,l){returng("dojo.rpc.RpcService",null,{constructor:function(a){if(a)if(d.isString(a)||ainstanceofe){varb=l.get({url:ainstanceofe?a+"":a,handleAs:"json-comment-optional",sync:!0});b.addCallback(this,"processSmd");b.addErrback(function(){throwError("Unable to load SMD from "+a);})}elsea.smdStr?this.processSmd(k.eval("("+a.smdStr+")")):(a.serviceUrl&&(this.serviceUrl=a.serviceUrl),this.timeout=a.timeout||0,"strictArgChecks"ina&&(this.strictArgChecks=a.strictArgChecks),this.processSmd(a))},strictArgChecks:!0,serviceUrl:"",parseResults:function(a){returna},errorCallback:function(a){returnfunction(b){a.errback(b)}},resultCallback:function(a){returnd.hitch(this,function(b){if(null!=b.error){varc;"object"==typeofb.error?(c=Error(b.error.message),c.code=b.error.code,c.error=b.error.error):c=Error(b.error);c.id=b.id;c.errorObject=b;a.errback(c)}elsea.callback(this.parseResults(b))})},generateMethod:function(a,b,c){returnd.hitch(this,function(){vare=newh;if(this.strictArgChecks&&null!=b&&arguments.length!=b.length)throwError("Invalid number of parameters for remote method.");this.bind(a,d._toArray(arguments),e,c);returne})},processSmd:function(a){a.methods&&f.forEach(a.methods,function(a){if(a&&a.name&&(this[a.name]=this.generateMethod(a.name,a.parameters,a.url||a.serviceUrl||a.serviceURL),!d.isFunction(this[a.name])))throwError("RpcService: Failed to create"+a.name+"()");},this);this.serviceUrl=a.serviceUrl||a.serviceURL;this.required=a.required;this.smd=a}})});