NULL_POINTER while creating transferType

Any issue about Cyclos 4 scripting and Webservices

Moderators: hugo, alexandre, rmvanarkel

Post Reply
faisal
Posts: 6
Joined: Sun Feb 16, 2020 9:50 pm

NULL_POINTER while creating transferType

Post by faisal »

Hi i am trying to create a transfer type using cyclos library 4.8
what i am trying to do is call the getDataForNew function and get the result. Then call the TransferTypeService.save to save it

but while i am calling getDataForNew i got below error

stdClass Object
(
[class] => java.lang.NullPointerException
[errorCode] => NULL_POINTER
)
Error while calling transferTypeService.getDataForNew: NULL_POINTER

Code: Select all


    require_once 'configureCyclos.php';


    Cyclos\Configuration::setAuthentication("username", "pass");
    $TransferTypeService = new Cyclos\TransferTypeService();

    try {
        $ac = new stdClass;
        $ac->class = "org.cyclos.model.banking.accounttypes.AccountTypeVO";
        $ac->id = 'id';

        $fac = new stdClass;
        $fac->class = "org.cyclos.model.banking.accounttypes.AccountTypeVO";
        $fac->id = 'id';


        $data = new stdClass();
        $data->operation = "getDataForNew";
        $data->params = array(
            "class" => "org.cyclos.model.banking.transfertypes.TransferTypeDataParams",
            'id' => 'id',
            'nature' => 'PAYMENT'
        );
        array_push($data->params,$ac,$fac);

        $getNew = $TransferTypeService->getDataForNew($data);
        echo "<pre>";
        print_r($getNew);

    } catch (Cyclos\ServiceException $e) {
        echo "<pre>";
        print_r($e->error);
        echo("Error while calling $e->service.$e->operation: $e->errorCode");
    }


can someone please point me my mistake
Post Reply