summaryrefslogtreecommitdiffstats
path: root/lasso
diff options
context:
space:
mode:
Diffstat (limited to 'lasso')
-rw-r--r--lasso/errors.h2
-rw-r--r--lasso/id-wsf-2.0/data_service.c58
-rw-r--r--lasso/id-wsf-2.0/data_service.h23
-rw-r--r--lasso/xml/id-wsf-2.0/dstref_query.c4
-rw-r--r--lasso/xml/id-wsf-2.0/dstref_query.h5
5 files changed, 69 insertions, 23 deletions
diff --git a/lasso/errors.h b/lasso/errors.h
index 2d54ca23..73005372 100644
--- a/lasso/errors.h
+++ b/lasso/errors.h
@@ -103,6 +103,8 @@
#define LASSO_PROFILE_ERROR_STATUS_NOT_SUCCESS -432
#define LASSO_PROFILE_ERROR_MISSING_ISSUER -433
#define LASSO_PROFILE_ERROR_MISSING_SERVICE_INSTANCE -434
+#define LASSO_PROFILE_ERROR_MISSING_ENDPOINT_REFERENCE -435
+#define LASSO_PROFILE_ERROR_MISSING_ENDPOINT_REFERENCE_ADDRESS -436
/* functions/methods parameters checking */
#define LASSO_PARAM_ERROR_BAD_TYPE_OR_NULL_OBJ -501
diff --git a/lasso/id-wsf-2.0/data_service.c b/lasso/id-wsf-2.0/data_service.c
index fbdb0f4b..aa0fabe7 100644
--- a/lasso/id-wsf-2.0/data_service.c
+++ b/lasso/id-wsf-2.0/data_service.c
@@ -27,8 +27,8 @@
#include <lasso/id-wsf-2.0/discovery.h>
#include <lasso/id-wsf-2.0/data_service.h>
-/* #include <lasso/xml/id-wsf-2.0/dst_query.h> */
-/* #include <lasso/xml/id-wsf-2.0/dst_query_response.h> */
+#include <lasso/xml/id-wsf-2.0/dstref_query.h>
+/* #include <lasso/xml/id-wsf-2.0/dstref_query_response.h> */
struct _LassoIdWsf2DataServicePrivate
{
@@ -41,6 +41,60 @@ struct _LassoIdWsf2DataServicePrivate
/* public methods */
/*****************************************************************************/
+gint
+lasso_idwsf2_data_service_init_query(LassoIdWsf2DataService *service)
+{
+ LassoWsf2Profile *profile = LASSO_WSF2_PROFILE(service);
+ LassoIdWsf2DstRefQuery *query;
+ LassoWsAddrEndpointReference *epr;
+
+ query = lasso_idwsf2_dstref_query_new();
+
+ profile->request = LASSO_NODE(query);
+
+ if (service == NULL || service->private_data == NULL
+ || service->private_data->epr == NULL) {
+ return LASSO_PROFILE_ERROR_MISSING_ENDPOINT_REFERENCE;
+ }
+
+ epr = service->private_data->epr;
+
+ lasso_wsf2_profile_init_soap_request(profile, LASSO_NODE(query));
+
+ if (epr->Address != NULL) {
+ profile->msg_url = g_strdup(epr->Address->content);
+ } else {
+ return LASSO_PROFILE_ERROR_MISSING_ENDPOINT_REFERENCE_ADDRESS;
+ }
+
+ /* Add needed credential for remote service */
+
+ return 0;
+}
+
+LassoIdWsf2DstRefQueryItem*
+lasso_idwsf2_data_service_add_query_item(LassoIdWsf2DataService *service, const gchar *item_xpath,
+ const gchar *item_id)
+{
+ LassoWsf2Profile *profile = LASSO_WSF2_PROFILE(service);
+ LassoIdWsf2DstRefQuery *query;
+ LassoIdWsf2DstRefQueryItem *item;
+
+ g_return_val_if_fail(LASSO_IS_IDWSF2_DATA_SERVICE(service), NULL);
+ g_return_val_if_fail(item_xpath != NULL, NULL);
+ g_return_val_if_fail(item_id != NULL, NULL);
+
+ if (! LASSO_IS_IDWSF2_DSTREF_QUERY(profile->request)) {
+ return NULL;
+ }
+
+ query = LASSO_IDWSF2_DSTREF_QUERY(profile->request);
+
+ item = lasso_idwsf2_dstref_query_item_new_full(item_xpath, item_id);
+ query->QueryItem = g_list_append(query->QueryItem, item);
+
+ return item;
+}
/*****************************************************************************/
/* private methods */
diff --git a/lasso/id-wsf-2.0/data_service.h b/lasso/id-wsf-2.0/data_service.h
index 807b52d4..3c43c8cc 100644
--- a/lasso/id-wsf-2.0/data_service.h
+++ b/lasso/id-wsf-2.0/data_service.h
@@ -32,9 +32,12 @@ extern "C" {
#include <lasso/id-wsf-2.0/wsf2_profile.h>
+#include <lasso/xml/xml.h>
+
+#include <lasso/xml/id-wsf-2.0/dstref_query_item.h>
+
#include <lasso/xml/ws/wsa_endpoint_reference.h>
-#include <lasso/xml/xml.h>
#define LASSO_TYPE_IDWSF2_DATA_SERVICE (lasso_idwsf2_data_service_get_type())
#define LASSO_IDWSF2_DATA_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \
@@ -76,22 +79,10 @@ LASSO_EXPORT LassoIdWsf2DataService* lasso_idwsf2_data_service_new();
LASSO_EXPORT LassoIdWsf2DataService* lasso_idwsf2_data_service_new_full(LassoServer *server,
LassoWsAddrEndpointReference *epr);
-/* LASSO_EXPORT gint lasso_idwsf2_data_service_init_query(LassoIdWsf2DataService *service); */
-
-/* LASSO_EXPORT LassoDstQueryItem* lasso_idwsf2_data_service_add_query_item(LassoIdWsf2DataService *service, */
-/* const char *select, const char *item_id); */
-
-/* LASSO_EXPORT gint lasso_idwsf2_data_service_process_query_msg(LassoIdWsf2DataService *service, */
-/* const char *message); */
-
-/* LASSO_EXPORT gint lasso_idwsf2_data_service_build_response_msg(LassoIdWsf2DataService *service); */
-
-/* LASSO_EXPORT gint lasso_idwsf2_data_service_process_query_response_msg(LassoIdWsf2DataService *service, */
-/* const char *message); */
-
-/* LASSO_EXPORT xmlNode* lasso_idwsf2_data_service_get_attribute_node(LassoIdWsf2DataService *service, */
-/* const char *item_id); */
+LASSO_EXPORT gint lasso_idwsf2_data_service_init_query(LassoIdWsf2DataService *service);
+LASSO_EXPORT LassoIdWsf2DstRefQueryItem* lasso_idwsf2_data_service_add_query_item(
+ LassoIdWsf2DataService *service, const gchar *item_xpath, const gchar *item_id);
#ifdef __cplusplus
}
diff --git a/lasso/xml/id-wsf-2.0/dstref_query.c b/lasso/xml/id-wsf-2.0/dstref_query.c
index 9f5f82b6..15954697 100644
--- a/lasso/xml/id-wsf-2.0/dstref_query.c
+++ b/lasso/xml/id-wsf-2.0/dstref_query.c
@@ -111,8 +111,8 @@ lasso_idwsf2_dstref_query_get_type()
*
* Return value: a newly created #LassoIdWsf2DstRefQuery object
**/
-LassoNode*
+LassoIdWsf2DstRefQuery*
lasso_idwsf2_dstref_query_new()
{
- return g_object_new(LASSO_TYPE_IDWSF2_DSTREF_QUERY, NULL);
+ return LASSO_IDWSF2_DSTREF_QUERY(g_object_new(LASSO_TYPE_IDWSF2_DSTREF_QUERY, NULL));
}
diff --git a/lasso/xml/id-wsf-2.0/dstref_query.h b/lasso/xml/id-wsf-2.0/dstref_query.h
index 3bda6534..ce35566c 100644
--- a/lasso/xml/id-wsf-2.0/dstref_query.h
+++ b/lasso/xml/id-wsf-2.0/dstref_query.h
@@ -72,12 +72,11 @@ struct _LassoIdWsf2DstRefQueryClass {
};
LASSO_EXPORT GType lasso_idwsf2_dstref_query_get_type(void);
-LASSO_EXPORT LassoNode* lasso_idwsf2_dstref_query_new(void);
-
-
+LASSO_EXPORT LassoIdWsf2DstRefQuery* lasso_idwsf2_dstref_query_new(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __LASSO_IDWSF2_DSTREF_QUERY_H__ */
+