Drupal 7 Drupal定制服务(服务模块)

Drupal 7 Drupal定制服务(服务模块),drupal-7,drupal-services,Drupal 7,Drupal Services,我已经注册了一个服务,当我调用它时,调用本身可以工作,但是返回的数据是“false”。我不知道我做错了什么,也找不到相关信息。有人能帮我吗 function services_sso_server_extension_services_resources() { return array( 'mia' => array( 'actions' => array( 'retrieve' => array

我已经注册了一个服务,当我调用它时,调用本身可以工作,但是返回的数据是“false”。我不知道我做错了什么,也找不到相关信息。有人能帮我吗

function services_sso_server_extension_services_resources() {
    return array(
        'mia' => array(
            'actions' => array(
                'retrieve' => array(
                    //'help' => 'retrieves the corresponding user on the server',
                    'file' => array('type' => 'inc', 'module' => 'services_sso_server_extension', 'name' => 'resources/extension'),
                    'callback' => '_sso_server_retrieve',
                    'args' => array(
                        array(
                            'name' => 'id',
                            'type' => 'int',
                            'description' => 'The id of the note to get',
                            'source' => array('path' => '0'),
                            'optional' => TRUE,
                        ),
                    ),
                    'access callback' => '_sso_server_access',
                    'file' => array('type' => 'inc', 'module' => 'services_sso_server_extension', 'name' => 'resources/extension'),
                    'access arguments' => array('view'),
                    'access arguments append' => TRUE,
                ),
                'action' => array(
                    //'help' => 'retrieves the corresponding user on the server',
                    'file' => array('type' => 'inc', 'module' => 'services_sso_server_extension', 'name' => 'resources/extension'),
                    'callback' => '_sso_server_get_action',
                    'args' => array(
                        array(
                            'name' => 'clientsid',
                            'type' => 'varchar',
                            'description' => 'The sid of the client to which the communication is bound',
                            'source' => array('path' => '0'),
                            'optional' => TRUE,
                        ),
                    ),
                    'access callback' => '_sso_server_access',
                    'file' => array('type' => 'inc', 'module' => 'services_sso_server_extension', 'name' => 'resources/extension'),
                    'access arguments' => array('view'),
                    'access arguments append' => TRUE,
                ),
            ),
        ),
    );
}
我在其他地方使用此代码来调用它:

 function services_checkuser() {
    global $user;
    $sid = $user->sid;

    $options = array(
        'headers' => array(
            'Cookie' => $_SESSION['gsid'],
            'Accept' => 'application/json',
            'clientsid' => $sid
        ),
        'method' => 'POST',
    );

    $response = drupal_http_request('http://sso.server:8080/usercheck/mia/action', $options);
    $data = json_decode($response->data);
}

好的,我发现了如何发布数据:

$data = array('gsid' => $gsid);

$options = array(
    'headers' => array(
        'Cookie' => $_SESSION['broker_sid'],
        'Accept' => 'application/json',
    ),
    'method' => 'POST',
    'data' => http_build_query($data)
);