add new function in SOAP
Posted: 05 Jul 2011, 07:04
Hi All,
I'm trying to add new function in SOAP but it returning me an error :
so far my codes are :
bug_api
mc_issue_api
mantisconnect
Please help me and let me know what I missed.
Thanks
I'm trying to add new function in SOAP but it returning me an error :
Can anyone please guide me of how to add new function in SOAP?Fatal error: Uncaught SoapFault exception: [SOAP-ENV:Server] unable to serialize result
so far my codes are :
bug_api
Code: Select all
//attask task id
function bug_get_mantis_by_attask_id($attask_id){
$sql = 'SELECT * FROM mantis_attask_table WHERE attask_id ="' . $attask_id .'"';
$result = db_query($sql);
$rows = db_fetch_array($result);
return $rows;
}
Code: Select all
function mc_attask_exists( $p_username, $p_password, $p_attask_id ) {
$t_user_id = mci_check_login( $p_username, $p_password );
if( $t_user_id === false ) {
return mci_soap_fault_login_failed();
}
$attask_bug_info = bug_get_mantis_by_attask_id( $p_attask_id );
if( count($attask_bug_info) != 0 ) {
return $attask_bug_info;
}
return mci_null_if_empty($attask_bug_info);
}
mantisconnect
Code: Select all
### Attask mantis ID
$l_oServer->wsdl->addComplexType(
'AttaskMantis',
'complexType',
'struct',
'all',
'',
array(
'id' => array( 'name' => 'id', 'type' => 'xsd:string', 'minOccurs' => '0'),
'mantis_bug_table_id' => array( 'name' => 'mantis_bug_table_id', 'type' => 'xsd:string', 'minOccurs' => '0'),
'attask_id' => array( 'name' => 'attask_id', 'type' => 'xsd:string', 'minOccurs' => '0')
)
);
### AttaskMantisArray
$l_oServer->wsdl->addComplexType(
'AttaskMantisArray',
'complexType',
'array',
'',
'SOAP-ENC:Array',
array(),
array(array(
'ref' => 'SOAP-ENC:arrayType',
'wsdl:arrayType' => 'tns:AttaskMantis[]'
)),
'tns:AttaskMantis'
);
### mc_attask_exists
$l_oServer->register( 'mc_attask_exists',
array(
'username' => 'xsd:string',
'password' => 'xsd:string',
'attask_id' => 'xsd:string'
),
array(
'return' => 'tns:AttaskMantis'
),
$t_namespace,
false, false, false,
'Check there exists an issue with the specified attask_id.'
);
Thanks