LassoIdWsf2DataService

LassoIdWsf2DataService — ID-WSF 2.0 Data Service profile

Synopsis


#include <lasso/lasso.h>

                    LassoIdWsf2DataService;
LassoIdWsf2DataService* lasso_idwsf2_data_service_new   (LassoServer *server);
LassoIdWsf2DataService* lasso_idwsf2_data_service_new_full
                                                        (LassoServer *server,
                                                         LassoWsAddrEndpointReference *epr);
gint                lasso_idwsf2_data_service_init_query
                                                        (LassoIdWsf2DataService *service);
gint                lasso_idwsf2_data_service_add_query_item
                                                        (LassoIdWsf2DataService *service,
                                                         const gchar *item_xpath,
                                                         const gchar *item_id);
gint                lasso_idwsf2_data_service_process_query_msg
                                                        (LassoIdWsf2DataService *service,
                                                         const gchar *message);
gint                lasso_idwsf2_data_service_parse_query_items
                                                        (LassoIdWsf2DataService *service);
gint                lasso_idwsf2_data_service_process_query_response_msg
                                                        (LassoIdWsf2DataService *service,
                                                         const gchar *message);
GList*              lasso_idwsf2_data_service_get_attribute_nodes
                                                        (LassoIdWsf2DataService *service,
                                                         const gchar *item_id);
xmlNode*            lasso_idwsf2_data_service_get_attribute_node
                                                        (LassoIdWsf2DataService *service,
                                                         const gchar *item_id);
GList*              lasso_idwsf2_data_service_get_attribute_strings
                                                        (LassoIdWsf2DataService *service,
                                                         const gchar *item_id);
gchar*              lasso_idwsf2_data_service_get_attribute_string
                                                        (LassoIdWsf2DataService *service,
                                                         const gchar *item_id);
gint                lasso_idwsf2_data_service_init_redirect_user_for_consent
                                                        (LassoIdWsf2DataService *service,
                                                         const gchar *redirect_url);
gint                lasso_idwsf2_data_service_init_modify
                                                        (LassoIdWsf2DataService *service);
gint                lasso_idwsf2_data_service_add_modify_item
                                                        (LassoIdWsf2DataService *service,
                                                         const gchar *item_xpath,
                                                         const gchar *item_id,
                                                         const gchar *new_data,
                                                         gboolean overrideAllowed);
gint                lasso_idwsf2_data_service_process_modify_msg
                                                        (LassoIdWsf2DataService *service,
                                                         const gchar *message);
gint                lasso_idwsf2_data_service_parse_modify_items
                                                        (LassoIdWsf2DataService *service);
gint                lasso_idwsf2_data_service_process_modify_response_msg
                                                        (LassoIdWsf2DataService *service,
                                                         const gchar *message);

Description

DataService allows Attribute Consumers (WSC) to request an Attribute Provider (WSP) to get or modify data about users with their consent.

Details

LassoIdWsf2DataService

typedef struct {
	LassoIdWsf2Profile parent;

	xmlNode *data;
	gchar *type;
	gchar *redirect_url;
	GList *query_items; /* of strings */
} LassoIdWsf2DataService;


lasso_idwsf2_data_service_new ()

LassoIdWsf2DataService* lasso_idwsf2_data_service_new   (LassoServer *server);

Create a new LassoIdWsf2DataService.

server :

the LassoServer

Returns :

a newly created LassoIdWsf2DataService object

lasso_idwsf2_data_service_new_full ()

LassoIdWsf2DataService* lasso_idwsf2_data_service_new_full
                                                        (LassoServer *server,
                                                         LassoWsAddrEndpointReference *epr);

Create a new LassoIdWsf2DataService.

server :

the LassoServer

epr :

the LassoWsAddrEndpointReference

Returns :

a newly created LassoIdWsf2DataService object; or NULL if an error occured.

lasso_idwsf2_data_service_init_query ()

gint                lasso_idwsf2_data_service_init_query
                                                        (LassoIdWsf2DataService *service);

Initialise an ID-WSF 2.0 DataService query request.

service :

a LassoIdWsf2DataService

Returns :

0 on success; or a negative value otherwise.

lasso_idwsf2_data_service_add_query_item ()

gint                lasso_idwsf2_data_service_add_query_item
                                                        (LassoIdWsf2DataService *service,
                                                         const gchar *item_xpath,
                                                         const gchar *item_id);

Add an item in the query request.

service :

a LassoIdWsf2DataService

item_xpath :

XPATH of the queried item

item_id :

identifier of the queried item, which will allow to retrieve it in the response

Returns :

0 on success; or a negative value otherwise.

lasso_idwsf2_data_service_process_query_msg ()

gint                lasso_idwsf2_data_service_process_query_msg
                                                        (LassoIdWsf2DataService *service,
                                                         const gchar *message);

Process received query request. Parse query items and put the list of queried XPATH into service->query_items.

service :

a LassoIdWsf2DataService

message :

received query soap request

Returns :

0 on success; or a negative value otherwise.

lasso_idwsf2_data_service_parse_query_items ()

gint                lasso_idwsf2_data_service_parse_query_items
                                                        (LassoIdWsf2DataService *service);

Parse query items and user data from service->data and fill response->Data accordingly. Set response status code to OK is all items were parsed correctly, FAILED if no item was parsed correctly, or PARTIAL if some items were parsed corretly and some others not.

service :

a LassoIdWsf2DataService

Returns :

0 on success; or a negative value otherwise.

lasso_idwsf2_data_service_process_query_response_msg ()

gint                lasso_idwsf2_data_service_process_query_response_msg
                                                        (LassoIdWsf2DataService *service,
                                                         const gchar *message);

Process received query response. Check if the response if a normal response or a soap fault. Check response status code.

service :

a LassoIdWsf2DataService

message :

received query soap response

Returns :

0 on success; or a negative value otherwise.

lasso_idwsf2_data_service_get_attribute_nodes ()

GList*              lasso_idwsf2_data_service_get_attribute_nodes
                                                        (LassoIdWsf2DataService *service,
                                                         const gchar *item_id);

Get one of several items for specified item_id and return them raw as a list of xmlnodes.

service :

a LassoIdWsf2DataService

item_id :

identifier of the item to retrieve

Returns :

a list of xmlnodes; or NULL if no item with the specified item_id was found.

lasso_idwsf2_data_service_get_attribute_node ()

xmlNode*            lasso_idwsf2_data_service_get_attribute_node
                                                        (LassoIdWsf2DataService *service,
                                                         const gchar *item_id);

Get one item for specified item_id and return it raw as an xmlnode.

service :

a LassoIdWsf2DataService

item_id :

identifier of the item to retrieve

Returns :

an xmlnode; or NULL if no item with the specified item_id was found.

lasso_idwsf2_data_service_get_attribute_strings ()

GList*              lasso_idwsf2_data_service_get_attribute_strings
                                                        (LassoIdWsf2DataService *service,
                                                         const gchar *item_id);

Get one of several items for specified item_id and return their content as a list of strings.

service :

a LassoIdWsf2DataService

item_id :

identifier of the item to retrieve

Returns :

a list of strings; or NULL if no item with the specified item_id was found.

lasso_idwsf2_data_service_get_attribute_string ()

gchar*              lasso_idwsf2_data_service_get_attribute_string
                                                        (LassoIdWsf2DataService *service,
                                                         const gchar *item_id);

Get one item for specified item_id and return its content as a string.

service :

a LassoIdWsf2DataService

item_id :

identifier of the item to retrieve

Returns :

a string; or NULL if no item with the specified item_id was found.

lasso_idwsf2_data_service_init_redirect_user_for_consent ()

gint                lasso_idwsf2_data_service_init_redirect_user_for_consent
                                                        (LassoIdWsf2DataService *service,
                                                         const gchar *redirect_url);

Initialise a soap fault response to ask the requesting service to redirect to the redirect_url.

service :

a LassoIdWsf2DataService

redirect_url :

URL to ask for redirection

Returns :

0 on success; or a negative value otherwise.

lasso_idwsf2_data_service_init_modify ()

gint                lasso_idwsf2_data_service_init_modify
                                                        (LassoIdWsf2DataService *service);

Initialise an ID-WSF 2.0 DataService modify request.

service :

a LassoIdWsf2DataService

Returns :

0 on success; or a negative value otherwise.

lasso_idwsf2_data_service_add_modify_item ()

gint                lasso_idwsf2_data_service_add_modify_item
                                                        (LassoIdWsf2DataService *service,
                                                         const gchar *item_xpath,
                                                         const gchar *item_id,
                                                         const gchar *new_data,
                                                         gboolean overrideAllowed);

Add an item in the modification request.

service :

a LassoIdWsf2DataService

item_xpath :

XPATH of the item to modify

item_id :

identifier of the item to modify

new_data :

new value for the selected item

overrideAllowed :

FALSE means only allowing to create a new item, but not modify existing one, TRUE means allowing to modify existing item

Returns :

0 on success; or a negative value otherwise.

lasso_idwsf2_data_service_process_modify_msg ()

gint                lasso_idwsf2_data_service_process_modify_msg
                                                        (LassoIdWsf2DataService *service,
                                                         const gchar *message);

Process received modify request.

service :

a LassoIdWsf2DataService

message :

received modify soap request

Returns :

0 on success; or a negative value otherwise.

lasso_idwsf2_data_service_parse_modify_items ()

gint                lasso_idwsf2_data_service_parse_modify_items
                                                        (LassoIdWsf2DataService *service);

Parse modify items and modify service->data accordingly.

service :

a LassoIdWsf2DataService

Returns :

0 on success; or a negative value otherwise.

lasso_idwsf2_data_service_process_modify_response_msg ()

gint                lasso_idwsf2_data_service_process_modify_response_msg
                                                        (LassoIdWsf2DataService *service,
                                                         const gchar *message);

Process received modify response. Check response status code.

service :

a LassoIdWsf2DataService

message :

received modify soap response

Returns :

0 on success; or a negative value otherwise.