summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2010-02-17 10:15:05 +0000
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2010-02-17 10:15:05 +0000
commit38f6a63396bcfc08bb522f1c652c33bbfd95654b (patch)
tree216d6ae299af303a1613e4d5e941bb84c4f5f1a1
parent1c8fb8a3edb524c977e5b2dc63e61983e8c23f04 (diff)
downloadlasso-38f6a63396bcfc08bb522f1c652c33bbfd95654b.tar.gz
lasso-38f6a63396bcfc08bb522f1c652c33bbfd95654b.tar.xz
lasso-38f6a63396bcfc08bb522f1c652c33bbfd95654b.zip
ID-WSF 2.0: add a method to retrieve/create a SOAP Fault to SOAP binding module
* lasso/id-wsf-2.0/soap_binding.{c,h}: add method lasso_soap_envelope_get_soap_fault which returns/create the first SOAP fault inside the body of the SOAP envelope.
-rw-r--r--lasso/id-wsf-2.0/soap_binding.c23
-rw-r--r--lasso/id-wsf-2.0/soap_binding.h3
2 files changed, 26 insertions, 0 deletions
diff --git a/lasso/id-wsf-2.0/soap_binding.c b/lasso/id-wsf-2.0/soap_binding.c
index ebc7c62b..32a46b50 100644
--- a/lasso/id-wsf-2.0/soap_binding.c
+++ b/lasso/id-wsf-2.0/soap_binding.c
@@ -423,3 +423,26 @@ lasso_soap_envelope_set_sb2_user_interaction_hint(LassoSoapEnvelope *soap_envelo
lasso_release_string(user_interaction->interact);
}
}
+
+/**
+ * lasso_soap_envelope_get_soap_fault:
+ * @soap_envelope: a #LassoSoapEnvelope
+ * @create:(default FALSE): whether to create the SOAP Fault
+ *
+ * Return the first SOAP Fault in the Body of the soap message @soap_envelope.
+ *
+ * Return value:(transfer none)(allow-none): a #LassoSoapFault object or NULL.
+ */
+LassoSoapFault*
+lasso_soap_envelope_get_soap_fault(LassoSoapEnvelope *soap_envelope, gboolean create)
+{
+ LassoSoapFault *fault;
+
+ if (! LASSO_IS_SOAP_ENVELOPE(soap_envelope) || ! LASSO_SOAP_BODY(soap_envelope->Body))
+ return NULL;
+
+ fault = (LassoSoapFault*)_get_node(&soap_envelope->Body->any, LASSO_TYPE_SOAP_FAULT, NULL, NULL, NULL, create);
+
+ return fault;
+}
+
diff --git a/lasso/id-wsf-2.0/soap_binding.h b/lasso/id-wsf-2.0/soap_binding.h
index c04593d0..209b44f9 100644
--- a/lasso/id-wsf-2.0/soap_binding.h
+++ b/lasso/id-wsf-2.0/soap_binding.h
@@ -95,6 +95,9 @@ LASSO_EXPORT void lasso_soap_envelope_add_action(LassoSoapEnvelope *soap_envelop
LASSO_EXPORT LassoSoapDetail *lasso_soap_fault_get_detail(LassoSoapFault *soap_fault,
gboolean create);
+LASSO_EXPORT LassoSoapFault* lasso_soap_envelope_get_soap_fault(LassoSoapEnvelope *soap_envelope,
+ gboolean create);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */