📄 webservice2.js
字号:
_p=_biExtend(BiSchemaStringPrimitiveType,BiSchemaPrimitiveType,"BiSchemaStringPrimitiveType");BiSchemaStringPrimitiveType.prototype.encodeJsValue=function(aValueToEncode)
{if(typeof(aValueToEncode)=="string"||typeof(aValueToEncode)=="number"||typeof(aValueToEncode)=="boolean")
{return aValueToEncode;}else if(typeof(aValueToEncode)=="object"&&("toString"in aValueToEncode))
{return aValueToEncode.toString();}else if(typeof(aValueToEncode)=="undefined")
{return"";}else {throw new BiSchemaError("Invalid primitive type value (type="+typeof(aValueToEncode)+")");}}
BiSchemaStringPrimitiveType.prototype.decodeJsValue=function(aValueToDecode)
{return aValueToDecode;}
function BiSchemaNumericPrimitiveType(aName)
{if(_biInPrototype)return;BiSchemaPrimitiveType.call(this,aName);}
_p=_biExtend(BiSchemaNumericPrimitiveType,BiSchemaPrimitiveType,"BiSchemaNumericPrimitiveType");BiSchemaNumericPrimitiveType.prototype.encodeJsValue=function(aValueToEncode)
{if(typeof(aValueToEncode)=="number")
{return aValueToEncode;}else {throw new BiSchemaError("Invalid primitive type value (type="+typeof(aValueToEncode)+")");}}
BiSchemaNumericPrimitiveType.prototype.decodeJsValue=function(aValueToDecode)
{return new Number(aValueToDecode).valueOf();}
function BiSchemaBooleanPrimitiveType(aName)
{if(_biInPrototype)return;BiSchemaPrimitiveType.call(this,aName);}
_p=_biExtend(BiSchemaBooleanPrimitiveType,BiSchemaPrimitiveType,"BiSchemaBooleanPrimitiveType");BiSchemaBooleanPrimitiveType.prototype.encodeJsValue=function(aValueToEncode)
{return aValueToEncode?"true":"false";}
BiSchemaBooleanPrimitiveType.prototype.decodeJsValue=function(aValueToDecode)
{return(aValueToDecode=="1")||(aValueToDecode=="true");}
function BiSchemaBase64PrimitiveType(aName)
{if(_biInPrototype)return;BiSchemaPrimitiveType.call(this,aName);}
_p=_biExtend(BiSchemaBase64PrimitiveType,BiSchemaPrimitiveType,"BiSchemaBase64PrimitiveType");BiSchemaBase64PrimitiveType._Base64Digits="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";BiSchemaBase64PrimitiveType.prototype.encodeJsValue=function(aVal)
{var lEncodingString;if(typeof(aVal)=="string")
{lEncodingString=true;}else if(aVal instanceof Array)
{lEncodingString=false;}else {throw new BiSchemaError("Invalid value for type "+this.getName());}
var lSrcIdx=0;var lFragments=new Array();var lCurTriplet=0;var lEncTriplet="";while(lSrcIdx<aVal.length-2)
{lCurTriplet=0;lEncTriplet="";for(var lIdx=0;lIdx<3;lIdx++)
{lCurTriplet|=(lEncodingString?aVal.charCodeAt(lSrcIdx+lIdx):aVal[lSrcIdx+lIdx])<<(16-8*lIdx);}
for(var lIdx2=0;lIdx2<4;lIdx2++)
{lEncTriplet=lEncTriplet+BiSchemaBase64PrimitiveType._Base64Digits.charAt((lCurTriplet>>>(18-lIdx2*6))&0x3F);}
lFragments.push(lEncTriplet);lSrcIdx+=3;}
var lTripletSize=aVal.length-lSrcIdx;if(lTripletSize)
{lCurTriplet=0;lEncTriplet="";for(var lIdx=0;lIdx<lTripletSize;lIdx++)
{lCurTriplet|=(lEncodingString?aVal.charCodeAt(lSrcIdx+lIdx):aVal[lSrcIdx+lIdx])<<(16-8*lIdx);}
for(var lIdx2=0;lIdx2<lTripletSize+1;lIdx2++)
{lEncTriplet=lEncTriplet+BiSchemaBase64PrimitiveType._Base64Digits.charAt((lCurTriplet>>>(18-lIdx2*6))&0x3F);}
lEncTriplet=lEncTriplet+((lTripletSize==1)?"==":"=");lFragments.push(lEncTriplet);}
return lFragments.join("");}
BiSchemaBase64PrimitiveType.prototype.decodeJsValue=function(aVal)
{var lRes=new Array();var lSrcIdx=0;var lDestIdx=0;var lFragments=new Array();var lCurQuartet=0;var lEncTriplet="";var lLen=aVal.indexOf("=");if(lLen<0)
{lLen=aVal.length;}
while(lSrcIdx<lLen)
{lCurQuartet=lCurQuartet<<6;lCurQuartet|=BiSchemaBase64PrimitiveType._Base64Digits.indexOf(aVal.charAt(lSrcIdx));if((lSrcIdx&0x03)==0x03)
{lRes[lDestIdx]=(lCurQuartet>>>16)&0xFF;lRes[lDestIdx+1]=(lCurQuartet>>>8)&0xFF;lRes[lDestIdx+2]=(lCurQuartet)&0xFF;lCurQuartet=0;lDestIdx+=3;}
lSrcIdx++;}
if((lSrcIdx&0x03)==2)
{lRes[lDestIdx]=(lCurQuartet>>>4)&0xFF;}else if((lSrcIdx&0x03)==0x03)
{lRes[lDestIdx]=(lCurQuartet>>>10)&0xFF;lRes[lDestIdx+1]=(lCurQuartet>>>2)&0xFF;}
return lRes;}
function BiSchemaHexPrimitiveType(aName)
{if(_biInPrototype)return;BiSchemaPrimitiveType.call(this,aName);}
_p=_biExtend(BiSchemaHexPrimitiveType,BiSchemaPrimitiveType,"BiSchemaHexPrimitiveType");BiSchemaHexPrimitiveType._HexDigits="0123456789ABCDEF";BiSchemaHexPrimitiveType.prototype.encodeJsValue=function(aVal)
{var lEncodingString;if(typeof(aVal)=="string")
{lEncodingString=true;}else if(aVal instanceof Array)
{lEncodingString=false;}else {throw BiSchemaError("Invalid value for type "+this.getName());}
var lResFrags=Array();var lBt;for(var lIdx=0;lIdx<aVal.length;lIdx++)
{lBt=lEncodingString?aVal.charCodeAt(lIdx):aVal[lIdx];lResFrags.push(BiSchemaHexPrimitiveType._HexDigits.charAt((lBt>>4)&0xF)+BiSchemaHexPrimitiveType._HexDigits.charAt(lBt&0xF));}
return lResFrags.join("");}
BiSchemaHexPrimitiveType.prototype.decodeJsValue=function(aVal)
{var lRes=new Array();if(aVal.length%2)
{throw new BiSchemaError("Invalid hex string length.");}
for(var lIdx=0;lIdx<aVal.length;lIdx+=2)
{lRes.push(BiSchemaHexPrimitiveType._HexDigits.indexOf(aVal.charAt(lIdx).toUpperCase())*16+BiSchemaHexPrimitiveType._HexDigits.indexOf(aVal.charAt(lIdx+1).toUpperCase()));}
return lRes;}
function BiSchemaDateTimePrimitiveType(aName,aDate,aTime)
{if(_biInPrototype)return;BiSchemaPrimitiveType.call(this,aName);this._date=aDate;this._time=aTime;}
_p=_biExtend(BiSchemaDateTimePrimitiveType,BiSchemaPrimitiveType,"BiSchemaDateTimePrimitiveType");BiSchemaDateTimePrimitiveType.prototype._padToTwo=function(aVal)
{return(aVal<10)?("0"+aVal):aVal;}
BiSchemaDateTimePrimitiveType.prototype.encodeJsValue=function(aVal)
{var lRes="";if(this._date)
{lRes=lRes+aVal.getFullYear()+"-"+this._padToTwo(aVal.getMonth()+1)+"-"+this._padToTwo(aVal.getDate());}
if(this._date&&this._time)
{lRes=lRes+"T";}
if(this._time)
{lRes=lRes+this._padToTwo(aVal.getHours())+":"+this._padToTwo(aVal.getMinutes())+":"
+this._padToTwo(aVal.getSeconds())+(aVal.getMilliseconds()?('.'+aVal.getMilliseconds()):"");}
var lTz=aVal.getTimezoneOffset();if(lTz<0)
{lRes=lRes+'+';lTz=lTz*-1;}else {lRes=lRes+'-';}
lRes=lRes+this._padToTwo(new Number(lTz/60))+':'+this._padToTwo(lTz%60);return lRes;}
BiSchemaDateTimePrimitiveType.prototype.decodeJsValue=function(aVal)
{var lRes=new Date();var lDateTimeTz=[];if(this._time&&this._date)
{var lTmp= /^([^T]*)T([^Z+\-]*)([Z+\-].*)?$/.exec(aVal);if(!lTmp)
{throw new BiSchemaError("Invalid value for type "+this.getName()+": "+aVal);}
lDateTimeTz[0]=lTmp[1];lDateTimeTz[1]=lTmp[2];lDateTimeTz[2]=lTmp[3];}else if(this._time)
{var lTmp= /^([0-9+\-][^Z+\-]*)([Z+\-].*)?$/.exec(aVal);if(!lTmp)
{throw new BiSchemaError("Invalid value for type "+this.getName()+": "+aVal);}
lDateTimeTz[1]=lTmp[1];lDateTimeTz[2]=lTmp[2];}else if(this._date)
{var lTmp= /^(([+\-]?[0-9]+)-([0-9]+)-([0-9]+))([Z+\-].*)?$/.exec(aVal);if(!lTmp)
{throw new BiSchemaError("Invalid value for type "+this.getName()+": "+aVal);}
lDateTimeTz[0]=lTmp[1];lDateTimeTz[2]=lTmp[5];}
if(this._date)
{var lDateParts= /^([+\-]?[0-9]+)-([0-9]+)-([0-9]+)$/.exec(lDateTimeTz[0]);if(!lDateParts)
{throw new BiSchemaError("Invalid date format: "+lDateTimeTz[0]);}
lRes.setYear(lDateParts[1]);lRes.setMonth(new Number(lDateParts[2]).valueOf()-1);lRes.setDate(lDateParts[3]);}
if(this._time)
{var lTimeParts=lDateTimeTz[1].split(':');if(lTimeParts.length!=3)
return;lRes.setHours(lTimeParts[0]);lRes.setMinutes(lTimeParts[1]);var lSecParts=lTimeParts[2].split('.');lRes.setSeconds(lSecParts[0]);if(lSecParts[1])
{lRes.setMilliseconds(lSecParts[1].substring(0,3));}}
if(lDateTimeTz[2])
{var lTzOfs=0;if(lDateTimeTz[2]!='Z')
{var lTzComps= /([+-])?([0-9]*)(:([0-9]*))?/.exec(lDateTimeTz[2]);if(!lTzComps)
{throw new BiSchemaError("Error in timezone component: "+lDateTimeTz);}
lTzOfs= -1*(lTzComps[2]*60+(lTzComps[4]?lTzComps[4]*1:0))*(lTzComps[1]=='-'?-1:1);}
var lCurTz=lRes.getTimezoneOffset();lRes.setTime(lRes.getTime()+(lTzOfs-lCurTz)*60000);}
return lRes;}
BiSchemaPrimitiveType.PRIMITIVE_TYPES={"[http://www.w3.org/2001/XMLSchema]float":new BiSchemaNumericPrimitiveType("[http://www.w3.org/2001/XMLSchema]float"),"[http://www.w3.org/2001/XMLSchema]double":new BiSchemaNumericPrimitiveType("[http://www.w3.org/2001/XMLSchema]double"),"[http://www.w3.org/2001/XMLSchema]decimal":new BiSchemaNumericPrimitiveType("[http://www.w3.org/2001/XMLSchema]decimal"),"[http://www.w3.org/2001/XMLSchema]integer":new BiSchemaNumericPrimitiveType("[http://www.w3.org/2001/XMLSchema]integer"),"[http://www.w3.org/2001/XMLSchema]nonPositiveInteger":new BiSchemaNumericPrimitiveType("[http://www.w3.org/2001/XMLSchema]nonPositiveInteger"),"[http://www.w3.org/2001/XMLSchema]negativeInteger":new BiSchemaNumericPrimitiveType("[http://www.w3.org/2001/XMLSchema]negativeInteger"),"[http://www.w3.org/2001/XMLSchema]long":new BiSchemaNumericPrimitiveType("[http://www.w3.org/2001/XMLSchema]long"),"[http://www.w3.org/2001/XMLSchema]int":new BiSchemaNumericPrimitiveType("[http://www.w3.org/2001/XMLSchema]int"),"[http://www.w3.org/2001/XMLSchema]short":new BiSchemaNumericPrimitiveType("[http://www.w3.org/2001/XMLSchema]short"),"[http://www.w3.org/2001/XMLSchema]byte":new BiSchemaNumericPrimitiveType("[http://www.w3.org/2001/XMLSchema]byte"),"[http://www.w3.org/2001/XMLSchema]nonNegativeInteger":new BiSchemaNumericPrimitiveType("[http://www.w3.org/2001/XMLSchema]nonNegativeInteger"),"[http://www.w3.org/2001/XMLSchema]unsignedLong":new BiSchemaNumericPrimitiveType("[http://www.w3.org/2001/XMLSchema]unsignedLong"),"[http://www.w3.org/2001/XMLSchema]unsignedInt":new BiSchemaNumericPrimitiveType("[http://www.w3.org/2001/XMLSchema]unsignedInt"),"[http://www.w3.org/2001/XMLSchema]unsignedShort":new BiSchemaNumericPrimitiveType("[http://www.w3.org/2001/XMLSchema]unsignedShort"),"[http://www.w3.org/2001/XMLSchema]unsignedByte":new BiSchemaNumericPrimitiveType("[http://www.w3.org/2001/XMLSchema]unsignedByte"),"[http://www.w3.org/2001/XMLSchema]positiveInteger":new BiSchemaNumericPrimitiveType("[http://www.w3.org/2001/XMLSchema]positiveInteger"),"[http://www.w3.org/2001/XMLSchema]string":new BiSchemaStringPrimitiveType("[http://www.w3.org/2001/XMLSchema]string"),"[http://www.w3.org/2001/XMLSchema]anyURI":new BiSchemaStringPrimitiveType("[http://www.w3.org/2001/XMLSchema]anyURI"),"[http://www.w3.org/2001/XMLSchema]QName":new BiSchemaStringPrimitiveType("[http://www.w3.org/2001/XMLSchema]QName"),"[http://www.w3.org/2001/XMLSchema]NOTATION":new BiSchemaStringPrimitiveType("[http://www.w3.org/2001/XMLSchema]NOTATION"),"[http://www.w3.org/2001/XMLSchema]normalizedString":new BiSchemaStringPrimitiveType("[http://www.w3.org/2001/XMLSchema]normalizedString"),"[http://www.w3.org/2001/XMLSchema]token":new BiSchemaStringPrimitiveType("[http://www.w3.org/2001/XMLSchema]token"),"[http://www.w3.org/2001/XMLSchema]language":new BiSchemaStringPrimitiveType("[http://www.w3.org/2001/XMLSchema]language"),"[http://www.w3.org/2001/XMLSchema]IDREFS":new BiSchemaStringPrimitiveType("[http://www.w3.org/2001/XMLSchema]IDREFS"),"[http://www.w3.org/2001/XMLSchema]ENTITIES":new BiSchemaStringPrimitiveType("[http://www.w3.org/2001/XMLSchema]ENTITIES"),"[http://www.w3.org/2001/XMLSchema]NMTOKEN":new BiSchemaStringPrimitiveType("[http://www.w3.org/2001/XMLSchema]NMTOKEN"),"[http://www.w3.org/2001/XMLSchema]NMTOKENS":new BiSchemaStringPrimitiveType("[http://www.w3.org/2001/XMLSchema]NMTOKENS"),"[http://www.w3.org/2001/XMLSchema]Name":new BiSchemaStringPrimitiveType("[http://www.w3.org/2001/XMLSchema]Name"),"[http://www.w3.org/2001/XMLSchema]NCName":new BiSchemaStringPrimitiveType("[http://www.w3.org/2001/XMLSchema]NCName"),"[http://www.w3.org/2001/XMLSchema]ID":new BiSchemaStringPrimitiveType("[http://www.w3.org/2001/XMLSchema]ID"),"[http://www.w3.org/2001/XMLSchema]IDREF":new BiSchemaStringPrimitiveType("[http://www.w3.org/2001/XMLSchema]IDREF"),"[http://www.w3.org/2001/XMLSchema]ENTITY":new BiSchemaStringPrimitiveType("[http://www.w3.org/2001/XMLSchema]ENTITY"),"[http://www.w3.org/2001/XMLSchema]boolean":new BiSchemaBooleanPrimitiveType("[http://www.w3.org/2001/XMLSchema]boolean"),"[http://www.w3.org/2001/XMLSchema]base64Binary":new BiSchemaBase64PrimitiveType("[http://www.w3.org/2001/XMLSchema]base64Binary"),"[http://www.w3.org/2001/XMLSchema]hexBinary":new BiSchemaHexPrimitiveType("[http://www.w3.org/2001/XMLSchema]hexBinary"),"[http://www.w3.org/2001/XMLSchema]dateTime":new BiSchemaDateTimePrimitiveType("[http://www.w3.org/2001/XMLSchema]dateTime",true,true),"[http://www.w3.org/2001/XMLSchema]time":new BiSchemaDateTimePrimitiveType("[http://www.w3.org/2001/XMLSchema]time",false,true),"[http://www.w3.org/2001/XMLSchema]date":new BiSchemaDateTimePrimitiveType("[http://www.w3.org/2001/XMLSchema]date",true,false),"[http://www.w3.org/2001/XMLSchema]duration":new BiSchemaStringPrimitiveType("[http://www.w3.org/2001/XMLSchema]duration"),"[http://www.w3.org/2001/XMLSchema]gYearMonth":new BiSchemaStringPrimitiveType("[http://www.w3.org/2001/XMLSchema]gYearMonth"),"[http://www.w3.org/2001/XMLSchema]gYear":new BiSchemaStringPrimitiveType("[http://www.w3.org/2001/XMLSchema]gYear"),"[http://www.w3.org/2001/XMLSchema]gMonthDay":new BiSchemaStringPrimitiveType("[http://www.w3.org/2001/XMLSchema]gMonthDay"),"[http://www.w3.org/2001/XMLSchema]gDay":new BiSchemaStringPrimitiveType("[http://www.w3.org/2001/XMLSchema]gDay"),"[http://www.w3.org/2001/XMLSchema]gMonth":new BiSchemaStringPrimitiveType("[http://www.w3.org/2001/XMLSchema]gMonth")};BiSchemaPrimitiveType.PRIMITIVE_TYPES_COUNT=44;BiSchemaPrimitiveType.PRIMITIVE_TYPES_DEFINITIONS_DICTIONARY={"getCount":function()
{return BiSchemaPrimitiveType.PRIMITIVE_TYPES_COUNT;},"getKeys":function()
{var lRes=[];this._enumKeys(lRes);return lRes;},"getItem":function(aItemName)
{return BiSchemaPrimitiveType.PRIMITIVE_TYPES[aItemName];},"_enumKeys":function(aOut)
{for(var lIdx in BiSchemaPrimitiveType.PRIMITIVE_TYPES)
{aOut.push(lIdx);}}}
function BiSchemaWildcard(aSchema,aElement)
{if(_biInPrototype)return;var lNamespace=aElement.getAttribute("namespace");if(!lNamespace)
{lNamespace="##any";}
if(lNamespace=="##any")
{this._type="any";}else if(lNamespace=="##other")
{this._type="not";this._namespace=aSchema.getTargetNamespace();}else {var lNamespaces=lNamespace.split(" ");for(var lAnyNsIdx=0;lAnyNsIdx<lNamespaces.length;lAnyNsIdx++)
{if(lNamespaces[lAnyNsIdx]=="##targetNamespace")
{lNamespaces[lAnyNsIdx]=aSchema.getTargetNamespace();}else if(lNamespaces[lAnyNsIdx]=="##local")
{lNamespaces[lAnyNsIdx]="##local";}}
this._type="list";this._namespaces=lNamespaces;}}
_p=_biExtend(BiSchemaWildcard,Object,"BiSchemaWildcard");function BiSchemaParticle(aSchema,aNode)
{if(_biInPrototype)return;if(aNode.baseName=="element")
{if(aNode.getAttribute("ref"))
{this._term=aSchema.getElement(BiXmlDefinitionsDocument.expandQname(aNode.getAttribute("ref"),aNode));}else {this._term=new BiSchemaElement(aSchema,aNode,false);this._term.finishLoad();}}else if(aNode.baseName=="any")
{this._term=new BiSchemaWildcard(aSchema,aNode);}else if(aNode.baseName=="group")
{this._term=aSchema.getGroupDef(BiXmlDefinitionsDocument.expandQname(aNode.getAttribute("ref"),aNode)).getModelGroup();}else if(aNode.baseName=="all"||aNode.baseName=="sequence"||aNode.baseName=="choice")
{this._term=BiSchemaModelGroup.loadModelGroup(aSchema,aNode);}
this._minOc=aNode.getAttribute("minOccurs");this._maxOc=aNode.getAttribute("maxOccurs");if(this._maxOc==null)
{this._maxOc=1;}
if(this._minOc==null)
{this._minOc=1;}
if(this._maxOc=="unbounded")
{this._maxOc=null;}
this._optional=this._minOc==0;this._unbounded=this._maxOc==null;}
_p=_biExtend(BiSchemaParticle,Object,"BiSchemaParticle");BiSchemaParticle.prototype.getTerm=function()
{return this._term;}
BiSchemaParticle.prototype.getMinOccurs=function()
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -