From d82175f9939f97669c242f8cfd8b47bb4842be0d Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Fri, 1 Aug 2008 14:11:49 +0000 Subject: Match is:RedirectRequest and set msg_url to the url to redirect to --- lasso/id-wsf/wsf_profile.c | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/lasso/id-wsf/wsf_profile.c b/lasso/id-wsf/wsf_profile.c index 608d66d6..6d6dc623 100644 --- a/lasso/id-wsf/wsf_profile.c +++ b/lasso/id-wsf/wsf_profile.c @@ -50,6 +50,10 @@ #include #include #include +#include +#include +#include + #include #include @@ -813,9 +817,9 @@ exit: gint lasso_wsf_profile_process_soap_response_msg(LassoWsfProfile *profile, const gchar *message) { - xmlDoc *doc; - xmlNode *root; - LassoSoapEnvelope *envelope; + xmlDoc *doc = NULL; + xmlNode *root = NULL; + LassoSoapEnvelope *envelope = NULL; gint rc = 0; g_return_val_if_fail(LASSO_IS_WSF_PROFILE(profile), @@ -842,9 +846,25 @@ lasso_wsf_profile_process_soap_response_msg(LassoWsfProfile *profile, const gcha rc = LASSO_PROFILE_ERROR_MISSING_RESPONSE; } /* XXX: Validate MessageID */ - /* Signal soap fault specifically */ + /* Signal soap fault specifically, + * find soap redirects. */ if (LASSO_IS_SOAP_FAULT(profile->response)) { - rc = LASSO_WSF_PROFILE_ERROR_SOAP_FAULT; + LassoSoapFault *fault = LASSO_SOAP_FAULT(profile->response); + if (LASSO_IS_SOAP_DETAIL(fault->Detail)) { + LassoSoapDetail *detail = LASSO_SOAP_DETAIL(fault->Detail); + GList *iter = detail->any; + for (; iter; iter = g_list_next(iter)) { + if (LASSO_IS_IS_REDIRECT_REQUEST(iter->data)) { + LassoIsRedirectRequest *redirect = LASSO_IS_REDIRECT_REQUEST(iter->data); + g_assign_string(profile->msg_url, redirect->redirectURL); + rc = LASSO_SOAP_FAULT_REDIRECT_REQUEST; + } + } + + } + if (rc == 0) { + rc = LASSO_WSF_PROFILE_ERROR_SOAP_FAULT; + } } exit: if (envelope) { -- cgit