forked from speedyankur/tinysoap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tinysoap-browser-min.js
2 lines (2 loc) · 47.9 KB
/
tinysoap-browser-min.js
1
2
this.tinysoap=function(){var t={};return t.__builtin_require="undefined"==typeof require?function(){}:require,t.__require=function(e){var n=t[e];return null===n.status&&n.loader.call(),n.module.exports},t.https={status:"loaded",module:{exports:t.__builtin_require("https")}},t.http={status:"loaded",module:{exports:t.__builtin_require("http")}},t.util={status:"loaded",module:{exports:t.__builtin_require("util")}},t.fs={status:"loaded",module:{exports:t.__builtin_require("fs")}},t.crypto={status:"loaded",module:{exports:t.__builtin_require("crypto")}},t["tinysoap/lib/querystring.js"]={status:null,module:{exports:{}},loader:function(){function e(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var n=t["tinysoap/lib/querystring.js"].module,s=(n.exports,function(e){var n={},s=n[e];return s?t.__require(s):t.__builtin_require(e)});t.__builtin_require&&(s.resolve=t.__builtin_require.resolve),t["tinysoap/lib/querystring.js"].status="loading",n.exports.decode=function(t,n,s,i){n=n||"&",s=s||"=";var r={};if("string"!=typeof t||0===t.length)return r;var o=/\+/g;t=t.split(n);var a=1e3;i&&"number"==typeof i.maxKeys&&(a=i.maxKeys);var u=t.length;a>0&&u>a&&(u=a);for(var p=0;u>p;++p){var l,c,h,m,_=t[p].replace(o,"%20"),d=_.indexOf(s);d>=0?(l=_.substr(0,d),c=_.substr(d+1)):(l=_,c=""),h=decodeURIComponent(l),m=decodeURIComponent(c),e(r,h)?Array.isArray(r[h])?r[h].push(m):r[h]=[r[h],m]:r[h]=m}return r};var i=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};n.exports.encode=function(t,e,n,s){return e=e||"&",n=n||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map(function(s){var r=encodeURIComponent(i(s))+n;return Array.isArray(t[s])?t[s].map(function(t){return r+encodeURIComponent(i(t))}).join(e):r+encodeURIComponent(i(t[s]))}).join(e):s?encodeURIComponent(i(s))+n+encodeURIComponent(i(t)):""},t["tinysoap/lib/querystring.js"].status="loaded"}.bind(this)},t["tinysoap/lib/url.js"]={status:null,module:{exports:{}},loader:function(){function e(t,e,n){if(t&&"object"==typeof t&&t.href)return t;var s={href:t},i=t,o=p.exec(i);if(o&&(o=o[0],s.protocol=o,i=i.substr(o.length)),n||o||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var a="//"===i.substr(0,2);!a||o&&h[o]||(i=i.substr(2),s.slashes=!0)}if(!h[o]&&(a||o&&!m[o])){for(var u=-1,l=0,d=c.length;d>l;l++){var f=i.indexOf(c[l]);-1!==f&&(0>u||u>f)&&(u=f)}-1!==u?(s.host=i.substr(0,u),i=i.substr(u)):(s.host=i,i="");for(var y=r(s.host),E=Object.keys(y),l=0,d=E.length;d>l;l++){var g=E[l];s[g]=y[g]}s.hostname=s.hostname||""}var b=i.indexOf("#");-1!==b&&(s.hash=i.substr(b),i=i.slice(0,b));var x=i.indexOf("?");return-1!==x?(s.search=i.substr(x),s.query=i.substr(x+1),e&&(s.query=_.parse(s.query)),i=i.slice(0,x)):e&&(s.query={}),i&&(s.pathname=i),s.path=s.pathname+s.search,s}function n(t){"string"==typeof t&&(t=e(t));var n=t.protocol||"",s=void 0!==t.host?t.host:void 0!==t.hostname?(t.auth?t.auth+"@":"")+t.hostname+(t.port?":"+t.port:""):!1,i=t.pathname||"",r=t.search||t.query&&"?"+("object"==typeof t.query?_.stringify(t.query):String(t.query))||"",o=t.hash||"";return n&&":"!==n.substr(-1)&&(n+=":"),t.slashes||(!n||m[n])&&s!==!1?(s="//"+(s||""),i&&"/"!==i.charAt(0)&&(i="/"+i)):s||(s=""),o&&"#"!==o.charAt(0)&&(o="#"+o),r&&"?"!==r.charAt(0)&&(r="?"+r),n+s+i+r+o}function s(t,e){return n(i(t,e))}function i(t,s){if(!t)return s;if(t=e(n(t),!1,!0),s=e(n(s),!1,!0),t.hash=s.hash,""===s.href)return t;if(s.slashes&&!s.protocol)return s.protocol=t.protocol,s;if(s.protocol&&s.protocol!==t.protocol){if(!m[s.protocol])return s;if(t.protocol=s.protocol,!s.host&&!h[s.protocol]){for(var i=(s.pathname||"").split("/");i.length&&!(s.host=i.shift()););s.host||(s.host=""),""!==i[0]&&i.unshift(""),i.length<2&&i.unshift(""),s.pathname=i.join("/")}return t.pathname=s.pathname,t.search=s.search,t.query=s.query,t.host=s.host||"",delete t.auth,delete t.hostname,t.port=s.port,t}var r=t.pathname&&"/"===t.pathname.charAt(0),o=void 0!==s.host||s.pathname&&"/"===s.pathname.charAt(0),a=o||r||t.host&&s.pathname,u=a,p=t.pathname&&t.pathname.split("/")||[],i=s.pathname&&s.pathname.split("/")||[],l=t.protocol&&!m[t.protocol]&&void 0!==t.host;if(l&&(delete t.hostname,delete t.auth,delete t.port,t.host&&(""===p[0]?p[0]=t.host:p.unshift(t.host)),delete t.host,s.protocol&&(delete s.hostname,delete s.auth,delete s.port,s.host&&(""===i[0]?i[0]=s.host:i.unshift(s.host)),delete s.host),a=a&&(""===i[0]||""===p[0])),o)t.host=s.host||""===s.host?s.host:t.host,t.search=s.search,t.query=s.query,p=i;else if(i.length)p||(p=[]),p.pop(),p=p.concat(i),t.search=s.search,t.query=s.query;else if("search"in s)return l&&(t.host=p.shift()),t.search=s.search,t.query=s.query,t;if(!p.length)return delete t.pathname,t;for(var c=p.slice(-1)[0],_=(t.host||s.host)&&("."===c||".."===c)||""===c,d=0,f=p.length;f>=0;f--)c=p[f],"."==c?p.splice(f,1):".."===c?(p.splice(f,1),d++):d&&(p.splice(f,1),d--);if(!a&&!u)for(;d--;d)p.unshift("..");!a||""===p[0]||p[0]&&"/"===p[0].charAt(0)||p.unshift(""),_&&"/"!==p.join("/").substr(-1)&&p.push("");var y=""===p[0]||p[0]&&"/"===p[0].charAt(0);return l&&(t.host=y?"":p.shift()),a=a||t.host&&p.length,a&&!y&&p.unshift(""),t.pathname=p.join("/"),t}function r(t){var e={},n=t.indexOf("@");-1!==n&&(e.auth=t.substr(0,n),t=t.substr(n+1));var s=l.exec(t);return s&&(s=s[0],e.port=s.substr(1),t=t.substr(0,t.length-s.length)),t&&(e.hostname=t),e}var o=t["tinysoap/lib/url.js"].module,a=o.exports,u=function(e){var n={"./querystring":"tinysoap/lib/querystring.js"},s=n[e];return s?t.__require(s):t.__builtin_require(e)};t.__builtin_require&&(u.resolve=t.__builtin_require.resolve),t["tinysoap/lib/url.js"].status="loading",a=o.exports,a.parse=e,a.resolve=s,a.resolveObject=i,a.format=n;var p=/^([a-z0-9]+:)/,l=/:[0-9]+$/,c=["/","?",";","#"],h={file:!0,"file:":!0},m={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},_=u("./querystring");t["tinysoap/lib/url.js"].status="loaded"}.bind(this)},t["tinysoap/lib/http.js"]={status:null,module:{exports:{}},loader:function(){var e=t["tinysoap/lib/http.js"].module,n=e.exports,s=function(e){var n={"./url":"tinysoap/lib/url.js",https:"https",http:"http"},s=n[e];return s?t.__require(s):t.__builtin_require(e)};t.__builtin_require&&(s.resolve=t.__builtin_require.resolve),t["tinysoap/lib/http.js"].status="loading";var i=s("./url"),r="0.2.0";n.request=function(t,e,n,o,a){if("undefined"!=typeof window){m={"User-Agent":"node-soap/"+r,Accept:"text/html,application/xhtml+xml,application/xml","Accept-Encoding":"none","Accept-Charset":"utf-8","Content-Type":"application/x-www-form-urlencoded",Connection:"close",Host:c},o=o||{};for(var u in o)m[u]=o[u];$.ajax(t,{headers:m,type:e?"POST":"GET",data:e,dataType:"text",success:function(t){resp={statusCode:200},n(null,resp,t)},error:function(t,e,s){resp={statusCode:t.status},n(s,resp,t.responseText)}})}else{var p=i.parse(t),l="https:"==p.protocol,c=p.hostname,h=(parseInt(p.port||(l?443:80)),[p.pathname||"/",p.search||"",p.hash||""].join(""),e?"POST":"GET"),m={"User-Agent":"node-soap/"+r,Accept:"text/html,application/xhtml+xml,application/xml","Accept-Encoding":"none","Accept-Charset":"utf-8",Connection:"close",Host:c};"string"==typeof e&&(m["Content-Length"]=Buffer.byteLength(e,"utf8"),m["Content-Type"]="application/x-www-form-urlencoded"),o=o||{};for(var u in o)m[u]=o[u];var _=p;_.method=h,_.headers=m,a=a||{};for(var u in a)_[u]=a[u];var d;d=s(l?"https":"http");var f=d.request(_,function(t,e){var e="";t.on("data",function(t){e+=t}),t.on("end",function(){n(null,t,e)})});f.on("error",n),f.end(e)}},t["tinysoap/lib/http.js"].status="loaded"}.bind(this)},t["tinysoap/lib/assert.js"]={status:null,module:{exports:{}},loader:function(){var e=t["tinysoap/lib/assert.js"].module,n=(e.exports,function(e){var n={},s=n[e];return s?t.__require(s):t.__builtin_require(e)});t.__builtin_require&&(n.resolve=t.__builtin_require.resolve),t["tinysoap/lib/assert.js"].status="loading",e.exports=function(t,e){if(1!=!!t)throw console.log(e),new Error(e)},t["tinysoap/lib/assert.js"].status="loaded"}.bind(this)},t["tinysoap/lib/client.js"]={status:null,module:{exports:{}},loader:function(){function e(t,e){for(var n in t)if(t[n]===e)return n}var n=t["tinysoap/lib/client.js"].module,s=n.exports,i=function(e){var n={"./http":"tinysoap/lib/http.js","./assert":"tinysoap/lib/assert.js","./url":"tinysoap/lib/url.js"},s=n[e];return s?t.__require(s):t.__builtin_require(e)};t.__builtin_require&&(i.resolve=t.__builtin_require.resolve),t["tinysoap/lib/client.js"].status="loading";var r=i("./http"),o=i("./assert"),a=(i("./url"),function(t,e){this.wsdl=t,this._initializeServices(e)});a.prototype.setEndpoint=function(t){this.endpoint=t,this._initializeServices(t)},a.prototype.describe=function(){this.wsdl.definitions.types;return this.wsdl.describeServices()},a.prototype.setSecurity=function(t){this.security=t},a.prototype.setSOAPAction=function(t){this.SOAPAction=t},a.prototype._initializeServices=function(t){var e=this.wsdl.definitions,n=e.services;for(var s in n)this[s]=this._defineService(n[s],t)},a.prototype._defineService=function(t,e){var n=t.ports,s={};for(var i in n)s[i]=this._definePort(n[i],e?e:n[i].location);return s},a.prototype._definePort=function(t,e){var n=e,s=t.binding,i=s.methods,r={};for(var o in i)r[o]=this._defineMethod(i[o],n),this[o]||(this[o]=r[o]);return r},a.prototype._defineMethod=function(t,e){var n=this;return function(s,i){"function"==typeof s&&(i=s,s={}),n._invoke(t,s,e,function(t,e,n){i(t,e,n)})}},a.prototype._invoke=function(t,n,s,i){var a=this,u=t.$name,p=t.input,l=t.output,c=t.style,h=this.wsdl.definitions,m=h.$targetNamespace,_="",d="",f=null,y={SOAPAction:this.SOAPAction?this.SOAPAction(m,u):(m.lastIndexOf("/")!=m.length-1?m+"/":m)+u,"Content-Type":"text/xml; charset=utf-8"},E={},g=e(h.xmlns,m);a.security&&a.security.addHeaders&&a.security.addHeaders(y),a.security&&a.security.addOptions&&a.security.addOptions(E),p.parts?(o(!c||"rpc"==c,"invalid message definition for document style binding"),d=a.wsdl.objectToRpcXML(u,n,g,m),"encoded"===t.inputSoap&&(_='soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" ')):"string"==typeof n?d=n:(o(!c||"document"==c,"invalid message definition for rpc style binding"),d=a.wsdl.objectToDocumentXML(p.$name,n,p.targetNSAlias,p.targetNamespace)),f='<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" '+_+this.wsdl.xmlnsInEnvelope+"><soap:Header>"+(a.security?a.security.toXML():"")+"</soap:Header><soap:Body>"+d+"</soap:Body></soap:Envelope>",r.request(s,f,function(t,e,n){if(t)i(t,n?a.wsdl.xmlToObject(n):null,n);else{try{var s=a.wsdl.xmlToObject(n)}catch(r){return i(r,e,n)}var o=s.Body[l.$name];o||(o=s.Body[u+"Response"]),i(null,o,n)}},y,E)},s.Client=a,t["tinysoap/lib/client.js"].status="loaded"}.bind(this)},t["node-xml/lib/node-xml.js"]={status:null,module:{exports:{}},loader:function(){var e=t["node-xml/lib/node-xml.js"].module,n=e.exports,s=function(e){var n={util:"util",fs:"fs",util:"util"},s=n[e];return s?t.__require(s):t.__builtin_require(e)};t.__builtin_require&&(s.resolve=t.__builtin_require.resolve),t["node-xml/lib/node-xml.js"].status="loading",function(){function t(t){var e=/&/g,n=/</g,s=/>/g,i=/"/g,r=/'/g;return t=t.replace(e,"&"),t=t.replace(n,"<"),t=t.replace(s,">"),t=t.replace(i,'"'),t=t.replace(r,"'")}var e=function(t){t=r.replace(t,null,null,"\r\n","\n"),t=r.replace(t,null,null,"\r","\n"),this.m_xml=t,this.m_iP=0,this.m_iState=e._STATE_PROLOG,this.m_stack=new o,this._clearAttributes(),this.m_pause=!1,this.m_preInterruptIState=e._STATE_PROLOG,this.m_namespaceList=new Array,this.m_chunkTransitionContinuation=null};e._NONE=0,e._ELM_B=1,e._ELM_E=2,e._ELM_EMP=3,e._ATT=4,e._TEXT=5,e._ENTITY=6,e._PI=7,e._CDATA=8,e._COMMENT=9,e._DTD=10,e._ERROR=11,e._INTERRUPT=12,e._CONT_XML=0,e._CONT_ALT=1,e._ATT_NAME=0,e._ATT_VAL=1,e._STATE_PROLOG=1,e._STATE_DOCUMENT=2,e._STATE_MISC=3,e._errs=new Array,e._errs[e.ERR_CLOSE_PI=0]="PI: missing closing sequence",e._errs[e.ERR_CLOSE_DTD=1]="DTD: missing closing sequence",e._errs[e.ERR_CLOSE_COMMENT=2]="Comment: missing closing sequence",e._errs[e.ERR_CLOSE_CDATA=3]="CDATA: missing closing sequence",e._errs[e.ERR_CLOSE_ELM=4]="Element: missing closing sequence",e._errs[e.ERR_CLOSE_ENTITY=5]="Entity: missing closing sequence",e._errs[e.ERR_PI_TARGET=6]="PI: target is required",e._errs[e.ERR_ELM_EMPTY=7]="Element: cannot be both empty and closing",e._errs[e.ERR_ELM_NAME=8]='Element: name must immediatly follow "<"',e._errs[e.ERR_ELM_LT_NAME=9]='Element: "<" not allowed in element names',e._errs[e.ERR_ATT_VALUES=10]="Attribute: values are required and must be in quotes",e._errs[e.ERR_ATT_LT_NAME=11]='Element: "<" not allowed in attribute names',e._errs[e.ERR_ATT_LT_VALUE=12]='Attribute: "<" not allowed in attribute values',e._errs[e.ERR_ATT_DUP=13]="Attribute: duplicate attributes not allowed",e._errs[e.ERR_ENTITY_UNKNOWN=14]="Entity: unknown entity",e._errs[e.ERR_INFINITELOOP=15]="Infininte loop",e._errs[e.ERR_DOC_STRUCTURE=16]="Document: only comments, processing instructions, or whitespace allowed outside of document element",e._errs[e.ERR_ELM_NESTING=17]="Element: must be nested correctly",e.prototype.continueParsing=function(t){this.m_chunkTransitionContinuation&&(t=this.m_chunkTransitionContinuation+t),t=r.replace(t,null,null,"\r\n","\n"),t=r.replace(t,null,null,"\r","\n"),this.m_xml=t,this.m_iP=0,this.m_iState=e._STATE_DOCUMENT,this.m_pause=!1,this.m_preInterruptIState=e._STATE_PROLOG,this.m_chunkTransitionContinuation=null},e.prototype._addAttribute=function(t,e){this.m_atts[this.m_atts.length]=new Array(t,e)},e.prototype._checkStructure=function(t){if(e._STATE_PROLOG==this.m_iState){if((e._TEXT==t||e._ENTITY==t)&&-1!=r.indexOfNonWhitespace(this.getContent(),this.getContentBegin(),this.getContentEnd()))return this._setErr(e.ERR_DOC_STRUCTURE);(e._ELM_B==t||e._ELM_EMP==t)&&(this.m_iState=e._STATE_DOCUMENT)}if(e._STATE_DOCUMENT==this.m_iState){if((e._ELM_B==t||e._ELM_EMP==t)&&this.m_stack.push(this.getName()),e._ELM_E==t||e._ELM_EMP==t){var n=this.m_stack.pop();if(null==n||n!=this.getName())return this._setErr(e.ERR_ELM_NESTING)}if(0==this.m_stack.count())return this.m_iState=e._STATE_MISC,t}if(e._STATE_MISC==this.m_iState){if(e._ELM_B==t||e._ELM_E==t||e._ELM_EMP==t||e.EVT_DTD==t)return this._setErr(e.ERR_DOC_STRUCTURE);if((e._TEXT==t||e._ENTITY==t)&&-1!=r.indexOfNonWhitespace(this.getContent(),this.getContentBegin(),this.getContentEnd()))return this._setErr(e.ERR_DOC_STRUCTURE)}return t},e.prototype._clearAttributes=function(){this.m_atts=new Array},e.prototype._findAttributeIndex=function(t){for(var n=0;n<this.m_atts.length;n++)if(this.m_atts[n][e._ATT_NAME]==t)return n;return-1},e.prototype.getAttributeCount=function(){return this.m_atts?this.m_atts.length:0},e.prototype.getAttributeName=function(t){return 0>t||t>=this.m_atts.length?null:this.m_atts[t][e._ATT_NAME]},e.prototype.getAttributeValue=function(n){return 0>n||n>=this.m_atts.length?null:t(this.m_atts[n][e._ATT_VAL])},e.prototype.getAttributeValueByName=function(t){return this.getAttributeValue(this._findAttributeIndex(t))},e.prototype.getColumnNumber=function(){return r.getColumnNumber(this.m_xml,this.m_iP)},e.prototype.getContent=function(){return this.m_cSrc==e._CONT_XML?this.m_xml:this.m_cAlt},e.prototype.getContentBegin=function(){return this.m_cB},e.prototype.getContentEnd=function(){return this.m_cE},e.prototype.getLineNumber=function(){return r.getLineNumber(this.m_xml,this.m_iP)},e.prototype.getName=function(){return this.m_name},e.prototype.pause=function(){this.m_pause=!0},e.prototype.resume=function(){this.m_pause=!1,this.m_iState=this.m_preInterruptIState},e.prototype.next=function(){return this.m_pause?(this.m_preInterruptIState=this.m_iState,e._INTERRUPT):this._checkStructure(this._parse())},e.prototype._parse=function(){function t(t,e,n){for(var s=0;s<t.length;s++)if(t.charAt(s)!=e.charAt(n+s))return-1;return n}if(this.m_iP==this.m_xml.length)return e._NONE;var n=this.m_xml.charAt(this.m_iP);return"<"!==n&&"&"!==n?this._parseText(this.m_iP):this.m_iP==t("<?",this.m_xml,this.m_iP)?this._parsePI(this.m_iP+2):this.m_iP==t("<!DOCTYPE",this.m_xml,this.m_iP)?this._parseDTD(this.m_iP+9):this.m_iP==t("<!--",this.m_xml,this.m_iP)?this._parseComment(this.m_iP+4):this.m_iP==t("<![CDATA[",this.m_xml,this.m_iP)?this._parseCDATA(this.m_iP+9):this.m_iP==t("<",this.m_xml,this.m_iP)?this._parseElement(this.m_iP+1):this.m_iP==t("&",this.m_xml,this.m_iP)?this._parseEntity(this.m_iP+1):this._parseText(this.m_iP)},e.prototype._parsePrefixAndElementName=function(t){return splits=t.split(":",2),{prefix:1===splits.length?"":splits[0],name:1===splits.length?t:splits[1]}},e.prototype._parseNamespacesAndAtts=function(t){that=this;var e=[],n=[];return t.map(function(t){return"xmlns"===t[0].slice(0,5)?e.push({prefix:t[0].slice(6),uri:t[1],scopetag:that.m_name}):n.push(t),"not used"}),this.m_namespaceList=this.m_namespaceList.concat(e),[n,e.map(function(t){return[t.prefix,t.uri]})]},e.prototype._getContextualNamespace=function(t){if(""!==t)for(n in this.m_namespaceList)if(n=this.m_namespaceList[n],n.prefix===t)return n.uri;for(var e=this.m_namespaceList.length-1;e>=0;e--){var n=this.m_namespaceList[e];if(""===n.prefix)return n.uri}return""},e.prototype._removeExpiredNamesapces=function(t){var e=[];this.m_namespaceList.map(function(n){n.scopetag!==t&&e.push(n)}),this.m_namespaceList=e},e.prototype._parseAttribute=function(t,n){var s,i,o,a,u,p,l,c;return this.m_cAlt="",s=r.indexOfNonWhitespace(this.m_xml,t,n),-1==s||s>=n?s:(o=this.m_xml.indexOf("=",s),-1==o||o>n?this._setErr(e.ERR_ATT_VALUES):(i=r.lastIndexOfNonWhitespace(this.m_xml,s,o),a=r.indexOfNonWhitespace(this.m_xml,o+1,n),-1==a||a>n?this._setErr(e.ERR_ATT_VALUES):(p=this.m_xml.charAt(a),-1==r.QUOTES.indexOf(p)?this._setErr(e.ERR_ATT_VALUES):(u=this.m_xml.indexOf(p,a+1),-1==u||u>n?this._setErr(e.ERR_ATT_VALUES):(l=this.m_xml.substring(s,i+1),c=this.m_xml.substring(a+1,u),-1!=l.indexOf("<")?this._setErr(e.ERR_ATT_LT_NAME):-1!=c.indexOf("<")?this._setErr(e.ERR_ATT_LT_VALUE):(c=r.replace(c,null,null,"\n"," "),c=r.replace(c,null,null," "," "),iRet=this._replaceEntities(c),iRet==e._ERROR?iRet:(c=this.m_cAlt,-1!=this._findAttributeIndex(l)?this._setErr(e.ERR_ATT_DUP):(this._addAttribute(l,c),this.m_iP=u+2,e._ATT))))))))},e.prototype._parseCDATA=function(t){var n=this.m_xml.indexOf("]]>",t);return-1==n?(this.m_chunkTransitionContinuation=this.m_xml.slice(t-9),e._INTERRUPT):(this._setContent(e._CONT_XML,t,n),this.m_iP=n+3,e._CDATA)},e.prototype._parseComment=function(t){var n=this.m_xml.indexOf("-->",t);return-1==n?(this.m_chunkTransitionContinuation=this.m_xml.slice(t-4),e._INTERRUPT):(this._setContent(e._CONT_XML,t,n),this.m_iP=n+3,e._COMMENT)},e.prototype._parseDTD=function(t){var n,s,i,r;if(n=this.m_xml.indexOf(">",t),-1==n)return this.m_chunkTransitionContinuation=this.m_xml.slice(t-9),e._INTERRUPT;for(i=this.m_xml.indexOf("[",t),s=-1!=i&&n>i?"]>":">";;){if(n==r)return this._setErr(e.ERR_INFINITELOOP);if(r=n,n=this.m_xml.indexOf(s,t),-1==n)return this._setErr(e.ERR_CLOSE_DTD);if("]]>"!=this.m_xml.substring(n-1,n+2))break}return this.m_iP=n+s.length,e._DTD},e.prototype._parseElement=function(t){util=s("util");var n,i,o,a,u,p,l;if(i=n=this.m_xml.indexOf(">",t),-1==n)return this.m_chunkTransitionContinuation=this.m_xml.slice(t-1),e._INTERRUPT;if("/"==this.m_xml.charAt(t)?(u=e._ELM_E,t++):u=e._ELM_B,"/"==this.m_xml.charAt(n-1)){if(u==e._ELM_E)return this._setErr(e.ERR_ELM_EMPTY);u=e._ELM_EMP,i--}if(i=r.lastIndexOfNonWhitespace(this.m_xml,t,i),n-t!=1&&r.indexOfNonWhitespace(this.m_xml,t,i)!=t)return this._setErr(e.ERR_ELM_NAME);if(this._clearAttributes(),o=r.indexOfWhitespace(this.m_xml,t,i),-1==o)o=i+1;else for(this.m_iP=o;this.m_iP<i;){if(this.m_iP==l)return this._setErr(e.ERR_INFINITELOOP);if(l=this.m_iP,a=this._parseAttribute(this.m_iP,i),a==e._ERROR)return a}return p=this.m_xml.substring(t,o),-1!=p.indexOf("<")?this._setErr(e.ERR_ELM_LT_NAME):(this.m_name=p,this.m_iP=n+1,u)},e.prototype._parseEntity=function(t){var n=this.m_xml.indexOf(";",t);return-1==n?(this.m_chunkTransitionContinuation=this.m_xml.slice(t-1),e._INTERRUPT):(this.m_iP=n+1,this._replaceEntity(this.m_xml,t,n))},e.prototype._parsePI=function(t){var n,s,i,o,a;return n=this.m_xml.indexOf("?>",t),-1==n?(this.m_chunkTransitionContinuation=this.m_xml.slice(t-2),e._INTERRUPT):(s=r.indexOfNonWhitespace(this.m_xml,t,n),-1==s?this._setErr(e.ERR_PI_TARGET):(i=r.indexOfWhitespace(this.m_xml,s,n),-1==i&&(i=n),o=r.indexOfNonWhitespace(this.m_xml,i,n),-1==o&&(o=n),a=r.lastIndexOfNonWhitespace(this.m_xml,o,n),-1==a&&(a=n-1),this.m_name=this.m_xml.substring(s,i),this._setContent(e._CONT_XML,o,a+1),this.m_iP=n+2,e._PI))},e.prototype._parseText=function(t){var n,s;for(n=t;n<this.m_xml.length&&(s=this.m_xml.charAt(n),"<"!==s&&"&"!==s);++n);return this._setContent(e._CONT_XML,t,n),this.m_iP=n,e._TEXT},e.prototype._replaceEntities=function(t,n,s){if(r.isEmpty(t))return"";n=n||0,s=s||t.length;var i,o,a="";for(i=t.indexOf("&",n),o=n;i>0&&s>i;){if(a+=t.substring(o,i),o=t.indexOf(";",i)+1,0==o||o>s)return this._setErr(e.ERR_CLOSE_ENTITY);if(iRet=this._replaceEntity(t,i+1,o-1),iRet==e._ERROR)return iRet;a+=this.m_cAlt,i=t.indexOf("&",o)}return o!=s&&(a+=t.substring(o,s)),this._setContent(e._CONT_ALT,a),e._ENTITY},e.prototype._replaceEntity=function(t,n,s){if(r.isEmpty(t))return-1;switch(n=n||0,s=s||t.length,t.substring(n,s)){case"amp":strEnt="&";break;case"lt":strEnt="<";break;case"gt":strEnt=">";break;case"apos":strEnt="'";break;case"quot":strEnt='"';break;case"nbsp":strEnt="";break;case"lt":strEnt="<";break;case"gt":strEnt=">";break;case"amp":strEnt="&";break;case"cent":strEnt="¢";break;case"pound":strEnt="£";break;case"yen":strEnt="¥";break;case"euro":strEnt="€";break;case"sect":strEnt="§";break;case"copy":strEnt="©";break;case"reg":strEnt="®";break;default:strEnt="#"==t.charAt(n)?String.fromCharCode(parseInt(t.substring(n+1,s))):" "}return this._setContent(e._CONT_ALT,strEnt),e._ENTITY},e.prototype._setContent=function(t){var n=arguments;e._CONT_XML==t?(this.m_cAlt=null,this.m_cB=n[1],this.m_cE=n[2]):(this.m_cAlt=n[1],this.m_cB=0,this.m_cE=n[1].length),this.m_cSrc=t},e.prototype._setErr=function(t){var n=e._errs[t];return this.m_cAlt=n,this.m_cB=0,this.m_cE=n.length,this.m_cSrc=e._CONT_ALT,e._ERROR};var i=function(t){var e=new function(){},n=function(){};n.prototype.onStartDocument=function(t){e.onStartDocument=t},n.prototype.onEndDocument=function(t){e.onEndDocument=t},n.prototype.onStartElementNS=function(t){e.onStartElementNS=t},n.prototype.onEndElementNS=function(t){e.onEndElementNS=t},n.prototype.onCharacters=function(t){e.onCharacters=t},n.prototype.onCdata=function(t){e.onCdata=t},n.prototype.onComment=function(t){e.onComment=t},n.prototype.onWarning=function(t){e.onWarning=t},n.prototype.onError=function(t){e.onError=t},t(new n),this.m_hndDoc=e,this.m_hndErr=e,this.m_hndLex=e,this.m_interrupted=!1};i.DOC_B=1,i.DOC_E=2,i.ELM_B=3,i.ELM_E=4,i.CHARS=5,i.PI=6,i.CD_B=7,i.CD_E=8,i.CMNT=9,i.DTD_B=10,i.DTD_E=11,i.prototype.parseFile=function(t){var e=s("fs"),n=this;e.readFile(t,function(t,e){n.parseString(e)})},i.prototype.parseString=function(t){util=s("util");var n=this,r=!0;n.m_parser?(n.m_parser.continueParsing(t),r=!0):(n.m_parser=new e(t),r=!1),n.m_bErr=!1,n.m_bErr||r||n._fireEvent(i.DOC_B),n._parseLoop(),n.m_bErr||n.m_interrupted||n._fireEvent(i.DOC_E),n.m_xml=null,n.m_iP=0,n.m_interrupted=!1},i.prototype.pause=function(){this.m_parser.pause()},i.prototype.resume=function(){this.m_parser.resume(),this.m_interrupted=!1;var t=this;setTimeout(function(){t._parseLoop(),t.m_bErr||t.m_interrupted||t._fireEvent(i.DOC_E)},0)},i.prototype.setDocumentHandler=function(t){this.m_hndDoc=t},i.prototype.setErrorHandler=function(t){this.m_hndErr=t},i.prototype.setLexicalHandler=function(t){this.m_hndLex=t},i.prototype.getColumnNumber=function(){return this.m_parser.getColumnNumber()},i.prototype.getLineNumber=function(){return this.m_parser.getLineNumber()},i.prototype.getMessage=function(){return this.m_strErrMsg},i.prototype.getPublicId=function(){return null},i.prototype.getSystemId=function(){return null},i.prototype.getLength=function(){return this.m_parser.getAttributeCount()},i.prototype.getName=function(t){return this.m_parser.getAttributeName(t)},i.prototype.getValue=function(t){return this.m_parser.getAttributeValue(t)},i.prototype.getValueByName=function(t){return this.m_parser.getAttributeValueByName(t)},i.prototype._fireError=function(t){this.m_strErrMsg=t,this.m_bErr=!0,this.m_hndErr&&this.m_hndErr.onError&&this.m_hndErr.onError(this.m_strErrMsg)},i.prototype._fireEvent=function(t){var e,n,s=arguments,r=s.length-1;this.m_bErr||(i.DOC_B==t?(n="onStartDocument",e=this.m_hndDoc):i.DOC_E==t?(n="onEndDocument",e=this.m_hndDoc):i.ELM_B==t?(n="onStartElementNS",e=this.m_hndDoc):i.ELM_E==t?(n="onEndElementNS",e=this.m_hndDoc):i.CHARS==t?(n="onCharacters",e=this.m_hndDoc):i.PI==t?(n="processingInstruction",e=this.m_hndDoc):i.CD_B==t?(n="onCdata",e=this.m_hndLex):i.CD_E==t?(n="onEndCDATA",e=this.m_hndLex):i.CMNT==t&&(n="onComment",e=this.m_hndLex),e&&e[n]&&(0==r?e[n]():1==r?e[n](s[1]):2==r?e[n](s[1],s[2]):3==r?e[n](s[1],s[2],s[3]):4==r?e[n](s[1],s[2],s[3],s[4]):5==r?e[n](s[1],s[2],s[3],s[4],s[5]):6==r&&e[n](s[1],s[2],s[3],s[4],s[5],s[6])))},i.prototype._parseLoop=function(t){var n,t;for(t=this.m_parser;!this.m_bErr;)if(n=t.next(),n==e._ELM_B){theatts=this.m_parser.m_atts,nameobject=t._parsePrefixAndElementName(t.getName()),theattsandnamespace=t._parseNamespacesAndAtts(theatts);var s=t._getContextualNamespace(nameobject.prefix);this._fireEvent(i.ELM_B,nameobject.name,theattsandnamespace[0],""===nameobject.prefix?null:nameobject.prefix,""===s?null:s,theattsandnamespace[1])}else if(n==e._ELM_E){nameobject=t._parsePrefixAndElementName(t.getName());var s=t._getContextualNamespace(nameobject.prefix);t._removeExpiredNamesapces(t.getName()),this._fireEvent(i.ELM_E,nameobject.name,""===nameobject.prefix?null:nameobject.prefix,""===s?null:s)}else if(n==e._ELM_EMP){theatts=this.m_parser.m_atts,nameobject=t._parsePrefixAndElementName(t.getName()),theattsandnamespace=t._parseNamespacesAndAtts(theatts);var s=t._getContextualNamespace(nameobject.prefix);this._fireEvent(i.ELM_B,nameobject.name,theattsandnamespace[0],""===nameobject.prefix?null:nameobject.prefix,""===s?null:s,theattsandnamespace[1],!0),t._removeExpiredNamesapces(t.getName()),this._fireEvent(i.ELM_E,nameobject.name,""===nameobject.prefix?null:nameobject.prefix,""===s?null:s,!0)}else if(n==e._TEXT)this._fireEvent(i.CHARS,t.getContent().slice(t.getContentBegin(),t.getContentEnd()));else if(n==e._ENTITY)this._fireEvent(i.CHARS,t.getContent(),t.getContentBegin(),t.getContentEnd()-t.getContentBegin());else if(n==e._PI)this._fireEvent(i.PI,t.getName(),t.getContent().substring(t.getContentBegin(),t.getContentEnd()));else if(n==e._CDATA)this._fireEvent(i.CD_B,t.getContent().slice(t.getContentBegin(),t.getContentEnd()));else if(n==e._COMMENT)this._fireEvent(i.CMNT,t.getContent().slice(t.getContentBegin(),t.getContentEnd()));else if(n==e._DTD);else if(n==e._ERROR)this._fireError(t.getContent());else{if(n==e._INTERRUPT)return void(this.m_interrupted=!0);if(n==e._NONE)return}};var r=function(){};r.WHITESPACE=" \n\r",r.QUOTES="\"'",r.getColumnNumber=function(t,e){if(r.isEmpty(t))return-1;e=e||t.length;{var n=t.substring(0,e).split("\n");n[n.length-1]}n.length--;var s=n.join("\n").length;return e-s},r.getLineNumber=function(t,e){return r.isEmpty(t)?-1:(e=e||t.length,t.substring(0,e).split("\n").length)},r.indexOfNonWhitespace=function(t,e,n){if(r.isEmpty(t))return-1;e=e||0,n=n||t.length;for(var s=e;n>s;s++)if(-1==r.WHITESPACE.indexOf(t.charAt(s)))return s;return-1},r.indexOfWhitespace=function(t,e,n){if(r.isEmpty(t))return-1;e=e||0,n=n||t.length;for(var s=e;n>s;s++)if(-1!=r.WHITESPACE.indexOf(t.charAt(s)))return s;return-1},r.isEmpty=function(t){return null==t||0==t.length},r.lastIndexOfNonWhitespace=function(t,e,n){if(r.isEmpty(t))return-1;e=e||0,n=n||t.length;for(var s=n-1;s>=e;s--)if(-1==r.WHITESPACE.indexOf(t.charAt(s)))return s;return-1},r.replace=function(t,e,n,s,i){return r.isEmpty(t)?"":(e=e||0,n=n||t.length,t.toString().substring(e,n).split(s).join(i))};var o=function(){this.m_arr=new Array};o.prototype.clear=function(){this.m_arr=new Array},o.prototype.count=function(){return this.m_arr.length},o.prototype.destroy=function(){this.m_arr=null},o.prototype.peek=function(){return 0==this.m_arr.length?null:this.m_arr[this.m_arr.length-1]},o.prototype.pop=function(){if(0==this.m_arr.length)return null;var t=this.m_arr[this.m_arr.length-1];return this.m_arr.length--,t},o.prototype.push=function(t){this.m_arr[this.m_arr.length]=t},n.SaxParser=i,n.xmlToObj=function(t){function e(t,e,n,s){return{tagPrefix:t,tag:e,text:null,cdata:null,children:[],attrs:n,namespaces:s}}var n,s,r=[],o=new i(function(t){t.onStartDocument(function(){}),t.onEndDocument(function(){}),t.onStartElementNS(function(t,s,i,o,a){node=e(i,t,s.reduce(function(t,e){return t[e[0]]=e[1],t},{}),a),0==r.length?n=node:r[r.length-1].children.push(node),r.push(node)}),t.onEndElementNS(function(){r.pop()}),t.onCharacters(function(t){r[r.length-1].text=t}),t.onCdata(function(t){r[r.length-1].cdata=t}),t.onComment(function(){}),t.onWarning(function(){}),t.onError(function(t){s=new Error(t)})});if(o.parseString(t),s)throw s;return n}}(),t["node-xml/lib/node-xml.js"].status="loaded"}.bind(this)},t["tinysoap/lib/wsdl.js"]={status:null,module:{exports:{}},loader:function(){function e(t){var e=null!=t?t.indexOf(":"):-1;return 0>e?{namespace:null,name:t}:{namespace:t.substring(0,e),name:t.substring(e+1)}}function n(t){return"string"==typeof t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):t}function s(t){return t.replace(f,"").replace(y,"")}function i(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function r(t,e){for(var n in t)if(t[n]===e)return n}function o(t){var t=t.split(" "),e={};return t.forEach(function(t){e[t.replace(/^_/,"")]=(D[t]||[E])[0]}),e}function a(t,e,n){"function"==typeof e&&(n=e,e={});var s;return h.request(t,null,function(i,r,o){i?n(i):r&&200==r.statusCode?(s=new k(o,t,e),s.onReady(n)):n(new Error("Invalid WSDL URL: "+t))}),s}var u=t["tinysoap/lib/wsdl.js"].module,p=u.exports,l=function(e){var n={"node-xml":"node-xml/lib/node-xml.js","./http":"tinysoap/lib/http.js","./url":"tinysoap/lib/url.js","./assert":"tinysoap/lib/assert.js"},s=n[e];return s?t.__require(s):t.__builtin_require(e)};t.__builtin_require&&(l.resolve=t.__builtin_require.resolve),t["tinysoap/lib/wsdl.js"].status="loading";var c=l("node-xml"),h=l("./http"),m=l("./url"),_=l("./assert"),d={string:1,"boolean":1,decimal:1,"float":1,"double":1,anyType:1,"byte":1,"int":1,"long":1,"short":1,unsignedByte:1,unsignedInt:1,unsignedLong:1,unsignedShort:1,duration:0,dateTime:0,time:0,date:0,gYearMonth:0,gYear:0,gMonthDay:0,gDay:0,gMonth:0,hexBinary:0,base64Binary:0,anyURI:0,QName:0,NOTATION:0},f=/^[\s\xA0]+/,y=/[\s\xA0]+$/,E=function(t,n){var s=e(t);this.nsName=t,this.namespace=s.namespace,this.name=s.name,this.children=[],this.xmlns={};for(var i in n){var r=/^xmlns:?(.*)$/.exec(i);r?this.xmlns[r[1]]=n[i]:this["$"+i]=n[i]}};E.prototype.deleteFixedAttrs=function(){this.children&&0===this.children.length&&delete this.children,this.xmlns&&0===Object.keys(this.xmlns).length&&delete this.xmlns,delete this.nsName,delete this.namespace,delete this.name},E.prototype.allowedChildren=[],E.prototype.startElement=function(t,n,s){if(this.allowedChildren){var i=this.allowedChildren[e(n).name];i?t.push(new i(n,s)):this.unexpected(n)}},E.prototype.endElement=function(t,e){if(this.nsName===e){if(t.length<2)return;var n=t[t.length-2];this!==t[0]&&(i(t[0].xmlns,this.xmlns),n.children.push(this),n.addChild(this)),t.pop()}},E.prototype.addChild=function(){},E.prototype.unexpected=function(t){throw new Error("Found unexpected element ("+t+") inside "+this.nsName)
},E.prototype.description=function(){return this.$name||this.name},E.prototype.init=function(){},E.createSubClass=function(){var t=this,e=function(){t.apply(this,arguments),this.init()};return e.prototype.__proto__=t.prototype,e};var g=E.createSubClass(),b=E.createSubClass(),x=E.createSubClass(),v=E.createSubClass(),T=E.createSubClass(),C=E.createSubClass(),A=E.createSubClass(),S=E.createSubClass(),R=E.createSubClass(),N=E.createSubClass(),w=E.createSubClass(),O=E.createSubClass(),j=E.createSubClass(),L=E.createSubClass(),P=E.createSubClass(),M=E.createSubClass(),I=E.createSubClass(),q=E.createSubClass(),D={types:[O,"schema"],schema:[w,"element complexType simpleType include import"],element:[g,"annotation complexType"],simpleType:[v,"restriction"],restriction:[T,"enumeration"],enumeration:[C,""],complexType:[A,"annotation sequence all"],sequence:[S,"element"],all:[R,"element"],service:[I,"port documentation"],port:[M,"address"],binding:[P,"_binding SecuritySpec operation"],portType:[L,"operation"],message:[N,"part documentation"],operation:[j,"documentation input output fault _operation"],input:[b,"body SecuritySpecRef documentation header"],output:[x,"body SecuritySpecRef documentation header"],fault:[E,"_fault"],definitions:[q,"types message portType binding service"]};for(var $ in D){var U=D[$];U[0].prototype.allowedChildren=o(U[1])}N.prototype.init=function(){this.element=null,this.parts=null},w.prototype.init=function(){this.complexTypes={},this.types={},this.elements={},this.includes=[]},O.prototype.init=function(){this.schemas={}},j.prototype.init=function(){this.input=null,this.output=null,this.inputSoap=null,this.outputSoap=null,this.style="",this.soapAction=""},L.prototype.init=function(){this.methods={}},P.prototype.init=function(){this.transport="",this.style="",this.methods={}},M.prototype.init=function(){this.location=null},I.prototype.init=function(){this.ports={}},q.prototype.init=function(){"definitions"!==this.name&&this.unexpected(nsName),this.messages={},this.portTypes={},this.bindings={},this.services={},this.schemas={}},w.prototype.addChild=function(t){if(!(t.$name in d)){if("include"===t.name||"import"===t.name){var e=t.$schemaLocation||t.$location;e&&this.includes.push({namespace:t.$namespace||t.$targetNamespace||this.$targetNamespace,location:e})}else"complexType"===t.name?this.complexTypes[t.$name]=t:"element"===t.name?this.elements[t.$name]=t:t.$name&&(this.types[t.$name]=t);this.children.pop()}},O.prototype.addChild=function(t){_(t instanceof w),t.$targetNamespace?this.schemas[t.$targetNamespace]=t:this.schemas[t.includes[0].namespace]=t},b.prototype.addChild=function(t){"body"===t.name&&(this.use=t.$use,"encoded"===this.use&&(this.encodingStyle=t.$encodingStyle),this.children.pop())},x.prototype.addChild=function(t){"body"===t.name&&(this.use=t.$use,"encoded"===this.use&&(this.encodingStyle=t.$encodingStyle),this.children.pop())},j.prototype.addChild=function(t){"operation"===t.name&&(this.soapAction=t.$soapAction||"",this.style=t.$style||"",this.children.pop())},P.prototype.addChild=function(t){"binding"===t.name&&(this.transport=t.$transport,this.style=t.$style,this.children.pop())},M.prototype.addChild=function(t){"address"===t.name&&"undefined"!=typeof t.$location&&(this.location=t.$location)},q.prototype.addChild=function(t){var e=this;t instanceof O?e.schemas=t.schemas:t instanceof N?e.messages[t.$name]=t:t instanceof L?e.portTypes[t.$name]=t:t instanceof P?("http://schemas.xmlsoap.org/soap/http"===t.transport||"http://www.w3.org/2003/05/soap/bindings/HTTP/"===t.transport)&&(e.bindings[t.$name]=t):t instanceof I?e.services[t.$name]=t:_(!1,"Invalid child type"),this.children.pop()},N.prototype.postProcess=function(t){var n,s=null,i=this.children||[];for(var r in i)if("part"===(n=i[r]).name){s=n;break}if(s){if(s.$element){delete this.parts;var o=e(s.$element),a=o.namespace;this.element=t.schemas[t.xmlns[a]].elements[o.name],this.element.targetNSAlias=a,this.element.targetNamespace=t.xmlns[a],this.children.splice(0,1)}else{this.parts={},delete this.element;for(var s,r=0;s=this.children[r];r++){_("part"===s.name,"Expected part element");var o=e(s.$type),a=t.xmlns[o.namespace],u=o.name,p=t.schemas[a];this.parts[s.$name]="undefined"!=typeof p?t.schemas[a].types[u]||t.schemas[a].complexTypes[u]:s.$type,this.parts[s.$name].namespace=o.namespace,this.parts[s.$name].xmlns=a,this.children.splice(r--,1)}}this.deleteFixedAttrs()}},j.prototype.postProcess=function(t,n){for(var s,i=this.children,r=0;s=i[r];r++)if("input"===s.name||"output"===s.name)if("binding"!==n){var o=e(s.$message).name,a=t.messages[o];a.postProcess(t),a.element?(t.messages[a.element.$name]=a,this[s.name]=a.element):this[s.name]=a,i.splice(r--,1)}else this[s.name]=s,i.splice(r--,1);this.deleteFixedAttrs()},L.prototype.postProcess=function(t){var e=this.children;if("undefined"!=typeof e){for(var n,s=0;n=e[s];s++)"operation"==n.name&&(n.postProcess(t,"portType"),this.methods[n.$name]=n,e.splice(s--,1));delete this.$name,this.deleteFixedAttrs()}},P.prototype.postProcess=function(t){var n=e(this.$type).name,s=t.portTypes[n],i=this.style,r=this.children;s.postProcess(t),this.methods=s.methods;for(var o,a=0;o=r[a];a++)if("operation"==o.name){o.postProcess(t,"binding"),r.splice(a--,1),o.style||(o.style=i);var u=this.methods[o.$name];u.style=o.style,u.soapAction=o.soapAction,u.inputSoap=o.input||null,u.outputSoap=o.output||null,u.inputSoap&&u.inputSoap.deleteFixedAttrs(),u.outputSoap&&u.outputSoap.deleteFixedAttrs()}delete this.$name,delete this.$type,this.deleteFixedAttrs()},I.prototype.postProcess=function(t){for(var n,s=this.children,i=t.bindings,r=0;n=s[r];r++)if("port"==n.name){var o=e(n.$binding).name,a=i[o];a&&(a.postProcess(t),this.ports[n.$name]={location:n.location,binding:a},s.splice(r--,1))}delete this.$name,this.deleteFixedAttrs()},v.prototype.description=function(){for(var t,e=this.children,n=0;t=e[n];n++)if(t instanceof T)return this.$name+"|"+t.description();return{}},T.prototype.description=function(){var t=this.$base?this.$base+"|":"";return t+this.children.map(function(t){return t.description()}).join(",")},C.prototype.description=function(){return this.$value},A.prototype.description=function(t){for(var e,n=this.children,s=0;e=n[s];s++)if(e instanceof S||e instanceof R)return e.description(t);return{}},g.prototype.description=function(t){var n,s={},i=this.$name;if(this.$minOccurs!==this.$maxOccurs&&(i+="[]"),this.$type){var r=e(this.$type).name,o=t.xmlns[e(this.$type).namespace],n=t.schemas[o],a=n&&(n.complexTypes[r]||n.types[r]);s[i]=!a||r in d?this.$type:a.description(t)}else{var u=this.children;s[i]={};for(var p,l=0;p=u[l];l++)p instanceof A&&(s[i]=p.description(t))}return s},R.prototype.description=S.prototype.description=function(t){for(var e,n=this.children,s={},i=0;e=n[i];i++){var r=e.description(t);for(var o in r)s[o]=r[o]}return s},N.prototype.description=function(t){if(this.element)return this.element&&this.element.description(t);var e={};return e[this.$name]=this.parts,e},L.prototype.description=function(t){var e={};for(var n in this.methods){var s=this.methods[n];e[n]=s.description(t)}return e},j.prototype.description=function(t){var e=this.input.description(t),n=this.output.description(t);return{input:e&&e[Object.keys(e)[0]],output:n&&n[Object.keys(n)[0]]}},P.prototype.description=function(t){var e={};for(var n in this.methods){var s=this.methods[n];e[n]=s.description(t)}return e},I.prototype.description=function(t){var e={};for(var n in this.ports){var s=this.ports[n];e[n]=s.binding.description(t)}return e};var k=function(t,e,n){var s,i=this;if(this.uri=e,this.callback=function(){},this.options=n||{},"string"==typeof t)s=this._fromXML;else{if("object"!=typeof t)throw new Error("WSDL constructor takes either an XML string or service definition");s=this._fromServices}setTimeout(function(){s.call(i,t),i.processIncludes(function(t){i.definitions.deleteFixedAttrs();var e=i.services=i.definitions.services;if(e)for(var n in e)e[n].postProcess(i.definitions);var s=i.definitions.complexTypes;if(s)for(var n in s)s[n].deleteFixedAttrs();var r=i.definitions.bindings;for(var o in r){var a=r[o];if("document"===a.style){var u=a.methods,p=a.topElements={};for(var l in u){var c=u[l].input.$name,h=u[l].output.$name;p[c]={methodName:l,outputName:h}}}}i.xmlnsInEnvelope=i._xmlnsMap(),i.callback(t,i)})},0)};k.prototype.onReady=function(t){t&&(this.callback=t)},k.prototype._processNextInclude=function(t,e){var n=this,s=t.shift();return s?void a(m.resolve(n.uri,s.location),function(i,r){n.definitions.schemas[s.namespace||r.definitions.$targetNamespace]=r.definitions,n._processNextInclude(t,function(t){e(t)})}):e()},k.prototype.processIncludes=function(t){var e=this.definitions.schemas,n=[];for(var s in e){var i=e[s];n=n.concat(i.includes||[])}this._processNextInclude(n,t)},k.prototype.describeServices=function(){var t={};for(var e in this.services){var n=this.services[e];t[e]=n.description(this.definitions)}return t},k.prototype.toXML=function(){return this.xml||""},k.prototype.xmlToObject=function(t){var n,i,r=this,o=new c.SaxParser(function(t){n=t}),a=null,u={},p={Envelope:{Header:{Security:{UsernameToken:{Username:"string",Password:"string"}}},Body:{Fault:{faultcode:"string",faultstring:"string",detail:"string"}}}},l=[{name:null,object:u,schema:p}],h={};n.onStartElementNS(function(t,n,s,o,u){t=s?s+":"+t:t;n=n.reduce(function(t,e){return t[e[0]]=e[1],t},{}),u.forEach(function(t){var e=t[0],s=t[1];n["xmlns"+(e?":":"")+e]=s});var p=e(t).name,c=l[l.length-1],m=c.schema,_={},d=p;if(!a&&"Body"===c.name&&"Fault"!==p){var f=r.definitions.messages[p];if(!f){var y=!1,E=!1;/Response$/.test(p)?(E=!0,p=p.replace(/Response$/,"")):/Request$/.test(p)?(y=!0,p=p.replace(/Request$/,"")):/Solicit$/.test(p)&&(y=!0,p=p.replace(/Solicit$/,""));var g=r.definitions.portTypes,b=Object.keys(g),x=g[b[0]];p=y?x.methods[p].input.$name:x.methods[p].output.$name,f=r.definitions.messages[p],r.definitions.messages[d]=r.definitions.messages[p]}m=f.description(r.definitions),a=d}n.href&&(i=n.href.substr(1),h[i]||(h[i]={hrefs:[],obj:null}),h[i].hrefs.push({par:c.object,key:p})),(i=n.id)&&(h[i]||(h[i]={hrefs:[],obj:null})),m&&m[p+"[]"]&&(p+="[]"),l.push({name:d,object:_,schema:m&&m[p],id:n.id})}),n.onEndElementNS(function(t,n){t=n?n+":"+t:t;var s=l.pop(),i=s.object,r=l[l.length-1],o=r.object,a=r.schema,u=e(t).name;a&&a[u+"[]"]?(o[u]||(o[u]=[]),o[u].push(i)):u in o?(Array.isArray(o[u])||(o[u]=[o[u]]),o[u].push(i)):o[u]=i,s.id&&(h[s.id].obj=i)}),n.onCharacters(function(t){if(t=s(t),t.length){var n,i=l[l.length-1],r=e(i.schema).name;n="int"===r?parseInt(t,10):"dateTime"===r?new Date(t):"string"!=typeof i.object?t:i.object+t,i.object=n}}),o.parseString(t);for(var m in h){var _=h[m],d=_.obj;_.hrefs.forEach(function(t){t.par[t.key]=d})}var f=u.Envelope.Body;return f.Fault,u.Envelope},k.prototype.objectToDocumentXML=function(t,e,n,s){var i={};return i[t]=e,this.objectToXML(i,null,n,s)},k.prototype.objectToRpcXML=function(t,e,s,i){var o=[],a=this.definitions,s=s||r(a.xmlns,i),i=i||a.xmlns[s],u="_xmlns";o.push(["<",s,":",t,">"].join(""));for(var p in e)if(p!=u){var l=e[p];o.push(["<",p,">"].join("")),o.push("object"==typeof l?this.objectToXML(l):n(l)),o.push(["</",p,">"].join(""))}return o.push(["</",s,":",t,">"].join("")),o.join("")},k.prototype.objectToXML=function(t,e,s,i){var r=this,o=[],a="",u=s?s+":":"";if(Array.isArray(t))for(var p,l=0;p=t[l];l++)l>0&&(o.push(["</",u,e,">"].join("")),o.push(["<",u,e,a,">"].join(""))),o.push(r.objectToXML(p,e));else if("object"==typeof t)for(var e in t){var c=t[e];o.push(["<",u,e,a,">"].join("")),o.push(r.objectToXML(c,e)),o.push(["</",u,e,">"].join(""))}else t&&o.push(n(t));return o.join("")},k.prototype._parse=function(t){var n,s=this,i=new c.SaxParser(function(t){n=t}),r=[],o=null;return n.onStartElementNS(function(t,n,i,a,u){t=i?i+":"+t:t;n=n.reduce(function(t,e){return t[e[0]]=e[1],t},{}),u.forEach(function(t){var e=t[0],s=t[1];n["xmlns"+(e?":":"")+e]=s});var p=r[r.length-1];if(p)try{p.startElement(r,t,n)}catch(l){if(s.options.strict)throw l;r.push(new E(t,n))}else{var c=e(t).name;if("definitions"===c)o=new q(t,n);else{if("schema"!==c)throw new Error("Unexpected root element of WSDL or include");o=new w(t,n)}r.push(o)}}),n.onEndElementNS(function(t,e){t=e?e+":"+t:t;var n=r[r.length-1];_(n,"Unmatched close tag: "+t),n.endElement(r,t)}),n.onWarning(function(t){console.log("<WARNING>"+t+"</WARNING>")}),n.onError(function(t){console.log("<ERROR>"+JSON.stringify(t)+"</ERROR>")}),i.parseString(t),o},k.prototype._fromXML=function(t){this.definitions=this._parse(t),this.xml=t},k.prototype._fromServices=function(){},k.prototype._xmlnsMap=function(){var t=this.definitions.xmlns,e="";for(var n in t)if(""!==n){var s=t[n];switch(s){case"http://xml.apache.org/xml-soap":case"http://schemas.xmlsoap.org/wsdl/":case"http://schemas.xmlsoap.org/wsdl/soap/":case"http://schemas.xmlsoap.org/soap/encoding/":case"http://www.w3.org/2001/XMLSchema":continue}~s.indexOf("http://schemas.xmlsoap.org/")||~s.indexOf("http://www.w3.org/")||~s.indexOf("http://xml.apache.org/")||(e+=" xmlns:"+n+'="'+s+'"')}return e},p.open_wsdl=a,p.WSDL=k,t["tinysoap/lib/wsdl.js"].status="loaded"}.bind(this)},t["tinysoap/lib/soap.js"]={status:null,module:{exports:{}},loader:function(){function e(t,e,n){"function"==typeof e&&(n=e,e={});var s=h[t];s?n(null,s):p(t,e,function(e,s){return e?n(e):(h[t]=s,void n(null,s))})}function n(t,n,s,i){"function"==typeof n&&(i=s,s=n,n={}),i=n.endpoint||i,e(t,n,function(t,e){s(t,e&&new u(e,i))})}function s(t,e){this._username=t,this._password=e}function i(t,e,n){this._username=t,this._password=e,this._passwordType=n||"PasswordText"}var r=t["tinysoap/lib/soap.js"].module,o=r.exports,a=function(e){var n={"./client":"tinysoap/lib/client.js","./wsdl":"tinysoap/lib/wsdl.js",crypto:"crypto","./wsdl":"tinysoap/lib/wsdl.js"},s=n[e];return s?t.__require(s):t.__builtin_require(e)};t.__builtin_require&&(a.resolve=t.__builtin_require.resolve),t["tinysoap/lib/soap.js"].status="loading";var u=a("./client").Client,p=a("./wsdl").open_wsdl,l=a("crypto"),c=a("./wsdl").WSDL,h={};s.prototype.addHeaders=function(t){t.Authorization="Basic "+new Buffer(this._username+":"+this._password||"").toString("base64")},s.prototype.toXML=function(){return""};var m=function(t,e,n){var s=l.createHash("sha1"),i=new Buffer(t||"","base64").toString("binary");s.update(i+e+n);var r=s.digest("base64");return r};i.prototype.toXML=function(){function t(t){function e(t){return 10>t?"0"+t:t}return t.getUTCFullYear()+"-"+e(t.getUTCMonth()+1)+"-"+e(t.getUTCDate())+"T"+e(t.getUTCHours())+":"+e(t.getUTCMinutes())+":"+e(t.getUTCSeconds())+"Z"}var e=new Date,n=t(e),s=t(new Date(e.getTime()+6e5)),i=l.createHash("sha1");i.update(n+Math.random());var r=i.digest("base64");return'<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><wsu:Timestamp wsu:Id="Timestamp-'+n+'"><wsu:Created>'+n+"</wsu:Created><wsu:Expires>"+s+'</wsu:Expires></wsu:Timestamp><wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="SecurityToken-'+n+'"><wsse:Username>'+this._username+"</wsse:Username>"+("PasswordText"===this._passwordType?"<wsse:Password>"+this._password+"</wsse:Password>":'<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">'+m(r,n,this._password)+"</wsse:Password>")+'<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">'+r+"</wsse:Nonce><wsu:Created>"+n+"</wsu:Created></wsse:UsernameToken></wsse:Security>"},o.BasicAuthSecurity=s,o.WSSecurity=i,o.createClient=n,o.passwordDigest=m,o.WSDL=c,t["tinysoap/lib/soap.js"].status="loaded"}.bind(this)},t["tinysoap/index.js"]={status:null,module:{"package":{name:"tinysoap",version:"1.0.1",description:"A minimal SOAP client in javascript, so tiny it even runs in browser",engines:{node:">=0.8.0"},author:"zed <[email protected]>",dependencies:{"node-xml":"1.0.2"},repository:{type:"git",url:"https://github.com/mhzed/tinysoap.git"},main:"./index.js",directories:{lib:"./lib"},scripts:{build:"bna -f index.js && uglifyjs index.fused.js -c -m > tinysoap-browser-min.js && rm index.fused.js"},keywords:["soap","browser","client"],licenses:[{type:"MIT License",url:"http://www.opensource.org/licenses/mit-license.php"}]},exports:{}},loader:function(){var e=t["tinysoap/index.js"].module,n=(e.exports,function(e){var n={"./lib/soap":"tinysoap/lib/soap.js"},s=n[e];return s?t.__require(s):t.__builtin_require(e)});t.__builtin_require&&(n.resolve=t.__builtin_require.resolve),t["tinysoap/index.js"].status="loading",e.exports=n("./lib/soap"),t["tinysoap/index.js"].status="loaded"}.bind(this)},t.__require("tinysoap/index.js")}.call(this),"undefined"!=typeof module&&(module.exports=this.tinysoap);