[swx] Remote methods work in the explorer but not when called form custom application
Pete Hotchkiss
Pete.Hotchkiss at substance001.com
Wed Apr 2 04:14:50 PST 2008
Hi Ben
Thanks - you spotted my typo in the email - I'd given this merely as an
example to simplify a larger problem. What ever I put in my PHP class
method other than a simple return $argument only returns undefined.
Made some progress though - its definitely a hosting/config issue as
I've got the app running on another domain - just not the one it needs
to be on
Pete
________________________________
From: swx-bounces at osflash.org [mailto:swx-bounces at osflash.org] On Behalf
Of ben
Sent: 02 April 2008 13:12
To: SWX Mailing List
Subject: Re: [swx] Remote methods work in the explorer but not when
called form custom application
Hi Pete...
Just a thought... in php "Echo: " + $n1 would not concatenate the
values. I think it tries to convert them to number first then add them..
which could explain why you get undefined as a result..
"Echo: " . $n1 would concatenate instead..
Does that help??
Ben
Pete Hotchkiss wrote:
Hi the guys and girls of the list.
I have an interesting/frustrating issue calling custom methods
on a SWX application currently in development. I hoping that a kind
person on this list can shed some light on my problem. I've been using
SWX for a while now, but this one has me a bit stumped. The application
in question works perfectly locally (within the MAMP environment)
however once deployed to the site we're experiencing strange problems.
In short the result property of the returned event object is always
undefined - unless the remote method simply returns the passed argument.
So for example if our remote PHP class is
class CompatibilityTest
{
function test1($n1)
{
return $n1;
}
function test2($n1)
{
return "Echo: " + $n1;
}
}
If I call the test1 method I get my argument strait back, if I
call test2 I get undefined.
What's odd is this only happens when making the calls from my
Flash app - the methods execute perfectly from the service explorer.
Furthermore, any functionality to store passed arguments in a database
etc execute perfectly - its just trying to return anything more
complicated than the passed method argument seems to throw out the
gateway.
I've tried running the test scripts (in the tests folder) on the
host and I get the following
From all_tests.php
Fail: SwxAssemblerTest.php -> swxassemblertest ->
testdatatobytecode -> Equal expectation fails at character 11 with
[0068656C6C6F00] and [0068656C6C600] at
[/content/html/compatibilitytest/php/tests/SwxAssemblerTest.php line 64]
Fail: SwxAssemblerTest.php -> swxassemblertest ->
teststringtobytecode -> Equal expectation fails at character 11 with
[0068656C6C6F00] and [0068656C6C600] at
[/content/html/compatibilitytest/php/tests/SwxAssemblerTest.php line 87]
Fail: SwxAssemblerTest.php -> swxassemblertest -> teststrhex ->
Equal expectation fails at character 9 with [68656c6c6f] and [68656c6c6]
at [/content/html/compatibilitytest/php/tests/SwxAssemblerTest.php line
199]
SWX PHP Assembler Error! 1 of 1 test case complete: 15 passes, 3
fails and 0 exceptions.
From SwxAssemblerTest.php
Fatal error: Class swxassemblertest: Cannot inherit from
undefined class unittestcase in
/content/html/compatibilitytest/php/tests/SwxAssemblerTest.php on line 6
In the past I've had problems with certain hosting environments
causing issues when open_basedir and safe_mode arent switched off. I
believe are off for this host, but I cant tell fully as phpinfo() is
disabled on the host for security reasons. I'm waiting to hear from them
on the exact configuration they have set up for this app.
Does anybody have any light to shed on this one - its a puzzler
:-)
Thanks in advance folks
Pete
P.S - Aral - I've sent this to your personal mail without
realising there was this list - so apologies for the duplicated post in
your inbox :-)
________________________________
_______________________________________________
swx mailing list
swx at osflash.org
http://osflash.org/mailman/listinfo/swx_osflash.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/swx_osflash.org/attachments/20080402/46ecd1f4/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 9500 bytes
Desc: pete_footer.gif
Url : http://osflash.org/pipermail/swx_osflash.org/attachments/20080402/46ecd1f4/attachment-0002.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 9500 bytes
Desc: http___www.substance001.com_.gif
Url : http://osflash.org/pipermail/swx_osflash.org/attachments/20080402/46ecd1f4/attachment-0003.gif
More information about the swx
mailing list