PDA

View Full Version : [PHP] Problema connessione a webservice


Napalm
18-07-2008, 14:37
Io ho un ws java (wsdl) che con java e C# worka correttamente: ora stò provando a farlo funzionare con php.
Il client è questo:

<?php
$client = new SoapClient("http://10.0.0.63:5004/ITrackItemsWS?wsdl");


print("<pre>");
print_r($client->__getFunctions());
print("</pre>");
print("<hr />");

print("<pre>");
print_r($client->__getTypes());
print("</pre>");
print("<hr />");
try{

$client->checkConnection();

}catch (SoapFault $exception)
{
print("<pre>");
print($exception);
print("<pre>");
print("<hr />");
printHeaders($client);
}


?>

getFunctions e getTypes vengono eseguite correttamente e mi ritornano le funzioni che ho nel ws.

getFunctions per esempio è:
Array
(
[0] => insertAssociationResponse insertAssociation(insertAssociation $parameters)
[1] => checkConnectionResponse checkConnection(checkConnection $parameters)
[2] => checkOutItemResponse checkOutItem(checkOutItem $parameters)
[3] => getLastTagCodeByTagTypeResponse getLastTagCodeByTagType(getLastTagCodeByTagType $parameters)
[4] => checkInItemResponse checkInItem(checkInItem $parameters)
[5] => getNumberOfMonitorablesResponse getNumberOfMonitorables(getNumberOfMonitorables $parameters)
[6] => loginDeviceResponse loginDevice(loginDevice $parameters)
[7] => getDeviceStatusResponse getDeviceStatus(getDeviceStatus $parameters)
[8] => checkDupplicateItemResponse checkDupplicateItem(checkDupplicateItem $parameters)
[9] => insertMovimentResponse insertMoviment(insertMoviment $parameters)
[10] => setDeviceOkResponse setDeviceOk(setDeviceOk $parameters)
[11] => canExitResponse canExit(canExit $parameters)
[12] => getEPCResponse getEPC(getEPC $parameters)
[13] => createAssociationResponse createAssociation(createAssociation $parameters)
[14] => getTypeAssociationResponse getTypeAssociation(getTypeAssociation $parameters)
[15] => loginUserResponse loginUser(loginUser $parameters)
)


quando però provo a chiamare (senza parametri perchè così è scritta nel ws):

$client->checkConnection();

va in errore:
SoapFault exception: [HTTP] Not Found in /var/www/testsoap_1.php:16
Stack trace:
#0 [internal function]: SoapClient->__doRequest('__call('checkConnection', Array)
#2 /var/www/testsoap_1.php(16): SoapClient->checkConnection()
#3 {main}

come se non trovasse la funzione o qualcosa di simile.

Nel mio ws NON MODIFICABILE ho questa stringa:

<wsdlsoap:address location="http://localhost/services/ITrackItemsWS"/>

creata automaticamente quando parte il ws java ma non penso che sia errata perchè con java e C# funziona... dove può essere l'errore?

NapalM