View Issue Details

IDProjectCategoryView StatusLast Update
0008602mantisbtapi soappublic2007-12-20 01:35
Reportervboctor Assigned Tovboctor  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version1.1.0rc2 
Target Version1.1.0Fixed in Version1.1.0 
Summary0008602: Provide a SOAP friendly error handler
Description

If the Mantis core APIs trigger an error, the default Mantis error handler is used which generates HTML and break SOAP. Currently the SOAP API avoids such errors by duplicating the checks that are done in the APIs. The proper solution is to provide a SOAP friendly error handler so that when the core API trigger an error, the appropriate soap error is returned to the webservice client.

The following implementation was contributed by Damien Chevalier:
set_error_handler('mciErrorHandler');

function mciErrorHandler($iErrorCode, $sErrorInfo, $sErrorFile, $iErrorLine) {
global $oServer;
switch($sErrorInfo) {
case ERROR_USER_NOT_FOUND : // same custom handling
$oServer->fault('Server', 'Informations de connection incorrect');
break;
default :
$oServer->fault('Server', 'Erreur inconnu : $iErrorCode = "'.$iErrorCode.'", $sErrorInfo = "'.$sErrorInfo.'", $sErrorFile = "'.$sErrorFile.'", $iErrorLine = "'.$iErrorLine.'"');
break;
}

$oServer->send_response();
exit();

}

TagsNo tags attached.

Activities

vboctor

vboctor

2007-11-24 17:01

manager   ~0016280

I think this is important for 1.1.x branch since in the case where the web service generates HTML error messages, the web service clients break.

In 1.1.0, this change will only affect the error checks that are done by the API but are not also done by the web service soap api.

In 1.2.0. the redundant checks in the soap apis will be removed and checks will only be handled by the core APIs, which will trigger the error in the right format expected by the web service client.

vboctor

vboctor

2007-11-28 01:45

manager   ~0016313

Fixed for 1.1.0rc4 by svn:4798
Fixed for SVN HEAD by svn:4799