diff options
author | Damien Laniel <dlaniel@entrouvert.com> | 2007-06-12 15:44:32 +0000 |
---|---|---|
committer | Damien Laniel <dlaniel@entrouvert.com> | 2007-06-12 15:44:32 +0000 |
commit | 5ac539dff89c1fecdc0f914992ecd84bd2be990d (patch) | |
tree | 5f36adafb3b89618743614b281327c04d04dee71 | |
parent | 1f0028b57e5402dea42c86cf951a36d5c39f2e3b (diff) | |
download | lasso-5ac539dff89c1fecdc0f914992ecd84bd2be990d.tar.gz lasso-5ac539dff89c1fecdc0f914992ecd84bd2be990d.tar.xz lasso-5ac539dff89c1fecdc0f914992ecd84bd2be990d.zip |
split lasso_idwsf2_discovery_process_query_msg for the SP to get the name_id and load the identity dump in between
-rw-r--r-- | lasso/id-wsf-2.0/discovery.c | 34 | ||||
-rw-r--r-- | lasso/id-wsf-2.0/discovery.h | 4 | ||||
-rw-r--r-- | swig/Lasso-wsf2.i | 5 |
3 files changed, 32 insertions, 11 deletions
diff --git a/lasso/id-wsf-2.0/discovery.c b/lasso/id-wsf-2.0/discovery.c index 3d5ef447..29fb92e9 100644 --- a/lasso/id-wsf-2.0/discovery.c +++ b/lasso/id-wsf-2.0/discovery.c @@ -564,13 +564,7 @@ gint lasso_idwsf2_discovery_process_query_msg(LassoIdWsf2Discovery *discovery, const gchar *message) { LassoWsf2Profile *profile = LASSO_WSF2_PROFILE(discovery); - LassoIdentity *identity = profile->identity; - LassoServer *server = profile->server; - LassoIdWsf2DiscoQuery* request; - LassoIdWsf2DiscoQueryResponse *response; - LassoSoapEnvelope *envelope; - LassoIdWsf2DiscoRequestedService *service = NULL; - LassoWsAddrEndpointReference *epr; + int res = 0; g_return_val_if_fail(LASSO_IS_IDWSF2_DISCOVERY(discovery), @@ -582,12 +576,30 @@ lasso_idwsf2_discovery_process_query_msg(LassoIdWsf2Discovery *discovery, const if (! LASSO_IS_IDWSF2_DISCO_QUERY(profile->request)) { res = LASSO_PROFILE_ERROR_INVALID_SOAP_MSG; - } else if (! LASSO_IS_IDENTITY(identity)) { + } + + return res; +} + +gint +lasso_idwsf2_discovery_build_query_response_msg(LassoIdWsf2Discovery *discovery) +{ + LassoWsf2Profile *profile = LASSO_WSF2_PROFILE(discovery); + LassoIdentity *identity = profile->identity; + LassoServer *server = profile->server; + LassoIdWsf2DiscoQuery* request; + LassoIdWsf2DiscoRequestedService *service = NULL; + LassoIdWsf2DiscoQueryResponse *response; + LassoWsAddrEndpointReference *epr; + LassoSoapEnvelope *envelope; + int res = 0; + + if (! LASSO_IS_IDWSF2_DISCO_QUERY(profile->request)) { + res = LASSO_PROFILE_ERROR_MISSING_REQUEST; + } else if (! LASSO_IS_IDENTITY(identity)) { res = LASSO_PROFILE_ERROR_IDENTITY_NOT_FOUND; } - /* If the request has been correctly processed, */ - /* put interesting data into the discovery object */ if (res == 0) { request = LASSO_IDWSF2_DISCO_QUERY(profile->request); /* FIXME : foreach on the list instead */ @@ -621,6 +633,8 @@ lasso_idwsf2_discovery_process_query_msg(LassoIdWsf2Discovery *discovery, const envelope = profile->soap_envelope_response; envelope->Body->any = g_list_append(envelope->Body->any, response); + lasso_wsf2_profile_build_response_msg(profile); + return res; } diff --git a/lasso/id-wsf-2.0/discovery.h b/lasso/id-wsf-2.0/discovery.h index 591c2bbc..59638340 100644 --- a/lasso/id-wsf-2.0/discovery.h +++ b/lasso/id-wsf-2.0/discovery.h @@ -105,7 +105,9 @@ LASSO_EXPORT gint lasso_idwsf2_discovery_add_requested_service_type(LassoIdWsf2D LASSO_EXPORT gint lasso_idwsf2_discovery_process_query_msg(LassoIdWsf2Discovery *discovery, const gchar *message); - + +LASSO_EXPORT gint lasso_idwsf2_discovery_build_query_response_msg(LassoIdWsf2Discovery *discovery); + LASSO_EXPORT gint lasso_idwsf2_discovery_process_query_response_msg(LassoIdWsf2Discovery *discovery, const gchar *message); diff --git a/swig/Lasso-wsf2.i b/swig/Lasso-wsf2.i index 2d543602..c553a392 100644 --- a/swig/Lasso-wsf2.i +++ b/swig/Lasso-wsf2.i @@ -177,6 +177,10 @@ typedef struct { END_THROW_ERROR() THROW_ERROR() + int buildQueryResponseMsg(); + END_THROW_ERROR() + + THROW_ERROR() int processQueryResponseMsg(const char *message); END_THROW_ERROR() @@ -287,6 +291,7 @@ typedef struct { #define LassoIdWsf2Discovery_initQuery lasso_idwsf2_discovery_init_query #define LassoIdWsf2Discovery_addRequestedServiceType lasso_idwsf2_discovery_add_requested_service_type #define LassoIdWsf2Discovery_processQueryMsg lasso_idwsf2_discovery_process_query_msg +#define LassoIdWsf2Discovery_buildQueryResponseMsg lasso_idwsf2_discovery_build_query_response_msg #define LassoIdWsf2Discovery_processQueryResponseMsg lasso_idwsf2_discovery_process_query_response_msg #define LassoIdWsf2Discovery_registerMetadata lasso_idwsf2_discovery_register_metadata #define LassoIdWsf2Discovery_getService(self, type) \ |