Ciao!
Ho un problema...
ho realizzato una pagina che con una funzione che riceve un id e in base all'id restituisce il token. Questo è fatto dalla pagina che è come server soap.
Il problema è che quando vad ad aprire questa pagina ci sono vari errori nel file nusoap.php che tra l'altro è enorme... vi posto l'errore con la riga di codice in cui c'è l'errore.
Vi posto qui parte del codice della mia pagina:
Codice PHP:
function getToken($id) {
mysql_connect('localhost','administrator','administrator');
mysql_select_db('ticket');
$query = "SELECT token FROM user "
. "WHERE user_id = '$id'";
$result = mysql_query($query);
$row = mysql_fetch_assoc($result);
return $row['token'];
}
require('nusoap/nusoap.php');
$server = new soap_server();
$server->configureWSDL('serverA', 'urn:serverAquote');
$server->register("getToken",
array('symbol' => 'xsd:string'),
array('return' => 'xsd:string'),
'urn:serverAquote',
'urn:serverAquote#getToken');
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA)
? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
mentre nell'altra pagina il client:
Codice PHP:
require_once('nusoap.php');
$c = new soapclient('http://localhost/serverA.php');
$tokenserver = $c->call('getToken',array('string' => $id));
Deprecated: Assigning the return value of new by reference is deprecated in D:\EasyPHP-5.3.2i\www\mio_url\nusoap.php on line 6506
Strict Standards: Creating default object from empty value in D:\EasyPHP-5.3.2i\www\mio_url\nusoap.php on line 55
Notice: Undefined index: HTTPS in D:\EasyPHP-5.3.2i\www\mio_url\nusoap.php on line 4013
Deprecated: Function ereg() is deprecated in D:\EasyPHP-5.3.2i\www\mio_url\nusoap.php on line 3277
Codice PHP:
//riga 55:
$GLOBALS['_transient']['static']['nusoap_base']->globalDebugLevel = 9;
//riga 3277 e successive:
if (eregi('^(ISO-8859-1|US-ASCII|UTF-8)$', $enc))
{
$this->xml_encoding = strtoupper($enc);
} else {
$this->xml_encoding = 'US-ASCII';
}
//riga 4013
$HTTPS = $_SERVER['HTTPS'];
//nel contesto la 4013 è compresa qui:
if (isset($_SERVER)) {
$SERVER_NAME = $_SERVER['SERVER_NAME'];
$SERVER_PORT = $_SERVER['SERVER_PORT'];
$SCRIPT_NAME = isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
$HTTPS = $_SERVER['HTTPS'];
} elseif (isset($HTTP_SERVER_VARS)) {
$SERVER_NAME = $HTTP_SERVER_VARS['SERVER_NAME'];
$SERVER_PORT = $HTTP_SERVER_VARS['SERVER_PORT'];
$SCRIPT_NAME = isset($HTTP_SERVER_VARS['PHP_SELF']) ? $HTTP_SERVER_VARS['PHP_SELF'] : $HTTP_SERVER_VARS['SCRIPT_NAME'];
$HTTPS = $HTTP_SERVER_VARS['HTTPS'];
}
//questo è un problema probabilmente dato dal fatto che io non ho ssl ecc sul mio server, come posso modificarlo facendo diventare http e non https? Giusto per provarlo, poi ce lo metto...
//riga 6506
$this->wsdl =& new wsdl($this->wsdlFile,$this->proxyhost,$this->proxyport,$this->proxyusername,$this->proxypassword,$this->timeout,$this->response_timeout);
Ecco... non so se c'è un file nusoap più corretto o che funzioni oppure devo cambiare io delle cose nel mio script...
Qualcuno sa spiegarmi?
Grazie mille