我在使用SimpleRemoteObject
. (SDK 0.9.6)
我的实际网站正在使用此代码通过 Amfphp 调用远程函数:
<mx:RemoteObject id="ro" source="aadmin" destination="amfphp">
<mx:method name="siteLogin" fault="{onRcv_siteLoginErr(event)}" result="{onRcv_siteLogin(event)}"/>
</mx:RemoteObject>
由于<mx:method/>
Apache Royale 中不存在,我设置了以下代码:
</js:beads>
<js:SimpleRemoteObject id="sro" source="aadmin" result="onResult(event)" fault="onFault(event)"
endPoint = "http://amfphp.myserver_url.com/gateway.php"
destination = "amfphp" />
</js:beads>
aadmin
是我的 php 类服务名称
要调用我的函数,我会:
sro.send("siteLogin",["123"]);
我在课堂siteLogin
上调用的函数在哪里aadmin
运行这个,我有这个问题:
The class {Amf3Broker} could not be found under the class path {/home/www/amfphp/services/amfphp/Amf3Broker.php}
为什么会显示Amf3Broker
?有没有人有合作的SimpleRemoteObject
例子amfphp
?
服务器端我使用https://github.com/silexlabs/amfphp-1.9
我需要设置一个service-config.xml
文件吗?如果是,如何将它与编译器一起使用?(我在 compilerOptions 中尝试了“services”:“services-config.xml”但没有工作)
这是我的 service-config.xml :
<services-config>
<services>
<service id="amfphp-flashremoting-service" class="flex.messaging.services.RemotingService" messageTypes="flex.messaging.messages.RemotingMessage">
<destination id="amfphp">
<channels>
<channel ref="my-amfphp"/>
</channels>
<properties>
<source>*</source>
</properties>
</destination>
</service>
</services>
<channels>
<channel-definition id="my-amfphp" class="mx.messaging.channels.AMFChannel">
<endpoint uri="http://amfphp.myserver.com/gateway.php" class="flex.messaging.endpoints.AMFEndpoint"/>
<properties><add-no-cache-headers>false</add-no-cache-headers></properties>
</channel-definition>
</channels>
</services-config>
现在我已经amfphp V2.0
从https://github.com/silexlabs/amfphp-2.0进行了测试
这有点好,但我有一个错误。财产好像有问题_explicitType
。此外,我在 [requestMessage] 中看不到我的论点('123')
/onStatusî$flex.messaging.messages.ErrorMessage
correlationId faultCode@ faultDetailfaultStringvUndefined property: stdClass::$_explicitType .
<br>file: /home/www/mysite.com/amfphpv2/Plugins/AmfphpFlexMessaging/AmfphpFlexMessaging.php
<br>line: 113
<br>context: Array
(
[requestMessage] => Amfphp_Core_Amf_Message Object
(
[targetUri] => null
[responseUri] => /1
[data] => Array
(
[0] => stdClass Object
(
[body] => stdClass Object
(
)
[clientId] =>
[correlationId] =>
[destination] => amfphp
[headers] => stdClass Object
(
)
[messageId] => EF4BF9E3-5C02-1060-1FF3-5D9781F55A31
[operation] => 13
[timeToLive] => 0
[timestamp] => 0
)
)
)
[serviceRouter] => Amfphp_Core_Common_ServiceRouter Object
(
[serviceFolders] => Array
(
[0] => /home/www/mysite.com/amfphpv2/Core/../Services/
)
[serviceNames2ClassFindInfo] => Array
(
[AmfphpMonitorService] => Amfphp_Core_Common_ClassFindInfo Object
(
[absolutePath] => /home/www/mysite.com/amfphpv2/Plugins/AmfphpMonitor/AmfphpMonitorService.php
[className] => AmfphpMonitorService
)
[AmfphpDiscoveryService] => Amfphp_Core_Common_ClassFindInfo Object
(
[absolutePath] => /home/www/mysite.com/amfphpv2/Plugins/AmfphpDiscovery/AmfphpDiscoveryService.php
[className] => AmfphpDiscoveryService
)
)
[checkArgumentCount] => 1
)
[explicitTypeField] => _explicitType
)
rootCause
在此先感谢您的帮助...