Can't see the services in the back office service browser

夙愿已清 提交于 2019-12-11 18:59:15

问题


Im trying to make a flash app that connects with AMFPHP 2.1.

I got WAMP working, everything seems ok, but the back office service browser cant find any service I place in the service folder, not even the example. I’ve already checked the path in the config.php file, its ok.

And the client generator says this:

“Warning: Invalid argument supplied for foreach() in C:wampwwwBackOfficeClientGenerator.php on line 44″

Don’t know what to do.

Any help or idea about what could be the problem will be much appreciated!.

Thanks.


回答1:


Okay pulled down the code just posting it here for anyone else who may have more insight into AMF PHP or potential reasons this may fail:

$amfphpUrl = $config->resolveAmfphpEntryPointUrl();
$serviceCaller = new Amfphp_BackOffice_ServiceCaller($amfphpUrl);
//load service descriptors
$services = $serviceCaller->makeAmfphpJsonServiceCall("AmfphpDiscoveryService", "discover");
//remove discovery service from list
unset ($services->AmfphpDiscoveryService);
//list services 
echo '<ul>';
foreach ($services as $service) {
    echo "<li>$service->name</li>";
}
echo '</ul>';

The foreach loop in the OP's question is four lines up from the bottom. Why it can't get this list of services though requires digging further in to the BackOffice files (personally just not interested enough right now). My guess is something with the config entry point is wrong but hard to say.




回答2:


Alright, by misstake I've deleted a couple of lines from the service caller, restoring that it works just fine.

(Special thanks to Ariel Sommeria)



来源:https://stackoverflow.com/questions/13365289/cant-see-the-services-in-the-back-office-service-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!