Changeset 21
- Timestamp:
- 01/22/07 10:38:09 (6 years ago)
- Files:
-
- 1 modified
-
jala/branches/release-1.0/code/XmlRpcRequest.js (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
jala/branches/release-1.0/code/XmlRpcRequest.js
r4 r21 73 73 if (proxyString && proxyString.trim()) { 74 74 var idx = proxyString.indexOf(":"); 75 var host = proxyString.substring(0, idx); 76 var port = proxyString.substring(idx+1); 77 if (java.lang.Class.forName("java.net.Proxy") != null) { 78 // construct a proxy instance 79 var socket = new java.net.InetSocketAddress(host, port); 80 proxy = new java.net.Proxy(java.net.Proxy.Type.HTTP, socket); 81 } else { 82 // the pre jdk1.5 way: set the system properties 83 var sys = java.lang.System.getProperties(); 84 if (host) { 85 app.log("[Helma XmlRpc Client] WARNING: setting system http proxy to " 86 + host + ":" + port); 87 sys.put("http.proxySet", "true"); 88 sys.put("http.proxyHost", host); 89 sys.put("http.proxyPort", port); 75 if (idx > 0) { 76 var host = proxyString.substring(0, idx); 77 var port = proxyString.substring(idx+1); 78 if (host != null && port != null) { 79 if (java.lang.Class.forName("java.net.Proxy") != null) { 80 // construct a proxy instance 81 var socket = new java.net.InetSocketAddress(host, port); 82 proxy = new java.net.Proxy(java.net.Proxy.Type.HTTP, socket); 83 } else { 84 // the pre jdk1.5 way: set the system properties 85 var sys = java.lang.System.getProperties(); 86 if (host) { 87 app.log("[Jala XmlRpc Client] WARNING: setting system http proxy to " 88 + host + ":" + port); 89 sys.put("http.proxySet", "true"); 90 sys.put("http.proxyHost", host); 91 sys.put("http.proxyPort", port); 92 } 93 } 90 94 } 91 95 } … … 247 251 /** @ignore */ 248 252 jala.XmlRpcRequest.prototype.toString = function() { 249 return "[ Helma XmlRpc Client]";253 return "[Jala XmlRpc Request]"; 250 254 }; 251 255 … … 275 279 var params = new java.util.Vector(); 276 280 for (var i=0;i<arguments.length;i++) { 277 params.add( XmlRpcRequest.convertArgument(arguments[i]));281 params.add(jala.XmlRpcRequest.convertArgument(arguments[i])); 278 282 } 279 283 … … 289 293 conn.setAllowUserInteraction(false); 290 294 conn.setRequestMethod("POST"); 291 conn.setRequestProperty("User-Agent", " Helma XmlRpc Client");295 conn.setRequestProperty("User-Agent", "Jala XmlRpc Client"); 292 296 conn.setRequestProperty("Content-Type", "text/xml"); 293 297 conn.setRequestProperty("Content-Length", requestBytes.length); … … 332 336 result.error = parsedResult; 333 337 } else { 334 result.result = XmlRpcRequest.convertResult(parsedResult);338 result.result = jala.XmlRpcRequest.convertResult(parsedResult); 335 339 } 336 340 } 337 341 } catch (e) { 338 result.error = "[ Helma XmlRpc Client] Error executing " + this.getMethodName()339 + " with arguments " + XmlRpcRequest.argumentsToString(arguments)342 result.error = "[Jala XmlRpc Request] Error executing " + this.getMethodName() 343 + " with arguments " + jala.XmlRpcRequest.argumentsToString(arguments) 340 344 + ", the error is: " + e.toString(); 341 345 } 342 346 if (app.__app__.debug() == true) { 343 app.logger.debug(" XmlRpcRequest(" + ((new Date()) - start) + " ms): executed '"347 app.logger.debug("[Jala XmlRpc Request] (" + ((new Date()) - start) + " ms): executed '" 344 348 + this.getMethodName() + "' with arguments: " 345 + XmlRpcRequest.argumentsToString(arguments));349 + jala.XmlRpcRequest.argumentsToString(arguments)); 346 350 } 347 351 return result; … … 361 365 result = new java.util.Vector(obj.length); 362 366 for (var i=0;i<obj.length;i++) { 363 result.add(i, XmlRpcRequest.convertArgument(obj[i]));367 result.add(i, jala.XmlRpcRequest.convertArgument(obj[i])); 364 368 } 365 369 } else if (obj instanceof Date) { … … 381 385 result = new java.util.Hashtable(); 382 386 for (var key in obj) { 383 result.put(key, XmlRpcRequest.convertArgument(obj[key]));387 result.put(key, jala.XmlRpcRequest.convertArgument(obj[key])); 384 388 } 385 389 } else { … … 402 406 var e = obj.elements(); 403 407 while (e.hasMoreElements()) { 404 result.push( XmlRpcRequest.convertResult(e.nextElement()));408 result.push(jala.XmlRpcRequest.convertResult(e.nextElement())); 405 409 } 406 410 } else if (obj instanceof java.util.Hashtable) { … … 411 415 while (e.hasMoreElements()) { 412 416 key = e.nextElement(); 413 result[key] = XmlRpcRequest.convertResult(obj.get(key));417 result[key] = jala.XmlRpcRequest.convertResult(obj.get(key)); 414 418 } 415 419 } else if (obj instanceof java.lang.String) {
![(please configure the [header_logo] section in trac.ini)](/jala/chrome/common/trac_banner.png)