From 4adc5b5847659c92c028eb6dee4841c8a14ec8ef Mon Sep 17 00:00:00 2001 From: Frederic Peters Date: Thu, 25 Aug 2005 07:19:27 +0000 Subject: renamed ProfileService to DataService --- docs/reference/lasso-sections.txt | 34 +- docs/reference/lasso.sgml | 6 +- docs/reference/tmpl/data_service.sgml | 99 ++++ docs/reference/tmpl/defederation.sgml | 3 + docs/reference/tmpl/federation.sgml | 3 + docs/reference/tmpl/identity.sgml | 3 + docs/reference/tmpl/lib_authn_request.sgml | 3 + docs/reference/tmpl/login.sgml | 3 + docs/reference/tmpl/logout.sgml | 3 + docs/reference/tmpl/name_identifier_mapping.sgml | 3 + docs/reference/tmpl/name_registration.sgml | 3 + docs/reference/tmpl/node.sgml | 3 + docs/reference/tmpl/profile.sgml | 3 + docs/reference/tmpl/provider.sgml | 3 + docs/reference/tmpl/saml_name_identifier.sgml | 3 + docs/reference/tmpl/server.sgml | 7 +- docs/reference/tmpl/session.sgml | 3 + docs/reference/tmpl/strings.sgml | 3 + lasso/Makefile.am | 5 +- lasso/id-ff/providerprivate.h | 2 +- lasso/id-wsf/Makefile.am | 6 +- lasso/id-wsf/data_service.c | 583 +++++++++++++++++++++++ lasso/id-wsf/data_service.h | 114 +++++ lasso/id-wsf/data_service_private.h | 40 ++ lasso/id-wsf/discovery.c | 12 +- lasso/id-wsf/discovery.h | 4 +- lasso/id-wsf/personal_profile_service.c | 6 +- lasso/id-wsf/personal_profile_service.h | 6 +- lasso/id-wsf/profile_service.c | 583 ----------------------- lasso/id-wsf/profile_service.h | 114 ----- lasso/id-wsf/profile_service_private.h | 40 -- swig/Lasso-wsf.i | 154 +++--- 32 files changed, 1003 insertions(+), 854 deletions(-) create mode 100644 docs/reference/tmpl/data_service.sgml create mode 100644 lasso/id-wsf/data_service.c create mode 100644 lasso/id-wsf/data_service.h create mode 100644 lasso/id-wsf/data_service_private.h delete mode 100644 lasso/id-wsf/profile_service.c delete mode 100644 lasso/id-wsf/profile_service.h delete mode 100644 lasso/id-wsf/profile_service_private.h diff --git a/docs/reference/lasso-sections.txt b/docs/reference/lasso-sections.txt index 41c83092..323a9546 100644 --- a/docs/reference/lasso-sections.txt +++ b/docs/reference/lasso-sections.txt @@ -1030,23 +1030,23 @@ LASSO_DISCOVERY_GET_CLASS
-profile_service -LassoProfileService -LassoProfileService -lasso_profile_service_new -lasso_profile_service_init_query -lasso_profile_service_add_query_item -lasso_profile_service_process_query_msg -lasso_profile_service_build_response_msg -lasso_profile_service_process_query_response_msg -lasso_profile_service_get_answer +data_service +LassoDataService +LassoDataService +lasso_data_service_new +lasso_data_service_init_query +lasso_data_service_add_query_item +lasso_data_service_process_query_msg +lasso_data_service_build_response_msg +lasso_data_service_process_query_response_msg +lasso_data_service_get_answer -LASSO_PROFILE_SERVICE -LASSO_IS_PROFILE_SERVICE -LASSO_TYPE_PROFILE_SERVICE -lasso_profile_service_get_type -LASSO_PROFILE_SERVICE_CLASS -LASSO_IS_PROFILE_SERVICE_CLASS -LASSO_PROFILE_SERVICE_GET_CLASS +LASSO_DATA_SERVICE +LASSO_IS_DATA_SERVICE +LASSO_TYPE_DATA_SERVICE +lasso_data_service_get_type +LASSO_DATA_SERVICE_CLASS +LASSO_IS_DATA_SERVICE_CLASS +LASSO_DATA_SERVICE_GET_CLASS
diff --git a/docs/reference/lasso.sgml b/docs/reference/lasso.sgml index 420e823e..d5f41961 100644 --- a/docs/reference/lasso.sgml +++ b/docs/reference/lasso.sgml @@ -56,6 +56,8 @@ + + ]> @@ -189,8 +191,8 @@ the GNU General Public License< Identity Web Services Framework - - + &LassoDiscovery; + &LassoDataService; diff --git a/docs/reference/tmpl/data_service.sgml b/docs/reference/tmpl/data_service.sgml new file mode 100644 index 00000000..c2c49469 --- /dev/null +++ b/docs/reference/tmpl/data_service.sgml @@ -0,0 +1,99 @@ + +LassoDataService + + +ID-WSF Data Service Profile + + + + + + + + + + + + + + + + + + + +@parent: +@resource_id: +@encrypted_resource_id: +@resource_data: + + + + + + +@server: +@Returns: + + + + + + + +@service: +@select: +@item_id: +@Returns: + + + + + + + +@service: +@select: +@item_id: +@Returns: + + + + + + + +@service: +@message: +@Returns: + + + + + + + +@service: +@Returns: + + + + + + + +@service: +@message: +@Returns: + + + + + + + +@service: +@select: +@Returns: + + diff --git a/docs/reference/tmpl/defederation.sgml b/docs/reference/tmpl/defederation.sgml index e5e89751..42feedff 100644 --- a/docs/reference/tmpl/defederation.sgml +++ b/docs/reference/tmpl/defederation.sgml @@ -14,6 +14,9 @@ Federation Termination Notification Profile + + + diff --git a/docs/reference/tmpl/federation.sgml b/docs/reference/tmpl/federation.sgml index fdb39469..ce462599 100644 --- a/docs/reference/tmpl/federation.sgml +++ b/docs/reference/tmpl/federation.sgml @@ -14,6 +14,9 @@ Principal federation between two providers + + + diff --git a/docs/reference/tmpl/identity.sgml b/docs/reference/tmpl/identity.sgml index e681be2d..65e2e63f 100644 --- a/docs/reference/tmpl/identity.sgml +++ b/docs/reference/tmpl/identity.sgml @@ -14,6 +14,9 @@ Principal Identity + + + diff --git a/docs/reference/tmpl/lib_authn_request.sgml b/docs/reference/tmpl/lib_authn_request.sgml index 827d988a..6124dcc9 100644 --- a/docs/reference/tmpl/lib_authn_request.sgml +++ b/docs/reference/tmpl/lib_authn_request.sgml @@ -21,6 +21,9 @@ profile. + + + @ProviderID is the service provider identifier, this field will often be filled diff --git a/docs/reference/tmpl/login.sgml b/docs/reference/tmpl/login.sgml index 2d49f94e..1ac1502b 100644 --- a/docs/reference/tmpl/login.sgml +++ b/docs/reference/tmpl/login.sgml @@ -129,6 +129,9 @@ printf("Location: /\n\nRedirected to site root\n"); + + + Single sign-on profile for the current transaction; possibly an diff --git a/docs/reference/tmpl/logout.sgml b/docs/reference/tmpl/logout.sgml index a6418e9e..7f8b27b3 100644 --- a/docs/reference/tmpl/logout.sgml +++ b/docs/reference/tmpl/logout.sgml @@ -14,6 +14,9 @@ Single Logout Profile + + + diff --git a/docs/reference/tmpl/name_identifier_mapping.sgml b/docs/reference/tmpl/name_identifier_mapping.sgml index 37e398f0..ead698e0 100644 --- a/docs/reference/tmpl/name_identifier_mapping.sgml +++ b/docs/reference/tmpl/name_identifier_mapping.sgml @@ -14,6 +14,9 @@ Name Identifier Mapping + + + diff --git a/docs/reference/tmpl/name_registration.sgml b/docs/reference/tmpl/name_registration.sgml index ab744050..bb4fe32a 100644 --- a/docs/reference/tmpl/name_registration.sgml +++ b/docs/reference/tmpl/name_registration.sgml @@ -14,6 +14,9 @@ Name Registration + + + diff --git a/docs/reference/tmpl/node.sgml b/docs/reference/tmpl/node.sgml index e7e2cf72..aa7f2947 100644 --- a/docs/reference/tmpl/node.sgml +++ b/docs/reference/tmpl/node.sgml @@ -15,6 +15,9 @@ defined in glib. + + + diff --git a/docs/reference/tmpl/profile.sgml b/docs/reference/tmpl/profile.sgml index 3b8e0267..7438d608 100644 --- a/docs/reference/tmpl/profile.sgml +++ b/docs/reference/tmpl/profile.sgml @@ -14,6 +14,9 @@ Base class for all ID-FF profiles + + + diff --git a/docs/reference/tmpl/provider.sgml b/docs/reference/tmpl/provider.sgml index 1faf17ba..8b2f667a 100644 --- a/docs/reference/tmpl/provider.sgml +++ b/docs/reference/tmpl/provider.sgml @@ -14,6 +14,9 @@ It holds all the data about a provider. + + + diff --git a/docs/reference/tmpl/saml_name_identifier.sgml b/docs/reference/tmpl/saml_name_identifier.sgml index 497522c0..e0d412e5 100644 --- a/docs/reference/tmpl/saml_name_identifier.sgml +++ b/docs/reference/tmpl/saml_name_identifier.sgml @@ -14,6 +14,9 @@ LassoSamlNameIdentifier + + + @NameQualifier is the provider ID of the provider that created the name diff --git a/docs/reference/tmpl/server.sgml b/docs/reference/tmpl/server.sgml index 9f81c2ee..bf444c29 100644 --- a/docs/reference/tmpl/server.sgml +++ b/docs/reference/tmpl/server.sgml @@ -15,6 +15,9 @@ certificates to use, etc. + + + @@ -34,9 +37,11 @@ certificates to use, etc. @metadata: @private_key: -@secret_key: +@private_key_password: @certificate: @Returns: + +@secret_key: diff --git a/docs/reference/tmpl/session.sgml b/docs/reference/tmpl/session.sgml index e1657369..b4003b86 100644 --- a/docs/reference/tmpl/session.sgml +++ b/docs/reference/tmpl/session.sgml @@ -14,6 +14,9 @@ Principal Session + + + diff --git a/docs/reference/tmpl/strings.sgml b/docs/reference/tmpl/strings.sgml index 332c5ed9..a9ef447d 100644 --- a/docs/reference/tmpl/strings.sgml +++ b/docs/reference/tmpl/strings.sgml @@ -14,6 +14,9 @@ strings + + + diff --git a/lasso/Makefile.am b/lasso/Makefile.am index 1b6286e7..1d704a9c 100644 --- a/lasso/Makefile.am +++ b/lasso/Makefile.am @@ -61,8 +61,9 @@ liblasso_la_LIBADD = \ # Just make damn sure the ABI stays the same between # upgrades. # Obviously if you don't, fixing the situation up again can be painful. -liblasso_la_LDFLAGS = -no-undefined -version-info @LASSO_VERSION_INFO@ \ - -export-symbols symbols.sym +liblasso_la_LDFLAGS = -no-undefined -version-info @LASSO_VERSION_INFO@ + +#-export-symbols symbols.sym endif .PHONY: types.c symbols.sym diff --git a/lasso/id-ff/providerprivate.h b/lasso/id-ff/providerprivate.h index b7714244..1ff7fdbf 100644 --- a/lasso/id-ff/providerprivate.h +++ b/lasso/id-ff/providerprivate.h @@ -39,7 +39,7 @@ gboolean lasso_provider_load_metadata(LassoProvider *provider, const gchar *meta int lasso_provider_verify_signature(LassoProvider *provider, const char *message, const char *id_attr_name, LassoMessageFormat format); LibertyConformanceLevel lasso_provider_compatibility_level(LassoProvider *provider); -void lasso_provider_load_public_key(LassoProvider *provider); +gboolean lasso_provider_load_public_key(LassoProvider *provider); #ifdef __cplusplus diff --git a/lasso/id-wsf/Makefile.am b/lasso/id-wsf/Makefile.am index 3510cc59..43d4a392 100644 --- a/lasso/id-wsf/Makefile.am +++ b/lasso/id-wsf/Makefile.am @@ -13,11 +13,11 @@ WSF_C_FILES = \ discovery.c \ interaction_profile_service.c \ personal_profile_service.c \ - profile_service.c \ + data_service.c \ wsf_profile.c lasso_private_h_sources = \ - profile_service_private.h + data_service_private.h WSF_H_FILES = \ authentication.h \ @@ -25,7 +25,7 @@ WSF_H_FILES = \ identity.h \ interaction_profile_service.h \ personal_profile_service.h \ - profile_service.h \ + data_service.h \ wsf_profile.h endif diff --git a/lasso/id-wsf/data_service.c b/lasso/id-wsf/data_service.c new file mode 100644 index 00000000..17232e39 --- /dev/null +++ b/lasso/id-wsf/data_service.c @@ -0,0 +1,583 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + + +struct _LassoDataServicePrivate +{ + gboolean dispose_has_run; + LassoDiscoResourceOffering *offering; +}; + +/*****************************************************************************/ +/* public methods */ +/*****************************************************************************/ + + +LassoDstModification* +lasso_data_service_add_modification(LassoDataService *service, const gchar *select) +{ + LassoWsfProfile *profile; + LassoDstModification *modification; + + g_return_val_if_fail(LASSO_IS_PROFILE_SERVICE(service), NULL); + g_return_val_if_fail(select != NULL, NULL); + + profile = LASSO_WSF_PROFILE(service); + + modification = lasso_dst_modification_new(select); + LASSO_DST_MODIFY(profile->request)->Modification = g_list_append( + LASSO_DST_MODIFY(profile->request)->Modification, (gpointer)modification); + + return modification; +} + + +/** + * lasso_data_service_add_query_item: + * @service: a #LassoDataService + * @select: resource selection string (typically a XPath query) + * @item_id: query item identifier + * + * Adds a dst:QueryItem to the current dst:Query request. + * + * Return value: a newly created #LassoDstQueryItem with the query item that + * has been created. Note that it is internally allocated and shouldn't + * be freed by the caller. + **/ +LassoDstQueryItem* +lasso_data_service_add_query_item(LassoDataService *service, + const char *select, const char *item_id) +{ + LassoDstQuery *query; + LassoDstQueryItem *item; + + g_return_val_if_fail(LASSO_IS_PROFILE_SERVICE(service), NULL); + g_return_val_if_fail(select != NULL, NULL); + + query = LASSO_DST_QUERY(LASSO_WSF_PROFILE(service)->request); + + if (LASSO_DST_QUERY_ITEM(query->QueryItem->data)->itemID == NULL) { + /* XXX: all items must have itemID if there is more than one */ + return NULL; + } + + item = lasso_dst_query_item_new(select, item_id); + query->QueryItem = g_list_append(query->QueryItem, item); + + return item; +} + +/** + * lasso_data_service_init_query + * @service: a #LassoDataService + * @select: resource selection string (typically a XPath query) + * @item_id: query item identifier (optional) + * + * Initializes a new dst:Query request, asking for element @select (with + * optional itemID set to @item_id) + * + * Return value: 0 on success; or a negative value otherwise. + **/ +gint +lasso_data_service_init_query(LassoDataService *service, const char *select, + const char *item_id) +{ + LassoWsfProfile *profile; + LassoDstQuery *query; + LassoDiscoResourceOffering *offering; + LassoDiscoDescription *description; + + profile = LASSO_WSF_PROFILE(service); + + query = lasso_dst_query_new(lasso_dst_query_item_new(select, item_id)); + profile->request = LASSO_NODE(query); + + offering = service->private_data->offering; + + query->hrefServiceType = g_strdup(offering->ServiceInstance->ServiceType); + if (strcmp(query->hrefServiceType, LASSO_PP_HREF) == 0) + query->prefixServiceType = g_strdup(LASSO_PP_PREFIX); + else if (strcmp(query->hrefServiceType, LASSO_EP_HREF) == 0) + query->prefixServiceType = g_strdup(LASSO_EP_PREFIX); + else { + /* unknown service type, (needs registration mechanism) */ + return LASSO_ERROR_UNDEFINED; + } + + if (offering->ResourceID) { + query->ResourceID = g_object_ref(offering->ResourceID); + } else if (offering->EncryptedResourceID) { + query->EncryptedResourceID = g_object_ref(offering->EncryptedResourceID); + } else { + /* XXX: no resource id, implied:resource, etc. */ + return LASSO_ERROR_UNIMPLEMENTED; + } + + profile->soap_envelope_request = lasso_wsf_profile_build_soap_envelope(NULL); + profile->soap_envelope_request->Body->any = g_list_append( + profile->soap_envelope_request->Body->any, query); + + description = lasso_discovery_get_description_auto(offering, LASSO_SECURITY_MECH_NULL); + + if (description->Endpoint != NULL) { + profile->msg_url = g_strdup(description->Endpoint); + } else { + /* XXX: else, description->WsdlURLI, get endpoint automatically */ + return LASSO_ERROR_UNIMPLEMENTED; + } + + return 0; +} + +/** + * lasso_data_service_process_query_msg: + * @service: a #LassoDataService + * @message: the dst query message + * + * Processes a dst:Query message. Rebuilds a request object from the message + * and extracts ResourceID. + * + * Return value: 0 on success; or a negative value otherwise. + **/ +gint +lasso_data_service_process_query_msg(LassoDataService *service, const char *message) +{ + LassoDstQuery *query; + LassoWsfProfile *profile; + int rc; + + profile = LASSO_WSF_PROFILE(service); + rc = lasso_wsf_profile_process_soap_request_msg(profile, message); + if (rc) { + return rc; + } + + query = LASSO_DST_QUERY(profile->request); + if (query->ResourceID) + service->resource_id = g_object_ref(query->ResourceID); + else if (query->EncryptedResourceID) + service->encrypted_resource_id = g_object_ref(query->EncryptedResourceID); + else { + return LASSO_ERROR_UNIMPLEMENTED; /* implied ? */ + } + + return 0; +} + +/** + * lasso_data_service_build_response_msg: + * @service: a #LassoDataService + * + * Builds a dst:QueryResponse message. + * + * Return value: 0 on success; or a negative value otherwise. + **/ +gint +lasso_data_service_build_response_msg(LassoDataService *service) +{ + LassoWsfProfile *profile; + LassoDstQuery *query; + LassoDstQueryResponse *response; + GList *iter; + xmlDoc *doc; + xmlXPathContext *xpathCtx; + xmlXPathObject *xpathObj; + LassoSoapEnvelope *envelope; + + profile = LASSO_WSF_PROFILE(service); + query = LASSO_DST_QUERY(profile->request); + + response = lasso_dst_query_response_new(lasso_utility_status_new(LASSO_DST_STATUS_CODE_OK)); + profile->response = LASSO_NODE(response); + response->prefixServiceType = g_strdup(query->prefixServiceType); + response->hrefServiceType = g_strdup(query->hrefServiceType); + envelope = profile->soap_envelope_response; + envelope->Body->any = g_list_append(envelope->Body->any, response); + + doc = xmlNewDoc((xmlChar*)"1.0"); + xmlDocSetRootElement(doc, service->resource_data); + xpathCtx = xmlXPathNewContext(doc); + xmlXPathRegisterNs(xpathCtx, (xmlChar*)response->prefixServiceType, + (xmlChar*)response->hrefServiceType); + + /* XXX: needs another level, since there may be more than one */ + iter = query->QueryItem; + while (iter) { + LassoDstQueryItem *item = iter->data; + xpathObj = xmlXPathEvalExpression((xmlChar*)item->Select, xpathCtx); + if (xpathObj && xpathObj->nodesetval && xpathObj->nodesetval->nodeNr) { + LassoDstData *data; + xmlNode *node = xpathObj->nodesetval->nodeTab[0]; + /* XXX: assuming there is only one matching node */ + data = lasso_dst_data_new(); + data->any = g_list_append(data->any, xmlCopyNode(node, 1)); + if (item->itemID) { + data->itemIDRef = g_strdup(item->itemID); + } + response->Data = g_list_append(response->Data, data); + } + iter = g_list_next(iter); + } + + xmlUnlinkNode(service->resource_data); + xmlFreeDoc(doc); + + return lasso_wsf_profile_build_soap_response_msg(profile); +} + +/** + * lasso_data_service_get_answer: + * @service: a #LassoDataService + * @select: resource selection string (typically a XPath query) + * + * Returns the answer for the specified @select request. + * + * Return value: the node (libxml2 xmlNode*); or NULL if it was not found. + * This xmlnode must be freed by caller. + **/ +xmlNode* +lasso_data_service_get_answer(LassoDataService *service, const char *select) +{ + LassoDstQueryResponse *response; + LassoDstData *data = NULL; + GList *iter; + char *item_id = NULL; + + response = LASSO_DST_QUERY_RESPONSE(LASSO_WSF_PROFILE(service)->response); + iter = LASSO_DST_QUERY(LASSO_WSF_PROFILE(service)->request)->QueryItem; + + if (select == NULL) { + /* if only one element; default to first */ + if (g_list_length(iter) > 1) + return NULL; + data = response->Data->data; + } else { + LassoDstQueryItem *item = NULL; + /* lookup select in query to get itemId, then get data with itemIdRef */ + /* XXX: needs another level, since there may be more than one dst:Query */ + while (iter) { + item = iter->data; + iter = g_list_next(iter); + if (strcmp(item->Select, select) == 0) { + break; + } + item = NULL; + } + + iter = LASSO_DST_QUERY(LASSO_WSF_PROFILE(service)->request)->QueryItem; + if (item == NULL) { + /* not found */ + return NULL; + } + item_id = item->itemID; + if (item_id == NULL) { + /* item_id is not mandatory when there is only one item */ + data = response->Data->data; + } + + iter = response->Data; + while (iter && item_id) { + LassoDstData *t = iter->data; + iter = g_list_next(iter); + if (strcmp(t->itemIDRef, item_id) == 0) { + data = t; + break; + } + } + if (data == NULL) { + /* not found */ + return NULL; + } + } + + /* XXX: there may be more than one xmlnode */ + return xmlCopyNode(data->any->data, 1); +} + +/** + * lasso_data_service_process_query_response_msg: + * @service: a #LassoDataService + * @message: the dst query response message + * + * Processes a dst:Query message. Rebuilds a request object from the message + * and extracts ResourcedID. + * + * Return value: 0 on success; or a negative value otherwise. + **/ +gint +lasso_data_service_process_query_response_msg(LassoDataService *service, const char *message) +{ + int rc; + LassoDstQueryResponse *response; + + rc = lasso_wsf_profile_process_soap_response_msg(LASSO_WSF_PROFILE(service), message); + if (rc) return rc; + + response = LASSO_DST_QUERY_RESPONSE(LASSO_WSF_PROFILE(service)->response); + if (strcmp(response->Status->code, "OK") != 0) + return LASSO_ERROR_UNDEFINED; + + return 0; +} + + +gint +lasso_data_service_init_modify(LassoDataService *service, const gchar *select) +{ + LassoDstModification *modification; + LassoWsfProfile *profile; + LassoDiscoResourceOffering *offering; + LassoDiscoDescription *description; + + LassoSoapEnvelope *envelope; + LassoDstModify *modify; + + + profile = LASSO_WSF_PROFILE(service); + + /* init Modify */ + modification = lasso_dst_modification_new(select); + + modify = lasso_dst_modify_new(modification); + profile->request = LASSO_NODE(modify); + + offering = service->private_data->offering; + + modify->hrefServiceType = g_strdup(offering->ServiceInstance->ServiceType); + if (strcmp(modify->hrefServiceType, LASSO_PP_HREF) == 0) { + modify->prefixServiceType = g_strdup(LASSO_PP_PREFIX); + } + else if (strcmp(modify->hrefServiceType, LASSO_EP_HREF) == 0) { + modify->prefixServiceType = g_strdup(LASSO_EP_PREFIX); + } + else { + /* unknown service type, (needs registration mechanism) */ + return LASSO_ERROR_UNDEFINED; + } + + /* get ResourceID / EncryptedResourceID */ + if (offering->ResourceID) { + modify->ResourceID = offering->ResourceID; + } + else if (offering->EncryptedResourceID) { + modify->EncryptedResourceID = offering->EncryptedResourceID; + } + else { + /* XXX: no resource id, implied:resource, etc. */ + return LASSO_ERROR_UNIMPLEMENTED; + } + + envelope = lasso_wsf_profile_build_soap_envelope(NULL); + LASSO_WSF_PROFILE(service)->soap_envelope_request = envelope; + envelope->Body->any = g_list_append(envelope->Body->any, modify); + + /* set msg_url */ + /* TODO : implement WSDLRef */ + if (description->Endpoint) { + profile->msg_url = g_strdup(description->Endpoint); + } + + return 0; +} + + +gint +lasso_data_service_process_modify_msg(LassoDataService *service, const gchar *modify_soap_msg) +{ + LassoDstModify *modify; + LassoWsfProfile *profile; + int rc; + + profile = LASSO_WSF_PROFILE(service); + rc = lasso_wsf_profile_process_soap_request_msg(profile, modify_soap_msg); + if (rc) { + return rc; + } + + modify = LASSO_DST_MODIFY(profile->request); + if (modify->ResourceID) + service->resource_id = g_object_ref(modify->ResourceID); + else if (modify->EncryptedResourceID) + service->encrypted_resource_id = g_object_ref(modify->EncryptedResourceID); + else { + return LASSO_ERROR_UNIMPLEMENTED; /* implied ? */ + } + + return 0;} + +gint +lasso_data_service_process_modify_response_msg(LassoDataService *service, + const gchar *soap_msg) +{ + LassoDstModifyResponse *response; + LassoSoapEnvelope *envelope; + + g_return_val_if_fail(LASSO_IS_PROFILE_SERVICE(service), -1); + g_return_val_if_fail(soap_msg != NULL, -1); + + envelope = LASSO_SOAP_ENVELOPE(lasso_node_new_from_dump(soap_msg)); + LASSO_WSF_PROFILE(service)->soap_envelope_response = envelope; + + response = envelope->Body->any->data; + LASSO_WSF_PROFILE(service)->response = LASSO_NODE(response); + + return 0; +} + + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + +static LassoNodeClass *parent_class = NULL; + +void +lasso_data_service_set_offering(LassoDataService *service, + LassoDiscoResourceOffering *offering) +{ + service->private_data->offering = g_object_ref(offering); +} + +/*****************************************************************************/ +/* overrided parent class methods */ +/*****************************************************************************/ + +static void +dispose(GObject *object) +{ + LassoDataService *service = LASSO_DATA_SERVICE(object); + + if (service->private_data->dispose_has_run == TRUE) + return; + service->private_data->dispose_has_run = TRUE; + + G_OBJECT_CLASS(parent_class)->dispose(object); +} + +static void +finalize(GObject *object) +{ + LassoDataService *service = LASSO_DATA_SERVICE(object); + if (service->private_data->offering) { + lasso_node_destroy(LASSO_NODE(service->private_data->offering)); + service->private_data->offering = NULL; + } + g_free(service->private_data); + service->private_data = NULL; + G_OBJECT_CLASS(parent_class)->finalize(object); +} + + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoDataService *service) +{ + service->resource_data = NULL; + service->private_data = g_new0(LassoDataServicePrivate, 1); +} + +static void +class_init(LassoDataServiceClass *klass) +{ + parent_class = g_type_class_peek_parent(klass); + + G_OBJECT_CLASS(klass)->dispose = dispose; + G_OBJECT_CLASS(klass)->finalize = finalize; +} + +GType +lasso_data_service_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof(LassoDataServiceClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoDataService), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_WSF_PROFILE, + "LassoDataService", &this_info, 0); + } + return this_type; +} + + +/** + * lasso_data_service_new: + * @server: the #LassoServer + * + * Creates a new #LassoDataService. + * + * Return value: a newly created #LassoDataService object; or NULL if an + * error occured. + **/ +LassoDataService* +lasso_data_service_new(LassoServer *server) +{ + LassoDataService *service; + + g_return_val_if_fail(LASSO_IS_SERVER(server) == TRUE, NULL); + + service = g_object_new(LASSO_TYPE_PROFILE_SERVICE, NULL); + LASSO_WSF_PROFILE(service)->server = g_object_ref(server); + + return service; +} + +LassoDataService* +lasso_data_service_new_full(LassoServer *server, LassoDiscoResourceOffering *offering) +{ + LassoDataService *service; + + service = lasso_data_service_new(server); + if (service == NULL) + return NULL; + + service->private_data->offering = g_object_ref(offering); + + return service; +} diff --git a/lasso/id-wsf/data_service.h b/lasso/id-wsf/data_service.h new file mode 100644 index 00000000..ec6789a0 --- /dev/null +++ b/lasso/id-wsf/data_service.h @@ -0,0 +1,114 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __LASSO_DATA_SERVICE_H__ +#define __LASSO_DATA_SERVICE_H__ + +#ifdef __cplusplus +extern "C" { + +#endif /* __cplusplus */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define LASSO_TYPE_PROFILE_SERVICE (lasso_data_service_get_type()) +#define LASSO_DATA_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \ + LASSO_TYPE_PROFILE_SERVICE, LassoDataService)) +#define LASSO_DATA_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \ + LASSO_TYPE_PROFILE_SERVICE, LassoDataServiceClass)) +#define LASSO_IS_PROFILE_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), \ + LASSO_TYPE_PROFILE_SERVICE)) +#define LASSO_IS_PROFILE_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \ + LASSO_TYPE_PROFILE_SERVICE)) +#define LASSO_DATA_SERVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), \ + LASSO_TYPE_PROFILE_SERVICE, LassoDataServiceClass)) + +typedef struct _LassoDataService LassoDataService; +typedef struct _LassoDataServiceClass LassoDataServiceClass; +typedef struct _LassoDataServicePrivate LassoDataServicePrivate; + +struct _LassoDataService { + LassoWsfProfile parent; + + LassoDiscoResourceID *resource_id; + LassoDiscoEncryptedResourceID *encrypted_resource_id; + xmlNode *resource_data; + + /*< private >*/ + LassoDataServicePrivate *private_data; +}; + +struct _LassoDataServiceClass { + LassoWsfProfileClass parent; +}; + + +LASSO_EXPORT GType lasso_data_service_get_type(void); + +LASSO_EXPORT LassoDataService* lasso_data_service_new(LassoServer *server); + +LASSO_EXPORT LassoDataService* lasso_data_service_new_full(LassoServer *server, + LassoDiscoResourceOffering *offering); + +LASSO_EXPORT gint lasso_data_service_init_query(LassoDataService *service, + const char *select, const char *item_id); + +LASSO_EXPORT LassoDstQueryItem* lasso_data_service_add_query_item(LassoDataService *service, + const char *select, const char *item_id); + +LASSO_EXPORT gint lasso_data_service_process_query_msg(LassoDataService *service, + const char *message); + +LASSO_EXPORT gint lasso_data_service_build_response_msg(LassoDataService *service); + +LASSO_EXPORT gint lasso_data_service_process_query_response_msg(LassoDataService *service, + const char *message); + +LASSO_EXPORT xmlNode* lasso_data_service_get_answer(LassoDataService *service, + const char *select); + +LASSO_EXPORT gint lasso_data_service_init_modify(LassoDataService *service, + const gchar *select); + +LASSO_EXPORT LassoDstModification* lasso_data_service_add_modification( + LassoDataService *service, const gchar *select); + +LASSO_EXPORT gint lasso_data_service_process_modify_msg(LassoDataService *service, + const gchar *soap_msg); + +LASSO_EXPORT gint lasso_data_service_process_modify_response_msg(LassoDataService *service, + const gchar *soap_msg); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_DATA_SERVICE_H__ */ diff --git a/lasso/id-wsf/data_service_private.h b/lasso/id-wsf/data_service_private.h new file mode 100644 index 00000000..ef2ccc95 --- /dev/null +++ b/lasso/id-wsf/data_service_private.h @@ -0,0 +1,40 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __LASSO_DATA_SERVICE_PRIVATE_H__ +#define __LASSO_DATA_SERVICE_PRIVATE_H__ + +#ifdef __cplusplus +extern "C" { + +#endif /* __cplusplus */ + +void lasso_data_service_set_offering(LassoDataService *service, + LassoDiscoResourceOffering *offering); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_DATA_SERVICE_PRIVATE_H__ */ diff --git a/lasso/id-wsf/discovery.c b/lasso/id-wsf/discovery.c index c896266d..a4c4459f 100644 --- a/lasso/id-wsf/discovery.c +++ b/lasso/id-wsf/discovery.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include struct _LassoDiscoveryPrivate @@ -664,19 +664,19 @@ lasso_discovery_process_query_response_msg(LassoDiscovery *discovery, const gcha * @discovery: a #LassoDiscovery * @service_type: the requested service type * - * After a disco:query message, creates a #LassoProfileService instance for the + * After a disco:query message, creates a #LassoDataService instance for the * requested @service_type. * * Return value: a newly created #LAssoProfileService object; or NULL if an * error occured. **/ -LassoProfileService* +LassoDataService* lasso_discovery_get_service(LassoDiscovery *discovery, const char *service_type) { LassoDiscoQueryResponse *response; GList *iter; LassoDiscoResourceOffering *offering = NULL; - LassoProfileService *service; + LassoDataService *service; response = LASSO_DISCO_QUERY_RESPONSE(LASSO_WSF_PROFILE(discovery)->response); iter = response->ResourceOffering; @@ -702,10 +702,10 @@ lasso_discovery_get_service(LassoDiscovery *discovery, const char *service_type) } if (strcmp(offering->ServiceInstance->ServiceType, LASSO_PP_HREF) == 0) { - service = LASSO_PROFILE_SERVICE(lasso_personal_profile_service_new( + service = LASSO_DATA_SERVICE(lasso_personal_profile_service_new( LASSO_WSF_PROFILE(discovery)->server, offering)); } else { - service = lasso_profile_service_new_full(LASSO_WSF_PROFILE(discovery)->server, + service = lasso_data_service_new_full(LASSO_WSF_PROFILE(discovery)->server, offering); } diff --git a/lasso/id-wsf/discovery.h b/lasso/id-wsf/discovery.h index 9642e1fc..7eb4872c 100644 --- a/lasso/id-wsf/discovery.h +++ b/lasso/id-wsf/discovery.h @@ -39,7 +39,7 @@ extern "C" { #include #include -#include +#include #define LASSO_TYPE_DISCOVERY (lasso_discovery_get_type()) #define LASSO_DISCOVERY(obj) \ @@ -118,7 +118,7 @@ LASSO_EXPORT gint lasso_discovery_process_query_msg(LassoDiscovery *discovery, LASSO_EXPORT gint lasso_discovery_process_query_response_msg(LassoDiscovery *discovery, const gchar *message); -LASSO_EXPORT LassoProfileService* lasso_discovery_get_service(LassoDiscovery *discovery, +LASSO_EXPORT LassoDataService* lasso_discovery_get_service(LassoDiscovery *discovery, const char *service_type); LASSO_EXPORT LassoDiscoDescription* lasso_discovery_get_description_auto( diff --git a/lasso/id-wsf/personal_profile_service.c b/lasso/id-wsf/personal_profile_service.c index febf68d4..ec9ad820 100644 --- a/lasso/id-wsf/personal_profile_service.c +++ b/lasso/id-wsf/personal_profile_service.c @@ -23,7 +23,7 @@ */ #include -#include +#include /*****************************************************************************/ @@ -39,7 +39,7 @@ lasso_personal_profile_service_get_email(LassoPersonalProfileService *service) g_return_val_if_fail(LASSO_IS_PERSONAL_PROFILE_SERVICE(service) == TRUE, NULL); - xmlnode = lasso_profile_service_get_answer(LASSO_PROFILE_SERVICE(service), + xmlnode = lasso_data_service_get_answer(LASSO_DATA_SERVICE(service), "/pp:PP/pp:MsgContact"); child = xmlnode->children; @@ -123,7 +123,7 @@ lasso_personal_profile_service_new(LassoServer *server, LassoDiscoResourceOfferi g_return_val_if_fail(LASSO_IS_SERVER(server) == TRUE, NULL); service = g_object_new(LASSO_TYPE_PERSONAL_PROFILE_SERVICE, NULL); - lasso_profile_service_set_offering(LASSO_PROFILE_SERVICE(service), offering); + lasso_data_service_set_offering(LASSO_DATA_SERVICE(service), offering); return service; } diff --git a/lasso/id-wsf/personal_profile_service.h b/lasso/id-wsf/personal_profile_service.h index eda7fbf7..f01575ef 100644 --- a/lasso/id-wsf/personal_profile_service.h +++ b/lasso/id-wsf/personal_profile_service.h @@ -30,7 +30,7 @@ extern "C" { #endif /* __cplusplus */ -#include +#include #include #include #include @@ -55,11 +55,11 @@ typedef struct _LassoPersonalProfileServiceClass LassoPersonalProfileServiceClas typedef struct _LassoPersonalProfileServicePrivate LassoPersonalProfileServicePrivate; struct _LassoPersonalProfileService { - LassoProfileService parent; + LassoDataService parent; }; struct _LassoPersonalProfileServiceClass { - LassoProfileServiceClass parent; + LassoDataServiceClass parent; }; diff --git a/lasso/id-wsf/profile_service.c b/lasso/id-wsf/profile_service.c deleted file mode 100644 index a0301649..00000000 --- a/lasso/id-wsf/profile_service.c +++ /dev/null @@ -1,583 +0,0 @@ -/* $Id$ - * - * Lasso - A free implementation of the Liberty Alliance specifications. - * - * Copyright (C) 2004, 2005 Entr'ouvert - * http://lasso.entrouvert.org - * - * Authors: See AUTHORS file in top-level directory. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - - -struct _LassoProfileServicePrivate -{ - gboolean dispose_has_run; - LassoDiscoResourceOffering *offering; -}; - -/*****************************************************************************/ -/* public methods */ -/*****************************************************************************/ - - -LassoDstModification* -lasso_profile_service_add_modification(LassoProfileService *service, const gchar *select) -{ - LassoWsfProfile *profile; - LassoDstModification *modification; - - g_return_val_if_fail(LASSO_IS_PROFILE_SERVICE(service), NULL); - g_return_val_if_fail(select != NULL, NULL); - - profile = LASSO_WSF_PROFILE(service); - - modification = lasso_dst_modification_new(select); - LASSO_DST_MODIFY(profile->request)->Modification = g_list_append( - LASSO_DST_MODIFY(profile->request)->Modification, (gpointer)modification); - - return modification; -} - - -/** - * lasso_profile_service_add_query_item: - * @service: a #LassoProfileService - * @select: resource selection string (typically a XPath query) - * @item_id: query item identifier - * - * Adds a dst:QueryItem to the current dst:Query request. - * - * Return value: a newly created #LassoDstQueryItem with the query item that - * has been created. Note that it is internally allocated and shouldn't - * be freed by the caller. - **/ -LassoDstQueryItem* -lasso_profile_service_add_query_item(LassoProfileService *service, - const char *select, const char *item_id) -{ - LassoDstQuery *query; - LassoDstQueryItem *item; - - g_return_val_if_fail(LASSO_IS_PROFILE_SERVICE(service), NULL); - g_return_val_if_fail(select != NULL, NULL); - - query = LASSO_DST_QUERY(LASSO_WSF_PROFILE(service)->request); - - if (LASSO_DST_QUERY_ITEM(query->QueryItem->data)->itemID == NULL) { - /* XXX: all items must have itemID if there is more than one */ - return NULL; - } - - item = lasso_dst_query_item_new(select, item_id); - query->QueryItem = g_list_append(query->QueryItem, item); - - return item; -} - -/** - * lasso_profile_service_init_query - * @service: a #LassoProfileService - * @select: resource selection string (typically a XPath query) - * @item_id: query item identifier (optional) - * - * Initializes a new dst:Query request, asking for element @select (with - * optional itemID set to @item_id) - * - * Return value: 0 on success; or a negative value otherwise. - **/ -gint -lasso_profile_service_init_query(LassoProfileService *service, const char *select, - const char *item_id) -{ - LassoWsfProfile *profile; - LassoDstQuery *query; - LassoDiscoResourceOffering *offering; - LassoDiscoDescription *description; - - profile = LASSO_WSF_PROFILE(service); - - query = lasso_dst_query_new(lasso_dst_query_item_new(select, item_id)); - profile->request = LASSO_NODE(query); - - offering = service->private_data->offering; - - query->hrefServiceType = g_strdup(offering->ServiceInstance->ServiceType); - if (strcmp(query->hrefServiceType, LASSO_PP_HREF) == 0) - query->prefixServiceType = g_strdup(LASSO_PP_PREFIX); - else if (strcmp(query->hrefServiceType, LASSO_EP_HREF) == 0) - query->prefixServiceType = g_strdup(LASSO_EP_PREFIX); - else { - /* unknown service type, (needs registration mechanism) */ - return LASSO_ERROR_UNDEFINED; - } - - if (offering->ResourceID) { - query->ResourceID = g_object_ref(offering->ResourceID); - } else if (offering->EncryptedResourceID) { - query->EncryptedResourceID = g_object_ref(offering->EncryptedResourceID); - } else { - /* XXX: no resource id, implied:resource, etc. */ - return LASSO_ERROR_UNIMPLEMENTED; - } - - profile->soap_envelope_request = lasso_wsf_profile_build_soap_envelope(NULL); - profile->soap_envelope_request->Body->any = g_list_append( - profile->soap_envelope_request->Body->any, query); - - description = lasso_discovery_get_description_auto(offering, LASSO_SECURITY_MECH_NULL); - - if (description->Endpoint != NULL) { - profile->msg_url = g_strdup(description->Endpoint); - } else { - /* XXX: else, description->WsdlURLI, get endpoint automatically */ - return LASSO_ERROR_UNIMPLEMENTED; - } - - return 0; -} - -/** - * lasso_profile_service_process_query_msg: - * @service: a #LassoProfileService - * @message: the dst query message - * - * Processes a dst:Query message. Rebuilds a request object from the message - * and extracts ResourceID. - * - * Return value: 0 on success; or a negative value otherwise. - **/ -gint -lasso_profile_service_process_query_msg(LassoProfileService *service, const char *message) -{ - LassoDstQuery *query; - LassoWsfProfile *profile; - int rc; - - profile = LASSO_WSF_PROFILE(service); - rc = lasso_wsf_profile_process_soap_request_msg(profile, message); - if (rc) { - return rc; - } - - query = LASSO_DST_QUERY(profile->request); - if (query->ResourceID) - service->resource_id = g_object_ref(query->ResourceID); - else if (query->EncryptedResourceID) - service->encrypted_resource_id = g_object_ref(query->EncryptedResourceID); - else { - return LASSO_ERROR_UNIMPLEMENTED; /* implied ? */ - } - - return 0; -} - -/** - * lasso_profile_service_build_response_msg: - * @service: a #LassoProfileService - * - * Builds a dst:QueryResponse message. - * - * Return value: 0 on success; or a negative value otherwise. - **/ -gint -lasso_profile_service_build_response_msg(LassoProfileService *service) -{ - LassoWsfProfile *profile; - LassoDstQuery *query; - LassoDstQueryResponse *response; - GList *iter; - xmlDoc *doc; - xmlXPathContext *xpathCtx; - xmlXPathObject *xpathObj; - LassoSoapEnvelope *envelope; - - profile = LASSO_WSF_PROFILE(service); - query = LASSO_DST_QUERY(profile->request); - - response = lasso_dst_query_response_new(lasso_utility_status_new(LASSO_DST_STATUS_CODE_OK)); - profile->response = LASSO_NODE(response); - response->prefixServiceType = g_strdup(query->prefixServiceType); - response->hrefServiceType = g_strdup(query->hrefServiceType); - envelope = profile->soap_envelope_response; - envelope->Body->any = g_list_append(envelope->Body->any, response); - - doc = xmlNewDoc((xmlChar*)"1.0"); - xmlDocSetRootElement(doc, service->resource_data); - xpathCtx = xmlXPathNewContext(doc); - xmlXPathRegisterNs(xpathCtx, (xmlChar*)response->prefixServiceType, - (xmlChar*)response->hrefServiceType); - - /* XXX: needs another level, since there may be more than one */ - iter = query->QueryItem; - while (iter) { - LassoDstQueryItem *item = iter->data; - xpathObj = xmlXPathEvalExpression((xmlChar*)item->Select, xpathCtx); - if (xpathObj && xpathObj->nodesetval && xpathObj->nodesetval->nodeNr) { - LassoDstData *data; - xmlNode *node = xpathObj->nodesetval->nodeTab[0]; - /* XXX: assuming there is only one matching node */ - data = lasso_dst_data_new(); - data->any = g_list_append(data->any, xmlCopyNode(node, 1)); - if (item->itemID) { - data->itemIDRef = g_strdup(item->itemID); - } - response->Data = g_list_append(response->Data, data); - } - iter = g_list_next(iter); - } - - xmlUnlinkNode(service->resource_data); - xmlFreeDoc(doc); - - return lasso_wsf_profile_build_soap_response_msg(profile); -} - -/** - * lasso_profile_service_get_answer: - * @service: a #LassoProfileService - * @select: resource selection string (typically a XPath query) - * - * Returns the answer for the specified @select request. - * - * Return value: the node (libxml2 xmlNode*); or NULL if it was not found. - * This xmlnode must be freed by caller. - **/ -xmlNode* -lasso_profile_service_get_answer(LassoProfileService *service, const char *select) -{ - LassoDstQueryResponse *response; - LassoDstData *data = NULL; - GList *iter; - char *item_id = NULL; - - response = LASSO_DST_QUERY_RESPONSE(LASSO_WSF_PROFILE(service)->response); - iter = LASSO_DST_QUERY(LASSO_WSF_PROFILE(service)->request)->QueryItem; - - if (select == NULL) { - /* if only one element; default to first */ - if (g_list_length(iter) > 1) - return NULL; - data = response->Data->data; - } else { - LassoDstQueryItem *item = NULL; - /* lookup select in query to get itemId, then get data with itemIdRef */ - /* XXX: needs another level, since there may be more than one dst:Query */ - while (iter) { - item = iter->data; - iter = g_list_next(iter); - if (strcmp(item->Select, select) == 0) { - break; - } - item = NULL; - } - - iter = LASSO_DST_QUERY(LASSO_WSF_PROFILE(service)->request)->QueryItem; - if (item == NULL) { - /* not found */ - return NULL; - } - item_id = item->itemID; - if (item_id == NULL) { - /* item_id is not mandatory when there is only one item */ - data = response->Data->data; - } - - iter = response->Data; - while (iter && item_id) { - LassoDstData *t = iter->data; - iter = g_list_next(iter); - if (strcmp(t->itemIDRef, item_id) == 0) { - data = t; - break; - } - } - if (data == NULL) { - /* not found */ - return NULL; - } - } - - /* XXX: there may be more than one xmlnode */ - return xmlCopyNode(data->any->data, 1); -} - -/** - * lasso_profile_service_process_query_response_msg: - * @service: a #LassoProfileService - * @message: the dst query response message - * - * Processes a dst:Query message. Rebuilds a request object from the message - * and extracts ResourcedID. - * - * Return value: 0 on success; or a negative value otherwise. - **/ -gint -lasso_profile_service_process_query_response_msg(LassoProfileService *service, const char *message) -{ - int rc; - LassoDstQueryResponse *response; - - rc = lasso_wsf_profile_process_soap_response_msg(LASSO_WSF_PROFILE(service), message); - if (rc) return rc; - - response = LASSO_DST_QUERY_RESPONSE(LASSO_WSF_PROFILE(service)->response); - if (strcmp(response->Status->code, "OK") != 0) - return LASSO_ERROR_UNDEFINED; - - return 0; -} - - -gint -lasso_profile_service_init_modify(LassoProfileService *service, const gchar *select) -{ - LassoDstModification *modification; - LassoWsfProfile *profile; - LassoDiscoResourceOffering *offering; - LassoDiscoDescription *description; - - LassoSoapEnvelope *envelope; - LassoDstModify *modify; - - - profile = LASSO_WSF_PROFILE(service); - - /* init Modify */ - modification = lasso_dst_modification_new(select); - - modify = lasso_dst_modify_new(modification); - profile->request = LASSO_NODE(modify); - - offering = service->private_data->offering; - - modify->hrefServiceType = g_strdup(offering->ServiceInstance->ServiceType); - if (strcmp(modify->hrefServiceType, LASSO_PP_HREF) == 0) { - modify->prefixServiceType = g_strdup(LASSO_PP_PREFIX); - } - else if (strcmp(modify->hrefServiceType, LASSO_EP_HREF) == 0) { - modify->prefixServiceType = g_strdup(LASSO_EP_PREFIX); - } - else { - /* unknown service type, (needs registration mechanism) */ - return LASSO_ERROR_UNDEFINED; - } - - /* get ResourceID / EncryptedResourceID */ - if (offering->ResourceID) { - modify->ResourceID = offering->ResourceID; - } - else if (offering->EncryptedResourceID) { - modify->EncryptedResourceID = offering->EncryptedResourceID; - } - else { - /* XXX: no resource id, implied:resource, etc. */ - return LASSO_ERROR_UNIMPLEMENTED; - } - - envelope = lasso_wsf_profile_build_soap_envelope(NULL); - LASSO_WSF_PROFILE(service)->soap_envelope_request = envelope; - envelope->Body->any = g_list_append(envelope->Body->any, modify); - - /* set msg_url */ - /* TODO : implement WSDLRef */ - if (description->Endpoint) { - profile->msg_url = g_strdup(description->Endpoint); - } - - return 0; -} - - -gint -lasso_profile_service_process_modify_msg(LassoProfileService *service, const gchar *modify_soap_msg) -{ - LassoDstModify *modify; - LassoWsfProfile *profile; - int rc; - - profile = LASSO_WSF_PROFILE(service); - rc = lasso_wsf_profile_process_soap_request_msg(profile, modify_soap_msg); - if (rc) { - return rc; - } - - modify = LASSO_DST_MODIFY(profile->request); - if (modify->ResourceID) - service->resource_id = g_object_ref(modify->ResourceID); - else if (modify->EncryptedResourceID) - service->encrypted_resource_id = g_object_ref(modify->EncryptedResourceID); - else { - return LASSO_ERROR_UNIMPLEMENTED; /* implied ? */ - } - - return 0;} - -gint -lasso_profile_service_process_modify_response_msg(LassoProfileService *service, - const gchar *soap_msg) -{ - LassoDstModifyResponse *response; - LassoSoapEnvelope *envelope; - - g_return_val_if_fail(LASSO_IS_PROFILE_SERVICE(service), -1); - g_return_val_if_fail(soap_msg != NULL, -1); - - envelope = LASSO_SOAP_ENVELOPE(lasso_node_new_from_dump(soap_msg)); - LASSO_WSF_PROFILE(service)->soap_envelope_response = envelope; - - response = envelope->Body->any->data; - LASSO_WSF_PROFILE(service)->response = LASSO_NODE(response); - - return 0; -} - - -/*****************************************************************************/ -/* private methods */ -/*****************************************************************************/ - -static LassoNodeClass *parent_class = NULL; - -void -lasso_profile_service_set_offering(LassoProfileService *service, - LassoDiscoResourceOffering *offering) -{ - service->private_data->offering = g_object_ref(offering); -} - -/*****************************************************************************/ -/* overrided parent class methods */ -/*****************************************************************************/ - -static void -dispose(GObject *object) -{ - LassoProfileService *service = LASSO_PROFILE_SERVICE(object); - - if (service->private_data->dispose_has_run == TRUE) - return; - service->private_data->dispose_has_run = TRUE; - - G_OBJECT_CLASS(parent_class)->dispose(object); -} - -static void -finalize(GObject *object) -{ - LassoProfileService *service = LASSO_PROFILE_SERVICE(object); - if (service->private_data->offering) { - lasso_node_destroy(LASSO_NODE(service->private_data->offering)); - service->private_data->offering = NULL; - } - g_free(service->private_data); - service->private_data = NULL; - G_OBJECT_CLASS(parent_class)->finalize(object); -} - - -/*****************************************************************************/ -/* instance and class init functions */ -/*****************************************************************************/ - -static void -instance_init(LassoProfileService *service) -{ - service->resource_data = NULL; - service->private_data = g_new0(LassoProfileServicePrivate, 1); -} - -static void -class_init(LassoProfileServiceClass *klass) -{ - parent_class = g_type_class_peek_parent(klass); - - G_OBJECT_CLASS(klass)->dispose = dispose; - G_OBJECT_CLASS(klass)->finalize = finalize; -} - -GType -lasso_profile_service_get_type() -{ - static GType this_type = 0; - - if (!this_type) { - static const GTypeInfo this_info = { - sizeof(LassoProfileServiceClass), - NULL, - NULL, - (GClassInitFunc) class_init, - NULL, - NULL, - sizeof(LassoProfileService), - 0, - (GInstanceInitFunc) instance_init, - }; - - this_type = g_type_register_static(LASSO_TYPE_WSF_PROFILE, - "LassoProfileService", &this_info, 0); - } - return this_type; -} - - -/** - * lasso_profile_service_new: - * @server: the #LassoServer - * - * Creates a new #LassoProfileService. - * - * Return value: a newly created #LassoProfileService object; or NULL if an - * error occured. - **/ -LassoProfileService* -lasso_profile_service_new(LassoServer *server) -{ - LassoProfileService *service; - - g_return_val_if_fail(LASSO_IS_SERVER(server) == TRUE, NULL); - - service = g_object_new(LASSO_TYPE_PROFILE_SERVICE, NULL); - LASSO_WSF_PROFILE(service)->server = g_object_ref(server); - - return service; -} - -LassoProfileService* -lasso_profile_service_new_full(LassoServer *server, LassoDiscoResourceOffering *offering) -{ - LassoProfileService *service; - - service = lasso_profile_service_new(server); - if (service == NULL) - return NULL; - - service->private_data->offering = g_object_ref(offering); - - return service; -} diff --git a/lasso/id-wsf/profile_service.h b/lasso/id-wsf/profile_service.h deleted file mode 100644 index d0768efb..00000000 --- a/lasso/id-wsf/profile_service.h +++ /dev/null @@ -1,114 +0,0 @@ -/* $Id$ - * - * Lasso - A free implementation of the Liberty Alliance specifications. - * - * Copyright (C) 2004, 2005 Entr'ouvert - * http://lasso.entrouvert.org - * - * Authors: See AUTHORS file in top-level directory. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __LASSO_PROFILE_SERVICE_H__ -#define __LASSO_PROFILE_SERVICE_H__ - -#ifdef __cplusplus -extern "C" { - -#endif /* __cplusplus */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#define LASSO_TYPE_PROFILE_SERVICE (lasso_profile_service_get_type()) -#define LASSO_PROFILE_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \ - LASSO_TYPE_PROFILE_SERVICE, LassoProfileService)) -#define LASSO_PROFILE_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \ - LASSO_TYPE_PROFILE_SERVICE, LassoProfileServiceClass)) -#define LASSO_IS_PROFILE_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), \ - LASSO_TYPE_PROFILE_SERVICE)) -#define LASSO_IS_PROFILE_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \ - LASSO_TYPE_PROFILE_SERVICE)) -#define LASSO_PROFILE_SERVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), \ - LASSO_TYPE_PROFILE_SERVICE, LassoProfileServiceClass)) - -typedef struct _LassoProfileService LassoProfileService; -typedef struct _LassoProfileServiceClass LassoProfileServiceClass; -typedef struct _LassoProfileServicePrivate LassoProfileServicePrivate; - -struct _LassoProfileService { - LassoWsfProfile parent; - - LassoDiscoResourceID *resource_id; - LassoDiscoEncryptedResourceID *encrypted_resource_id; - xmlNode *resource_data; - - /*< private >*/ - LassoProfileServicePrivate *private_data; -}; - -struct _LassoProfileServiceClass { - LassoWsfProfileClass parent; -}; - - -LASSO_EXPORT GType lasso_profile_service_get_type(void); - -LASSO_EXPORT LassoProfileService* lasso_profile_service_new(LassoServer *server); - -LASSO_EXPORT LassoProfileService* lasso_profile_service_new_full(LassoServer *server, - LassoDiscoResourceOffering *offering); - -LASSO_EXPORT gint lasso_profile_service_init_query(LassoProfileService *service, - const char *select, const char *item_id); - -LASSO_EXPORT LassoDstQueryItem* lasso_profile_service_add_query_item(LassoProfileService *service, - const char *select, const char *item_id); - -LASSO_EXPORT gint lasso_profile_service_process_query_msg(LassoProfileService *service, - const char *message); - -LASSO_EXPORT gint lasso_profile_service_build_response_msg(LassoProfileService *service); - -LASSO_EXPORT gint lasso_profile_service_process_query_response_msg(LassoProfileService *service, - const char *message); - -LASSO_EXPORT xmlNode* lasso_profile_service_get_answer(LassoProfileService *service, - const char *select); - -LASSO_EXPORT gint lasso_profile_service_init_modify(LassoProfileService *service, - const gchar *select); - -LASSO_EXPORT LassoDstModification* lasso_profile_service_add_modification( - LassoProfileService *service, const gchar *select); - -LASSO_EXPORT gint lasso_profile_service_process_modify_msg(LassoProfileService *service, - const gchar *soap_msg); - -LASSO_EXPORT gint lasso_profile_service_process_modify_response_msg(LassoProfileService *service, - const gchar *soap_msg); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __LASSO_PROFILE_SERVICE_H__ */ diff --git a/lasso/id-wsf/profile_service_private.h b/lasso/id-wsf/profile_service_private.h deleted file mode 100644 index b429a5a0..00000000 --- a/lasso/id-wsf/profile_service_private.h +++ /dev/null @@ -1,40 +0,0 @@ -/* $Id$ - * - * Lasso - A free implementation of the Liberty Alliance specifications. - * - * Copyright (C) 2004, 2005 Entr'ouvert - * http://lasso.entrouvert.org - * - * Authors: See AUTHORS file in top-level directory. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __LASSO_PROFILE_SERVICE_PRIVATE_H__ -#define __LASSO_PROFILE_SERVICE_PRIVATE_H__ - -#ifdef __cplusplus -extern "C" { - -#endif /* __cplusplus */ - -void lasso_profile_service_set_offering(LassoProfileService *service, - LassoDiscoResourceOffering *offering); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __LASSO_PROFILE_SERVICE_PRIVATE_H__ */ diff --git a/swig/Lasso-wsf.i b/swig/Lasso-wsf.i index 00e1f8ee..82518234 100644 --- a/swig/Lasso-wsf.i +++ b/swig/Lasso-wsf.i @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #include @@ -3539,7 +3539,7 @@ typedef struct { END_THROW_ERROR %newobject getService; - LassoProfileService* getService(const char *service_type = NULL); + LassoDataService* getService(const char *service_type = NULL); } %{ @@ -3964,22 +3964,22 @@ typedef struct { /* Attributes from ProfileService*/ /* EncryptedResourceID */ -#define LassoPersonalProfileService_get_encryptedResourceId(self) get_node(LASSO_PROFILE_SERVICE(self)->encrypted_resource_id) -#define LassoPersonalProfileService_encryptedResourceId_get(self) get_node(LASSO_PROFILE_SERVICE(self)->encrypted_resource_id) -#define LassoPersonalProfileService_set_encryptedResourceId(self, value) set_node((gpointer *) &(LASSO_PROFILE_SERVICE(self))->encrypted_resource_id, (value)) -#define LassoPersonalProfileService_encryptedResourceId_set(self, value) set_node((gpointer *) &(LASSO_PROFILE_SERVICE(self))->encrypted_resource_id, (value)) +#define LassoPersonalProfileService_get_encryptedResourceId(self) get_node(LASSO_DATA_SERVICE(self)->encrypted_resource_id) +#define LassoPersonalProfileService_encryptedResourceId_get(self) get_node(LASSO_DATA_SERVICE(self)->encrypted_resource_id) +#define LassoPersonalProfileService_set_encryptedResourceId(self, value) set_node((gpointer *) &(LASSO_DATA_SERVICE(self))->encrypted_resource_id, (value)) +#define LassoPersonalProfileService_encryptedResourceId_set(self, value) set_node((gpointer *) &(LASSO_DATA_SERVICE(self))->encrypted_resource_id, (value)) /* ResourceID */ -#define LassoPersonalProfileService_get_resourceId(self) get_node(LASSO_PROFILE_SERVICE(self)->resource_id) -#define LassoPersonalProfileService_resourceId_get(self) get_node(LASSO_PROFILE_SERVICE(self)->resource_id) -#define LassoPersonalProfileService_set_resourceId(self, value) set_node((gpointer *) &(LASSO_PROFILE_SERVICE(self))->resource_id, (value)) -#define LassoPersonalProfileService_resourceId_set(self, value) set_node((gpointer *) &(LASSO_PROFILE_SERVICE(self))->resource_id, (value)) +#define LassoPersonalProfileService_get_resourceId(self) get_node(LASSO_DATA_SERVICE(self)->resource_id) +#define LassoPersonalProfileService_resourceId_get(self) get_node(LASSO_DATA_SERVICE(self)->resource_id) +#define LassoPersonalProfileService_set_resourceId(self, value) set_node((gpointer *) &(LASSO_DATA_SERVICE(self))->resource_id, (value)) +#define LassoPersonalProfileService_resourceId_set(self, value) set_node((gpointer *) &(LASSO_DATA_SERVICE(self))->resource_id, (value)) /* resourceData */ -#define LassoPersonalProfileService_get_resourceData(self) get_xml_string(LASSO_PROFILE_SERVICE(self)->resource_data) -#define LassoPersonalProfileService_resourceData_get(self) get_xml_string(LASSO_PROFILE_SERVICE(self)->resource_data) -#define LassoPersonalProfileService_set_resourceData(self, value) set_xml_string(&(LASSO_PROFILE_SERVICE(self))->resource_data, (value)) -#define LassoPersonalProfileService_resourceData_set(self, value) set_xml_string(&(LASSO_PROFILE_SERVICE(self))->resource_data, (value)) +#define LassoPersonalProfileService_get_resourceData(self) get_xml_string(LASSO_DATA_SERVICE(self)->resource_data) +#define LassoPersonalProfileService_resourceData_get(self) get_xml_string(LASSO_DATA_SERVICE(self)->resource_data) +#define LassoPersonalProfileService_set_resourceData(self, value) set_xml_string(&(LASSO_DATA_SERVICE(self))->resource_data, (value)) +#define LassoPersonalProfileService_resourceData_set(self, value) set_xml_string(&(LASSO_DATA_SERVICE(self))->resource_data, (value)) @@ -3993,19 +3993,19 @@ typedef struct { #define LassoPersonalProfileService_buildResponseMsg(self) lasso_wsf_profile_build_soap_response_msg(LASSO_WSF_PROFILE(self)) /* Implementations of methods inherited from ProfileService */ -#define LassoPersonalProfileService_buildResponseMsg lasso_profile_service_build_response_msg -#define LassoPersonalProfileService_addData lasso_profile_service_add_data -#define LassoPersonalProfileService_addModification lasso_profile_service_add_modification -#define LassoPersonalProfileService_addQueryItem lasso_profile_service_add_query_item -#define LassoPersonalProfileService_initModify lasso_profile_service_init_modify -#define LassoPersonalProfileService_initQuery lasso_profile_service_init_query -#define LassoPersonalProfileService_getXmlNode lasso_profile_service_get_xmlNode -#define LassoPersonalProfileService_processModifyMsg lasso_profile_service_process_modify_msg -#define LassoPersonalProfileService_processModifyResponseMsg lasso_profile_service_process_modify_response_msg -#define LassoPersonalProfileService_processQueryMsg lasso_profile_service_process_query_msg -#define LassoPersonalProfileService_processQueryResponseMsg lasso_profile_service_process_query_response_msg -#define LassoPersonalProfileService_validateQuery lasso_profile_service_validate_query -#define LassoPersonalProfileService_getAnswer(self,select) get_xml_string(lasso_profile_service_get_answer(self, select)) +#define LassoPersonalProfileService_buildResponseMsg lasso_data_service_build_response_msg +#define LassoPersonalProfileService_addData lasso_data_service_add_data +#define LassoPersonalProfileService_addModification lasso_data_service_add_modification +#define LassoPersonalProfileService_addQueryItem lasso_data_service_add_query_item +#define LassoPersonalProfileService_initModify lasso_data_service_init_modify +#define LassoPersonalProfileService_initQuery lasso_data_service_init_query +#define LassoPersonalProfileService_getXmlNode lasso_data_service_get_xmlNode +#define LassoPersonalProfileService_processModifyMsg lasso_data_service_process_modify_msg +#define LassoPersonalProfileService_processModifyResponseMsg lasso_data_service_process_modify_response_msg +#define LassoPersonalProfileService_processQueryMsg lasso_data_service_process_query_msg +#define LassoPersonalProfileService_processQueryResponseMsg lasso_data_service_process_query_response_msg +#define LassoPersonalProfileService_validateQuery lasso_data_service_validate_query +#define LassoPersonalProfileService_getAnswer(self,select) get_xml_string(lasso_data_service_get_answer(self, select)) /* Methods implementations */ @@ -4020,11 +4020,11 @@ typedef struct { #ifndef SWIGPHP4 -%rename(ProfileService) LassoProfileService; +%rename(ProfileService) LassoDataService; #endif typedef struct { -} LassoProfileService; -%extend LassoProfileService { +} LassoDataService; +%extend LassoDataService { /* Attributes inherited from WsfProfile */ %immutable msgBody; @@ -4054,9 +4054,9 @@ typedef struct { /* Constructor, Destructor & Static Methods */ - LassoProfileService(LassoServer *server); + LassoDataService(LassoServer *server); - ~LassoProfileService(); + ~LassoDataService(); /* Methods inherited from LassoNode */ @@ -4110,79 +4110,79 @@ typedef struct { /* Attributes inherited from WsfProfile implementations */ /* msgBody */ -#define LassoProfileService_get_msgBody(self) LASSO_WSF_PROFILE(self)->msg_body -#define LassoProfileService_msgBody_get(self) LASSO_WSF_PROFILE(self)->msg_body +#define LassoDataService_get_msgBody(self) LASSO_WSF_PROFILE(self)->msg_body +#define LassoDataService_msgBody_get(self) LASSO_WSF_PROFILE(self)->msg_body /* msgUrl */ -#define LassoProfileService_get_msgUrl(self) LASSO_WSF_PROFILE(self)->msg_url -#define LassoProfileService_msgUrl_get(self) LASSO_WSF_PROFILE(self)->msg_url +#define LassoDataService_get_msgUrl(self) LASSO_WSF_PROFILE(self)->msg_url +#define LassoDataService_msgUrl_get(self) LASSO_WSF_PROFILE(self)->msg_url /* request */ -#define LassoProfileService_get_request(self) get_node(LASSO_WSF_PROFILE(self)->request) -#define LassoProfileService_request_get(self) get_node(LASSO_WSF_PROFILE(self)->request) -#define LassoProfileService_set_request(self, value) set_node((gpointer *) &LASSO_WSF_PROFILE(self)->request, (value)) -#define LassoProfileService_request_set(self, value) set_node((gpointer *) &LASSO_WSF_PROFILE(self)->request, (value)) +#define LassoDataService_get_request(self) get_node(LASSO_WSF_PROFILE(self)->request) +#define LassoDataService_request_get(self) get_node(LASSO_WSF_PROFILE(self)->request) +#define LassoDataService_set_request(self, value) set_node((gpointer *) &LASSO_WSF_PROFILE(self)->request, (value)) +#define LassoDataService_request_set(self, value) set_node((gpointer *) &LASSO_WSF_PROFILE(self)->request, (value)) /* response */ -#define LassoProfileService_get_response(self) get_node(LASSO_WSF_PROFILE(self)->response) -#define LassoProfileService_response_get(self) get_node(LASSO_WSF_PROFILE(self)->response) -#define LassoProfileService_set_response(self, value) set_node((gpointer *) &LASSO_WSF_PROFILE(self)->response, (value)) -#define LassoProfileService_response_set(self, value) set_node((gpointer *) &LASSO_WSF_PROFILE(self)->response, (value)) +#define LassoDataService_get_response(self) get_node(LASSO_WSF_PROFILE(self)->response) +#define LassoDataService_response_get(self) get_node(LASSO_WSF_PROFILE(self)->response) +#define LassoDataService_set_response(self, value) set_node((gpointer *) &LASSO_WSF_PROFILE(self)->response, (value)) +#define LassoDataService_response_set(self, value) set_node((gpointer *) &LASSO_WSF_PROFILE(self)->response, (value)) /* server */ -#define LassoProfileService_get_server(self) get_node(LASSO_WSF_PROFILE(self)->server) -#define LassoProfileService_server_get(self) get_node(LASSO_WSF_PROFILE(self)->server) -#define LassoProfileService_set_server(self, value) set_node((gpointer *) &LASSO_WSF_PROFILE(self)->server, (value)) -#define LassoProfileService_server_set(self, value) set_node((gpointer *) &LASSO_WSF_PROFILE(self)->server, (value)) +#define LassoDataService_get_server(self) get_node(LASSO_WSF_PROFILE(self)->server) +#define LassoDataService_server_get(self) get_node(LASSO_WSF_PROFILE(self)->server) +#define LassoDataService_set_server(self, value) set_node((gpointer *) &LASSO_WSF_PROFILE(self)->server, (value)) +#define LassoDataService_server_set(self, value) set_node((gpointer *) &LASSO_WSF_PROFILE(self)->server, (value)) /* Attributes */ /* EncryptedResourceID */ -#define LassoProfileService_get_encryptedResourceId(self) get_node((self)->encrypted_resource_id) -#define LassoProfileService_encryptedResourceId_get(self) get_node((self)->encrypted_resource_id) -#define LassoProfileService_set_encryptedResourceId(self, value) set_node((gpointer *) &(self)->encrypted_resource_id, (value)) -#define LassoProfileService_encryptedResourceId_set(self, value) set_node((gpointer *) &(self)->encrypted_resource_id, (value)) +#define LassoDataService_get_encryptedResourceId(self) get_node((self)->encrypted_resource_id) +#define LassoDataService_encryptedResourceId_get(self) get_node((self)->encrypted_resource_id) +#define LassoDataService_set_encryptedResourceId(self, value) set_node((gpointer *) &(self)->encrypted_resource_id, (value)) +#define LassoDataService_encryptedResourceId_set(self, value) set_node((gpointer *) &(self)->encrypted_resource_id, (value)) /* ResourceID */ -#define LassoProfileService_get_resourceId(self) get_node((self)->resource_id) -#define LassoProfileService_resourceId_get(self) get_node((self)->resource_id) -#define LassoProfileService_set_resourceId(self, value) set_node((gpointer *) &(self)->resource_id, (value)) -#define LassoProfileService_resourceId_set(self, value) set_node((gpointer *) &(self)->resource_id, (value)) +#define LassoDataService_get_resourceId(self) get_node((self)->resource_id) +#define LassoDataService_resourceId_get(self) get_node((self)->resource_id) +#define LassoDataService_set_resourceId(self, value) set_node((gpointer *) &(self)->resource_id, (value)) +#define LassoDataService_resourceId_set(self, value) set_node((gpointer *) &(self)->resource_id, (value)) /* resourceData */ -#define LassoProfileService_get_resourceData(self) get_xml_string((self)->resource_data) -#define LassoProfileService_resourceData_get(self) get_xml_string((self)->resource_data) -#define LassoProfileService_set_resourceData(self, value) set_xml_string(&(self)->resource_data, (value)) -#define LassoProfileService_resourceData_set(self, value) set_xml_string(&(self)->resource_data, (value)) +#define LassoDataService_get_resourceData(self) get_xml_string((self)->resource_data) +#define LassoDataService_resourceData_get(self) get_xml_string((self)->resource_data) +#define LassoDataService_set_resourceData(self, value) set_xml_string(&(self)->resource_data, (value)) +#define LassoDataService_resourceData_set(self, value) set_xml_string(&(self)->resource_data, (value)) /* Constructors, destructors & static methods implementations */ -#define new_LassoProfileService lasso_profile_service_new -#define delete_LassoProfileService(self) lasso_node_destroy(LASSO_NODE(self)) +#define new_LassoDataService lasso_data_service_new +#define delete_LassoDataService(self) lasso_node_destroy(LASSO_NODE(self)) /* Implementations of methods inherited from LassoNode */ -#define LassoProfileService_dump(self) lasso_node_dump(LASSO_NODE(self)) +#define LassoDataService_dump(self) lasso_node_dump(LASSO_NODE(self)) /* Implementations of methods inherited from WsfProfile */ -#define LassoProfileService_buildRequestMsg(self) lasso_wsf_profile_build_soap_request_msg(LASSO_WSF_PROFILE(self)) +#define LassoDataService_buildRequestMsg(self) lasso_wsf_profile_build_soap_request_msg(LASSO_WSF_PROFILE(self)) /* Methods implementations */ -#define LassoProfileService_buildResponseMsg lasso_profile_service_build_response_msg -#define LassoProfileService_addData lasso_profile_service_add_data -#define LassoProfileService_addModification lasso_profile_service_add_modification -#define LassoProfileService_addQueryItem lasso_profile_service_add_query_item -#define LassoProfileService_initModify lasso_profile_service_init_modify -#define LassoProfileService_initQuery lasso_profile_service_init_query -#define LassoProfileService_getXmlNode lasso_profile_service_get_xmlNode -#define LassoProfileService_processModifyMsg lasso_profile_service_process_modify_msg -#define LassoProfileService_processModifyResponseMsg lasso_profile_service_process_modify_response_msg -#define LassoProfileService_processQueryMsg lasso_profile_service_process_query_msg -#define LassoProfileService_processQueryResponseMsg lasso_profile_service_process_query_response_msg -#define LassoProfileService_validateQuery lasso_profile_service_validate_query -#define LassoProfileService_getAnswer(self,select) get_xml_string(lasso_profile_service_get_answer(self, select)) +#define LassoDataService_buildResponseMsg lasso_data_service_build_response_msg +#define LassoDataService_addData lasso_data_service_add_data +#define LassoDataService_addModification lasso_data_service_add_modification +#define LassoDataService_addQueryItem lasso_data_service_add_query_item +#define LassoDataService_initModify lasso_data_service_init_modify +#define LassoDataService_initQuery lasso_data_service_init_query +#define LassoDataService_getXmlNode lasso_data_service_get_xmlNode +#define LassoDataService_processModifyMsg lasso_data_service_process_modify_msg +#define LassoDataService_processModifyResponseMsg lasso_data_service_process_modify_response_msg +#define LassoDataService_processQueryMsg lasso_data_service_process_query_msg +#define LassoDataService_processQueryResponseMsg lasso_data_service_process_query_response_msg +#define LassoDataService_validateQuery lasso_data_service_validate_query +#define LassoDataService_getAnswer(self,select) get_xml_string(lasso_data_service_get_answer(self, select)) %} -- cgit