问题
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