Datenbankabfrage wirft Fehler: error NetConnection.Call.BadVersion
| Beiträge: 4 Wohnort: Steiermark Registriert: Nov 2011
| 10.04.2012, 22:04
Hallo :)
Zur Erstellung einer kleinen Web-Applikation mit Zugriff auf eine Datenbank habe ich mir ein neues Flex-Projekt erstellt, mit PHP als Servertyp.
Da nun lokal alles problemlos abläuft, wollte ich nun einen Release-Build erstellen um diesen dann auf den Server zu laden. Dabei habe ich mich an diese kleine Anleitung gehalten:
http://help.adobe.com/de_DE/flashbuilder/using/WSe4e4b720da9dedb5-13a250c812e8e9b5533-7ff9.html
Also Release-Build erstellt, hochgeladen, in den Services habe ich die Verbindungsdaten zum Server richtiggestellt/überprüft, die amf-config sollte auch so stimmen. Die gateway.php habe ich so belassen wie sie war, diese liefert beim Ausführen der Applikation jedoch den Fehler
Send failed
Channel.Connect.Failed error NetConnection.Call.BadVersion: : url: 'http://xxxx/xx/gateway.php'
Woran mag das noch liegen?
Weiß nicht ob das zur Lösungsfindung beiträgt, aber hier noch die amf-config
PHP:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
[zend]
;set the absolute location path of webroot directory, example:
;Windows: C:\apache\www
;MAC/UNIX: /user/apache/www
webroot = ./
;set the absolute location path of zend installation directory, example:
;Windows: C:\apache\PHPFrameworks\ZendFramework\library
;MAC/UNIX: /user/apache/PHPFrameworks/ZendFramework/library
zend_path = ./ZendFramework/Library
[zendamf]
amf.production = true
amf.directories[]= ./dbiv_local/services
|
...und gateway.php:
PHP:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
<?php
ini_set("display_errors", 1);
$dir = dirname(__FILE__);
$webroot = $_SERVER['DOCUMENT_ROOT'];
$configfile = "$dir/amf_config.ini";
//default zend install directory
$zenddir = $webroot. '/ZendFramework/library';
//Load ini file and locate zend directory
if(file_exists($configfile)) {
$arr=parse_ini_file($configfile,true);
if(isset($arr['zend']['webroot'])){
$webroot = $arr['zend']['webroot'];
$zenddir = $webroot. '/ZendFramework/library';
}
if(isset($arr['zend']['zend_path'])){
$zenddir = $arr['zend']['zend_path'];
}
}
// Setup include path
//add zend directory to include path
set_include_path(get_include_path().PATH_SEPARATOR.$zenddir);
// Initialize Zend Framework loader
require_once 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance();
// Load configuration
$default_config = new Zend_Config(array("production" => false), true);
$default_config->merge(new Zend_Config_Ini($configfile, 'zendamf'));
$default_config->setReadOnly();
$amf = $default_config->amf;
// Store configuration in the registry
Zend_Registry::set("amf-config", $amf);
// Initialize AMF Server
$server = new Zend_Amf_Server();
$server->setProduction($amf->production);
if(isset($amf->directories)) {
$dirs = $amf->directories->toArray();
foreach($dirs as $dir) {
// get the first character of the path.
// If it does not start with slash then it implies that the path is relative to webroot. Else it will be treated as absolute path
$length = strlen($dir);
$firstChar = $dir;
if($length >= 1)
$firstChar = $dir[0];
if($firstChar != "/"){
// if the directory is ./ path then we add the webroot only.
if($dir == "./"){
$server->addDirectory($webroot);
}else{
$tempPath = $webroot . "/" . $dir;
$server->addDirectory($tempPath);
}
}else{
$server->addDirectory($dir);
}
}
}
// Initialize introspector for non-production
if(!$amf->production) {
$server->setClass('Zend_Amf_Adobe_Introspector', '', array("config" => $default_config, "server" => $server));
$server->setClass('Zend_Amf_Adobe_DbInspector', '', array("config" => $default_config, "server" => $server));
}
// Handle request
echo $server->handle();
|
Vielen Dank schon mal im Voraus :) | Geändert von hoelli am 11.04.12 um 10:17 Uhr | |
|
| Ähnliche Beiträge zum Thema | |
|
Flashhilfe.de Flash Platform Tipps & Tutorials Flash Platform Andere Programmiersprachen Jobangebote Diskussionen
Flashhilfe News
Regeln & Bedingungen
|