Calling AMFPHP from Red 5 returns a long double
I'm running the latest build (I'm pretty sure it's 1.0) on Ubuntu and I am calling a function on an amfphp service on another server. Everything seems to开发者_运维知识库 be in order, but I am getting a strange return value using the following code:
String url = "http://path.to.our.server/gateway.php";
RemotingClient client = new RemotingClient(url);
Object[] args = new Object[]{"Hello world!"};
Object result =client.invokeMethod("service.manager.say", args);
if(debug) System.out.println("return from server: "+result.toString());
All the say() function does is return the phrase "hello from the server" as a string.
function say($what){
return "hello from the server";
}
What I'm getting, however, is the following result:
return from server: 1.6846524729092E-310
Any ideas on what's going wrong?
Update with the answer. Red5 doesn't work correctly with AMFPHP 1.9. Switching to AMFPHP 1.2 solved the issue. Also, switching to Zend AMF worked as expected.
精彩评论