Copyright © 2012 Kaltura Inc.
All Rights Reserved. Designated trademarks and brands are the property of their respective owners.
Use of this web site constitutes acceptance of the Terms of Use and Privacy Policy.
EduVideo.org
The web services return boolean values as integers instead of strings (0 and 1 instead of 'True' and 'False'). Strings are assumed when the Java client is generated causing all boolean values to be interpreted as false. JavaClientGenerator.php needs to be modified to avoid using Boolean.parseBoolean:
diff -awur kcl_java_v3.0.0//src/php/JavaClientGenerator.php ../kcl_java_v3.0.0//src/php/JavaClientGenerator.php
--- kcl_java_v3.0.0//src/php/JavaClientGenerator.php 2009-10-08 06:00:58.000000000 -0400
+++ ../kcl_java_v3.0.0//src/php/JavaClientGenerator.php 2010-11-24 10:35:32.063091001 -0500
@@ -240,7 +240,7 @@
$propBlock .= " this.$propName = txt;\n";
break;
case "bool":
- $propBlock .= " if (!txt.equals(\"\")) this.$propName = Boolean.parseBoolean(txt);\n";
+ $propBlock .= " if (!txt.equals(\"\")) this.$propName = (Integer.parseInt(txt) == 0) ? Boolean.FALSE : Boolean.TRUE;\n";
break;
case "float":
$propBlock .= " try {\n";
@@ -539,7 +539,7 @@
break;
case "bool":
$this->appendLine(" String resultText = XmlUtils.getTextValue(resultXmlElement, \"result\");");
- $this->appendLine(" return Boolean.parseBoolean(resultText);");
+ $this->appendLine(" return (Integer.parseInt(resultText) == 0) ? Boolean.FALSE : Boolean.TRUE;");
break;
case "string":
$this->appendLine(" String resultText = XmlUtils.getTextValue(resultXmlElement, \"result\");");