Custom web service returns param help

Custom web service returns param help

by Nitin Agrawal -
Number of replies: 0

Guys, I want to get object as a returns from my custom web services rather then array. So what changes will require in below function to do the same.

public static function get_remote_data_returns() {
        return new external_multiple_structure(
            new external_single_structure(
                array(                    
                    'param1' => new external_value(PARAM_INT, 'param1'),
                    'param2' => new external_value(PARAM_INT, 'param1')
                )
            )
        );        
   }

Is it mandatory to define return param on above method? Actually we need to generate dynamic returns param depends on our result. So is it any possibility for the same?

Thanks in advance smile

Average of ratings: -