Changeset 22

Show
Ignore:
Timestamp:
11/16/05 15:58:40 (3 years ago)
Author:
Jan-Klaas Kollhof
Message:

removed some problems with instanceof

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • jsolait/trunk/jsolait/lib/jsonrpc.js

    r17 r22  
    11/* 
    22  Copyright (c) 2005 Jan-Klaas Kollhof 
    3    
     3 
    44  This file is part of the JavaScript o lait library(jsolait). 
    5    
     5 
    66  jsolait is free software; you can redistribute it and/or modify 
    77  it under the terms of the GNU Lesser General Public License as published by 
    88  the Free Software Foundation; either version 2.1 of the License, or 
    99  (at your option) any later version. 
    10   
     10 
    1111  This software is distributed in the hope that it will be useful, 
    1212  but WITHOUT ANY WARRANTY; without even the implied warranty of 
    1313  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1414  GNU Lesser General Public License for more details. 
    15   
     15 
    1616  You should have received a copy of the GNU Lesser General Public License 
    1717  along with this software; if not, write to the Free Software 
     
    4343        publ.status; 
    4444    }); 
    45      
     45 
    4646    /** 
    4747        Thrown if an JSON-RPC response is not well formed. 
     
    7474        }; 
    7575    }); 
    76      
    77      
     76 
     77 
    7878    /** 
    7979        Marshalls an object to JSON.(Converts an object into JSON conforming source.) 
    8080        It just calls the toJSON function of the objcect. 
    81         So, to customize serialization of objects one just needs to specify/override the toXmlRpc method  
     81        So, to customize serialization of objects one just needs to specify/override the toXmlRpc method 
    8282        which should return an xml string conforming with XML-RPC spec. 
    8383        @param obj    The object to marshall 
     
    9999        } 
    100100    }; 
    101      
    102     /** 
    103         Unmarshalls a JSON source to a JavaScript object.  
     101 
     102    /** 
     103        Unmarshalls a JSON source to a JavaScript object. 
    104104        @param source    The source  to unmarshall. 
    105105        @return         The JavaScript object created. 
     
    119119        The return value of this call will be the return value of the RPC call. 
    120120        RPC-Errors will be raised as Exceptions. 
    121          
     121 
    122122        Asynchronous operation: 
    123         If the last parameter passed to the method is an JSONRPCAsyncCallback object,  
    124         then the remote method will be called asynchronously.  
     123        If the last parameter passed to the method is an JSONRPCAsyncCallback object, 
     124        then the remote method will be called asynchronously. 
    125125        The results and errors are passed to the callback. 
    126126    */ 
    127127    mod.JSONRPCMethod =Class(function(publ){ 
    128          
     128 
    129129        var postData = function(url, user, pass, data, callback){ 
    130130            if(callback == null){//todo ===undefined 
     
    135135            } 
    136136        }; 
    137          
     137 
    138138        var handleResponse=function(resp){ 
    139139            var status=null; 
     
    143143            } 
    144144            if(status == 200){ 
    145                 var respTxt = "";  
    146                 try{                  
     145                var respTxt = ""; 
     146                try{ 
    147147                    respTxt=resp.responseText; 
    148148                }catch(e){ 
     
    162162            } 
    163163        }; 
    164          
     164 
    165165        var jsonRequest = function(id, methodName, args){ 
    166166            var p = [mod.marshall(id), mod.marshall(methodName), mod.marshall(args)]; 
     
    180180            this.password=pass; 
    181181        }; 
    182           
     182 
    183183        publ.__call__=function(){ 
    184184            var args=new Array(); 
     
    187187            } 
    188188            //sync or async call 
    189             if(!(arguments[arguments.length-1] instanceof Function)){ 
     189            if(typeof arguments[arguments.length-1] !='function'){ 
    190190                var data=jsonRequest("httpReq", this.methodName, args); 
    191191                var resp = postData(this.url, this.user, this.password, data); 
     
    220220            this.password = pass; 
    221221        }; 
    222          
    223         /**  
     222 
     223        /** 
    224224            Sends the call as a notification which does not have a response. 
    225225            Call this as if you would call the method itself. Callbacks are ignored. 
     
    233233            postData(this.url, this.user, this.password, data, function(resp){}); 
    234234        }; 
    235          
     235 
    236236        ///The name of the remote method. 
    237237        publ.methodName; 
     
    243243        publ.password; 
    244244    }); 
    245      
     245 
    246246    /** 
    247247        Creates proxy objects which resemble the remote service. 
     
    255255            ServerProxy("url", ["methodName1",...], "user", "pass") 
    256256            ServerProxy("url", "user", "pass") 
    257              
     257 
    258258            @param url                     The url of the service. 
    259259            @param methodNames      Array of names of methods that can be called on the server. 
     
    267267            this._addMethodNames(methodNames); 
    268268        }; 
    269          
     269 
    270270        /** 
    271271            Adds new JSONRPCMethods to the proxy server which can then be invoked. 
     
    295295            } 
    296296        }; 
    297          
     297 
    298298        /** 
    299299            Sets username and password for HTTP Authentication for all methods of this service. 
     
    308308            } 
    309309        }; 
    310          
     310 
    311311        ///The url of the service to resemble. 
    312312        publ._url; 
     
    318318        publ._methods=new Array(); 
    319319    }); 
    320      
     320 
    321321    ///@deprecated  Use ServiceProxy instead. 
    322322    mod.ServerProxy= mod.ServiceProxy; 
    323      
     323 
    324324    /** 
    325325        Converts a String to JSON. 
     
    330330        return s; 
    331331    }; 
    332      
     332 
    333333    /** 
    334334        Converts a Number to JSON. 
     
    337337        return this.toString(); 
    338338    }; 
    339      
     339 
    340340    /** 
    341341        Converts a Boolean to JSON. 
     
    344344        return this.toString(); 
    345345    }; 
    346      
     346 
    347347    /** 
    348348        Converts a Date to JSON. 
     
    360360        var min = padd(this.getUTCMinutes(), "00"); 
    361361        var s = padd(this.getUTCSeconds(), "00"); 
    362          
     362 
    363363        var isodate = y +  m  + d + "T" + h +  ":" + min + ":" + s; 
    364          
     364 
    365365        return '{"jsonclass":["sys.ISODate", ["' + isodate + '"]]}'; 
    366366    }; 
    367      
     367 
    368368    /** 
    369369        Converts an Array to JSON. 
  • jsolait/trunk/jsolait/lib/testing.js

    r21 r22  
    9595                this.testScope(); 
    9696            }catch(e){ 
    97                 if(e instanceof mod.AssertFailed){ 
     97                if(e.constructor == mod.AssertFailed){ 
    9898                    this.error = e; 
    9999                    this.failed=true; 
  • jsolait/trunk/jsolait/lib/urllib.js

    r8 r22  
    11/* 
    22  Copyright (c) 2003 Jan-Klaas Kollhof 
    3    
     3 
    44  This file is part of the JavaScript o lait library(jsolait). 
    5    
     5 
    66  jsolait is free software; you can redistribute it and/or modify 
    77  it under the terms of the GNU Lesser General Public License as published by 
    88  the Free Software Foundation; either version 2.1 of the License, or 
    99  (at your option) any later version. 
    10   
     10 
    1111  This software is distributed in the hope that it will be useful, 
    1212  but WITHOUT ANY WARRANTY; without even the implied warranty of 
    1313  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1414  GNU Lesser General Public License for more details. 
    15   
     15 
    1616  You should have received a copy of the GNU Lesser General Public License 
    1717  along with this software; if not, write to the Free Software 
     
    3939        }; 
    4040    }); 
    41      
     41 
    4242    /** 
    4343        Thrown if an HTTP request could not be opened. 
     
    5252        }; 
    5353    }); 
    54      
     54 
    5555    /** 
    5656        Thrown is arequest could not be sent to the server. 
     
    6565        }; 
    6666    }); 
    67      
     67 
    6868    /** 
    6969        Mimics the HTTPRequest object using Adobe's SVG Viewer's postURL and getURL. 
     
    137137        }; 
    138138    }); 
    139      
     139 
    140140    /** 
    141141        Creates an HTTP request object for retreiving files. 
    142142        @return  HTTP request object. 
    143     */     
     143    */ 
    144144    var getHTTP=function() { 
    145145        var obj; 
     
    154154                }catch(e){ 
    155155                    try{// to get the old MS HTTP request object 
    156                         obj = new ActiveXObject("microsoft.XMLHTTP");  
     156                        obj = new ActiveXObject("microsoft.XMLHTTP"); 
    157157                    }catch(e){ 
    158158                        try{//to create the ASV request object. 
     
    162162                        } 
    163163                    } 
    164                 }     
     164                } 
    165165            } 
    166166        } 
     
    173173            sendRequest("get", "url") 
    174174            sendRequest("post", "url", "data") 
    175          
     175 
    176176        with headers: 
    177177            sendRequest("get", "url", [["headername","value"]]) 
    178178            sendRequest("post", "url", "data", [["headername","value"]]) 
    179          
     179 
    180180        with user information: 
    181181            sendRequest("get", "url", "user", "pass") 
    182182            sendRequest("post", "url", "user", "pass", "data") 
    183          
     183 
    184184        with headers and user information: 
    185185            sendRequest("get", "url", "user", "pass", [["headername","value"]]) 
    186186            sendRequest("post", "url", "user", "pass", "data", [["headername","value"]]) 
    187          
     187 
    188188        To make the request asynchronous just add a callback function as the last argument to the calls above. 
    189   
     189 
    190190        @param type              Type of connection (GET, POST, ...). 
    191191        @param url                 The URL to retrieve. 
     
    200200        var async=false; 
    201201        //check if the last argument is a function and treat it as callback; 
    202         if(arguments[arguments.length-1]  instanceof Function){ 
     202        if(typeof arguments[arguments.length-1]  == 'function'){ 
    203203            var async=true; 
    204204            callback = arguments[arguments.length-1]; 
     
    238238        for(var i=0;i< headers.length;i++){ 
    239239            try{//opera 8b does not support setRequestHeader todo: 
    240                 xmlhttp.setRequestHeader(headers[i][0], headers[i][1]);     
     240                xmlhttp.setRequestHeader(headers[i][0], headers[i][1]); 
    241241            }catch(e){ 
    242242            } 
    243243        } 
    244          
     244 
    245245        if(async){//set up a callback 
    246246            xmlhttp.onreadystatechange=function(){ 
     
    249249                    xmlhttp = null; //help IE with garbage collection 
    250250                }else if (xmlhttp.readyState==2){ 
    251                     //status property should be available (MS IXMLHTTPRequest documentation)  
     251                    //status property should be available (MS IXMLHTTPRequest documentation) 
    252252                    //in Mozilla it is not if the request failed(server not reachable) 
    253253                    //in IE it is not available at all ?! 
     
    261261                        } 
    262262                    }catch(e){ 
    263                          
     263 
    264264                    } 
    265265                } 
    266266            }; 
    267267        } 
    268          
     268 
    269269        try{ 
    270270            xmlhttp.send(data); 
    271         }catch(e){             
     271        }catch(e){ 
    272272            if(async){ 
    273273                callback(xmlhttp, e); 
     
    290290        @return                     HTTP request object. 
    291291    */ 
    292     mod.getURL=function(url, user, pass, headers, callback) {  
     292    mod.getURL=function(url, user, pass, headers, callback) { 
    293293        var a=["GET"]; 
    294294        for(var i=0;i<arguments.length;i++){ 
     
    309309        @return                     HTTP request object. 
    310310    */ 
    311     mod.postURL=function(url, user, pass, data, headers, callback) {  
     311    mod.postURL=function(url, user, pass, data, headers, callback) { 
    312312        var a= ["POST"]; 
    313313        for(var i=0;i<arguments.length;i++){ 
  • jsolait/trunk/jsolait/lib/xmlrpc.js

    r17 r22  
    11/* 
    22  Copyright (c) 2003-2005 Jan-Klaas Kollhof 
    3    
     3 
    44  This file is part of the JavaScript o lait library(jsolait). 
    5    
     5 
    66  jsolait is free software; you can redistribute it and/or modify 
    77  it under the terms of the GNU Lesser General Public License as published by 
    88  the Free Software Foundation; either version 2.1 of the License, or 
    99  (at your option) any later version. 
    10   
     10 
    1111  This software is distributed in the hope that it will be useful, 
    1212  but WITHOUT ANY WARRANTY; without even the implied warranty of 
    1313  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1414  GNU Lesser General Public License for more details. 
    15   
     15 
    1616  You should have received a copy of the GNU Lesser General Public License 
    1717  along with this software; if not, write to the Free Software 
     
    4545        publ.status; 
    4646    }); 
    47      
     47 
    4848    /** 
    4949        Thrown if an XML-RPC response is not well formed. 
     
    6464    }); 
    6565    /** 
    66         Thrown if the RPC response is a Fault.         
     66        Thrown if the RPC response is a Fault. 
    6767    */ 
    6868    mod.Fault = Class(mod.Exception, function(publ, supr){ 
     
    8686        Marshalls an object to XML-RPC.(Converts an object into XML-RPC conforming xml.) 
    8787        It just calls the toXmlRpc function of the objcect. 
    88         So, to customize serialization of objects one just needs to specify/override the toXmlRpc method  
     88        So, to customize serialization of objects one just needs to specify/override the toXmlRpc method 
    8989        which should return an xml string conforming with XML-RPC spec. 
    9090        @param obj    The object to marshall 
     
    105105        } 
    106106    }; 
    107      
     107 
    108108    /** 
    109109        Unmarshalls an XML document to a JavaScript object. (Converts xml to JavaScript object.) 
     
    122122        return rslt; 
    123123    }; 
    124      
     124 
    125125    /** 
    126126        Unmarshalls an XML document to a JavaScript object like unmarshall but expects a DOM document as parameter. 
     
    144144            } 
    145145        }catch(e){ 
    146             if(e instanceof mod.Fault){//just rethrow the fault. 
     146            if(e.constructor == mod.Fault){//just rethrow the fault. 
    147147                throw e; 
    148148            }else { 
    149                 throw new mod.MalformedXmlRpc("Unmarshalling of XML failed.", xml, e);     
    150             } 
    151         } 
    152     }; 
    153      
     149                throw new mod.MalformedXmlRpc("Unmarshalling of XML failed.", xml, e); 
     150            } 
     151        } 
     152    }; 
     153 
    154154    /** 
    155155        Parses a methodeResponse element. 
     
    173173                            } 
    174174                        default: 
    175                             throw new mod.MalformedXmlRpc("'fault' or 'params' element expected.\nFound: '" + child.tagName + "'");                         
     175                            throw new mod.MalformedXmlRpc("'fault' or 'params' element expected.\nFound: '" + child.tagName + "'"); 
    176176                    } 
    177177                } 
    178178            } 
    179179            //no child elements found 
    180             throw new mod.MalformedXmlRpc("No child elements found.");     
    181         }catch(e){ 
    182             if(e instanceof mod.Fault){ 
     180            throw new mod.MalformedXmlRpc("No child elements found."); 
     181        }catch(e){ 
     182            if(e.constructor == mod.Fault){ 
    183183                throw e; 
    184184            }else{ 
    185                 throw new mod.MalformedXmlRpc("'methodResponse' element could not be parsed.",null,e);     
     185                throw new mod.MalformedXmlRpc("'methodResponse' element could not be parsed.",null,e); 
    186186            } 
    187187        } 
     
    190190        Parses a methodCall element. 
    191191        @param node  The methodCall element. 
    192         @return          Array [methodName,params].  
    193     */         
     192        @return          Array [methodName,params]. 
     193    */ 
    194194    var parseMethodCall = function(node){ 
    195195        try{ 
     
    207207                            break; 
    208208                        default: 
    209                             throw new mod.MalformedXmlRpc("'methodName' or 'params' element expected.\nFound: '" + child.tagName + "'");                         
     209                            throw new mod.MalformedXmlRpc("'methodName' or 'params' element expected.\nFound: '" + child.tagName + "'"); 
    210210                    } 
    211211                } 
     
    217217            } 
    218218        }catch(e){ 
    219             throw new mod.MalformedXmlRpc("'methodCall' element could not be parsed.",null,e);     
     219            throw new mod.MalformedXmlRpc("'methodCall' element could not be parsed.",null,e); 
    220220        } 
    221221    }; 
     
    223223        Parses a params element. 
    224224        @param node  The params element. 
    225         @return          Array of params values.  
     225        @return          Array of params values. 
    226226    */ 
    227227    var parseParams = function(node){ 
     
    236236                            break; 
    237237                        default: 
    238                             throw new mod.MalformedXmlRpc("'param' element expected.\nFound: '" + child.tagName + "'");                         
     238                            throw new mod.MalformedXmlRpc("'param' element expected.\nFound: '" + child.tagName + "'"); 
    239239                    } 
    240240                } 
     
    243243            return params; 
    244244        }catch(e){ 
    245             throw new mod.MalformedXmlRpc("'params' element could not be parsed.",null,e);     
     245            throw new mod.MalformedXmlRpc("'params' element could not be parsed.",null,e); 
    246246        } 
    247247    }; 
     
    260260                            return parseValue(child); 
    261261                        default: 
    262                             throw new mod.MalformedXmlRpc("'value' element expected.\nFound: '" + child.tagName + "'");                         
     262                            throw new mod.MalformedXmlRpc("'value' element expected.\nFound: '" + child.tagName + "'"); 
    263263                    } 
    264264                } 
     
    267267            throw new mod.MalformedXmlRpc("'value' element expected.But none found."); 
    268268        }catch(e){ 
    269             throw new mod.MalformedXmlRpc("'param' element could not be parsed.",null,e);     
     269            throw new mod.MalformedXmlRpc("'param' element could not be parsed.",null,e); 
    270270        } 
    271271    }; 
     
    306306                            return null; 
    307307                        default: 
    308                             throw new mod.MalformedXmlRpc("'string','int','i4','double','boolean','base64','dateTime.iso8601','array' or 'struct' element expected.\nFound: '" + child.tagName + "'");                         
     308                            throw new mod.MalformedXmlRpc("'string','int','i4','double','boolean','base64','dateTime.iso8601','array' or 'struct' element expected.\nFound: '" + child.tagName + "'"); 
    309309                    } 
    310310                } 
     
    322322            } 
    323323        }catch(e){ 
    324             throw new mod.MalformedXmlRpc("'value' element could not be parsed.",null,e);     
     324            throw new mod.MalformedXmlRpc("'value' element could not be parsed.",null,e); 
    325325        } 
    326326    }; 
     
    335335            return s.decode("base64"); 
    336336        }catch(e){ 
    337             throw new mod.MalformedXmlRpc("'base64' element could not be parsed.",null,e);     
     337            throw new mod.MalformedXmlRpc("'base64' element could not be parsed.",null,e); 
    338338        } 
    339339    }; 
     
    351351            } 
    352352        }catch(e){ 
    353             throw new mod.MalformedXmlRpc("'dateTime.iso8601' element could not be parsed.",null,e);     
     353            throw new mod.MalformedXmlRpc("'dateTime.iso8601' element could not be parsed.",null,e); 
    354354        } 
    355355    }; 
     
    368368                            return parseData(child); 
    369369                        default: 
    370                             throw new mod.MalformedXmlRpc("'data' element expected.\nFound: '" + child.tagName + "'");                         
    371                     } 
    372                 } 
    373             } 
    374             throw new mod.MalformedXmlRpc("'data' element expected. But not found.");    
    375         }catch(e){ 
    376             throw new mod.MalformedXmlRpc("'array' element could not be parsed.",null,e);     
     370                            throw new mod.MalformedXmlRpc("'data' element expected.\nFound: '" + child.tagName + "'"); 
     371                    } 
     372                } 
     373            } 
     374            throw new mod.MalformedXmlRpc("'data' element expected. But not found."); 
     375        }catch(e){ 
     376            throw new mod.MalformedXmlRpc("'array' element could not be parsed.",null,e); 
    377377        } 
    378378    }; 
     
    393393                            break; 
    394394                        default: 
    395                             throw new mod.MalformedXmlRpc("'value' element expected.\nFound: '" + child.tagName + "'");                         
    396                     } 
    397                 }             
     395                            throw new mod.MalformedXmlRpc("'value' element expected.\nFound: '" + child.tagName + "'"); 
     396                    } 
     397                } 
    398398            } 
    399399            return rslt; 
    400400        }catch(e){ 
    401             throw new mod.MalformedXmlRpc("'data' element could not be parsed.",null,e);     
     401            throw new mod.MalformedXmlRpc("'data' element could not be parsed.",null,e); 
    402402        } 
    403403    }; 
     
    421421                            break; 
    422422                        default: 
    423                             throw new mod.MalformedXmlRpc("'data' element expected.\nFound: '" + child.tagName + "'");                         
     423                            throw new mod.MalformedXmlRpc("'data' element expected.\nFound: '" + child.tagName + "'"); 
    424424                    } 
    425425                } 
     
    427427            return struct; 
    428428        }catch(e){ 
    429             throw new mod.MalformedXmlRpc("'struct' element could not be parsed.",null,e);     
     429            throw new mod.MalformedXmlRpc("'struct' element could not be parsed.",null,e); 
    430430        } 
    431431    }; 
     
    444444                    switch (child.tagName){ 
    445445                        case "value": 
    446                             value = parseValue(child);  
     446                            value = parseValue(child); 
    447447                            break; 
    448448                        case "name": 
     
    452452                            break; 
    453453                        default: 
    454                             throw new mod.MalformedXmlRpc("'value' or 'name' element expected.\nFound: '" + child.tagName + "'");                         
     454                            throw new mod.MalformedXmlRpc("'value' or 'name' element expected.\nFound: '" + child.tagName + "'"); 
    455455                    } 
    456456                } 
     
    463463            return [name, value]; 
    464464        }catch(e){ 
    465             throw new mod.MalformedXmlRpc("'member' element could not be parsed.",null,e);     
     465            throw new mod.MalformedXmlRpc("'member' element could not be parsed.",null,e); 
    466466        } 
    467467    }; 
     
    478478                    switch (child.tagName){ 
    479479                        case "value": 
    480                             var flt = parseValue(child);  
     480                            var flt = parseValue(child); 
    481481                            return new mod.Fault(flt.faultCode, flt.faultString); 
    482482                        default: 
    483                             throw new mod.MalformedXmlRpc("'value' element expected.\nFound: '" + child.tagName + "'");                         
    484                     } 
    485                 } 
    486             } 
    487             throw new mod.MalformedXmlRpc("'value' element expected. But not found.");                         
    488         }catch(e){ 
    489             throw new mod.MalformedXmlRpc("'fault' element could not be parsed.",null,e);     
    490         } 
    491     }; 
    492  
    493      
     483                            throw new mod.MalformedXmlRpc("'value' element expected.\nFound: '" + child.tagName + "'"); 
     484                    } 
     485                } 
     486            } 
     487            throw new mod.MalformedXmlRpc("'value' element expected. But not found."); 
     488        }catch(e){ 
     489            throw new mod.MalformedXmlRpc("'fault' element could not be parsed.",null,e); 
     490        } 
     491    }; 
     492 
     493 
    494494    /** 
    495495        Class for creating XML-RPC methods. 
     
    497497        The return value of this call will be the return value of the RPC call. 
    498498        RPC-Faults will be raised as Exceptions. 
    499          
     499 
    500500        Asynchronous operation: 
    501         If the last parameter passed to the method is an XMLRPCAsyncCallback object,  
    502         then the remote method will be called asynchronously.  
     501        If the last parameter passed to the method is an XMLRPCAsyncCallback object, 
     502        then the remote method will be called asynchronously. 
    503503        The results and errors are passed to the callback. 
    504504    */ 
     
    512512            } 
    513513        }; 
    514          
     514 
    515515        var handleResponse=function(resp){ 
    516516            var status=null; 
     
    525525                }catch(e){ 
    526526                } 
    527                 var respTxt = "";  
    528                 try{                  
     527                var respTxt = ""; 
     528                try{ 
    529529                    respTxt=resp.responseText; 
    530530                }catch(e){ 
     
    543543            } 
    544544        }; 
    545          
     545 
    546546        var getXML = function(methodName, args){ 
    547547            var data='<?xml version="1.0"?><methodCall><methodName>' + methodName + '</methodName>'; 
     
    556556            return data; 
    557557        }; 
    558          
    559          
     558 
     559 
    560560        /** 
    561561            Initializes the XML-RPC method. 
     
    572572            this.password=pass; 
    573573        }; 
    574          
    575          
     574 
     575 
    576576        publ.__call__=function(){ 
    577577            //sync or async call 
    578             if(!(arguments[arguments.length-1] instanceof Function)){ 
     578            if(typeof arguments[arguments.length-1] != 'function'){ 
    579579                var data=getXML(this.methodName,arguments); 
    580580                var resp = postData(this.url, this.user, this.password, data); 
     
    604604            } 
    605605        }; 
    606                  
     606 
    607607        /** 
    608608            Returns the method representation for system.multicall. 
     
    638638        publ.password; 
    639639    }); 
    640      
     640 
    641641    /** 
    642642        Creates proxy objects which resemble the remote service. 
     
    651651            ServerProxy("url", ["methodName1",...], "user", "pass") 
    652652            ServerProxy("url", "user", "pass") 
    653              
     653 
    654654            @param url                     The url of the service. 
    655655            @param methodNames=[]  Array of names of methods that can be called on the server. 
     
    682682            } 
    683683        }; 
    684          
     684 
    685685        /** 
    686686            Adds new XMLRPCMethods to the proxy server which can then be invoked. 
     
    710710            } 
    711711        }; 
    712          
     712 
    713713        /** 
    714714            Sets username and password for HTTP Authentication for all methods of this service. 
     
    723723            } 
    724724        }; 
    725          
     725 
    726726        /** 
    727727            Initiate XML-RPC introspection to retrieve methodnames from the server 
     
    742742        publ._methods=new Array(); 
    743743    }); 
    744      
     744 
    745745    ///@deprecated  Use ServiceProxy instead. 
    746746    mod.ServerProxy= mod.ServiceProxy; 
    747      
     747 
    748748    /** 
    749749        XML-RPC representation of a string. 
     
    793793        var min = padd(this.getUTCMinutes(), "00"); 
    794794        var s = padd(this.getUTCSeconds(), "00"); 
    795          
     795 
    796796        var isodate = y +  m  + d + "T" + h +  ":" + min + ":" + s; 
    797      
     797 
    798798        return "<dateTime.iso8601>" + isodate + "</dateTime.iso8601>"; 
    799799    };