summaryrefslogtreecommitdiffstats
path: root/libcsoap/soap-fault.h
diff options
context:
space:
mode:
authorGravatar m0gg2006-11-21 20:58:59 +0000
committerGravatar m0gg2006-11-21 20:58:59 +0000
commitc3fd98b25607d0f7f5977586d188f88ab226a9b8 (patch)
treecc4976a3be9d3984e4ae62c08afd1dcf9530dc5e /libcsoap/soap-fault.h
parentcd94b25993049a596b163f0ad8b3a2340e024cc3 (diff)
downloadcsoap-c3fd98b25607d0f7f5977586d188f88ab226a9b8.tar.gz
csoap-c3fd98b25607d0f7f5977586d188f88ab226a9b8.tar.bz2
decoupling of nanohttp/libcsoap
Diffstat (limited to 'libcsoap/soap-fault.h')
-rw-r--r--libcsoap/soap-fault.h104
1 files changed, 90 insertions, 14 deletions
diff --git a/libcsoap/soap-fault.h b/libcsoap/soap-fault.h
index 5aad5ed..1a11365 100644
--- a/libcsoap/soap-fault.h
+++ b/libcsoap/soap-fault.h
@@ -1,5 +1,5 @@
/******************************************************************
- * $Id: soap-fault.h,v 1.5 2006/03/06 13:37:38 m0gg Exp $
+ * $Id: soap-fault.h,v 1.6 2006/11/21 20:59:02 m0gg Exp $
*
* CSOAP Project: A SOAP client/server library in C
* Copyright (C) 2003 Ferhat Ayaz
@@ -21,28 +21,104 @@
*
* Email: ayaz@jprogrammer.net
******************************************************************/
-#ifndef cSOAP_FAULT_H
-#define cSOAP_FAULT_H
+#ifndef __csoap_fault_h
+#define __csoap_fault_h
-#include <libcsoap/soap-xml.h>
+/**
+ *
+ * The SOAP Fault element is used to carry error and/or status information within
+ * a SOAP message. If present, the SOAP Fault element MUST appear as a body entry
+ * and MUST NOT appear more than once within a Body element.
+ *
+ * The SOAP Fault element defines the following four subelements:
+ *
+ * # faultcode - The faultcode element is intended for use by software to provide
+ * an algorithmic mechanism for identifying the fault. The faultcode MUST be
+ * present in a SOAP Fault element and the faultcode value MUST be a qualified
+ * name as defined in "Namespaces in XML", section 3. SOAP defines a small set
+ * of SOAP fault codes covering basic SOAP faults (see section 4.4.1).
+ * # faultstring - The faultstring element is intended to provide a human
+ * readable explanation of the fault and is not intended for algorithmic
+ * processing. The faultstring element is similar to the 'Reason-Phrase' defined
+ * by HTTP (see RFC2616, section 6.1). It MUST be present in a SOAP Fault
+ * element and SHOULD provide at least some information explaining the nature
+ * of the fault.
+ * # faultactor - The faultactor element is intended to provide information about
+ * who caused the fault to happen within the message path (see section 2). It is
+ * similar to the SOAP actor attribute (see section 4.2.2) but instead of
+ * indicating the destination of the header entry, it indicates the source of
+ * the fault. The value of the faultactor attribute is a URI identifying the
+ * source. Applications that do not act as the ultimate destination of the SOAP
+ * message MUST include the faultactor element in a SOAP Fault element. The
+ * ultimate destination of a message MAY use the faultactor element to indicate
+ * explicitly that it generated the fault (see also the detail element below).
+ * # detail - The detail element is intended for carrying application specific
+ * error information related to the Body element. It MUST be present if the
+ * contents of the Body element could not be successfully processed. It MUST
+ * NOT be used to carry information about error information belonging to header
+ * entries. Detailed error information belonging to header entries MUST be
+ * carried within header entries.
+ *
+ */
+
+/**
+ *
+ * The faulting node found an invalid element information item instead of the
+ * expected Envelope element information item. The namespace, local name or both
+ * did not match the Envelope element information item required by this
+ * recommendation (see 2.8 SOAP Versioning Model and 5.4.7 VersionMismatch
+ * Faults)
+ *
+ */
+#define SOAP_FAULT_VERSION_MISMATCH 0
+/**
+ *
+ * An immediate child element information item of the SOAP Header element
+ * information item targeted at the faulting node that was not understood by the
+ * faulting node contained a SOAP mustUnderstand attribute information item with
+ * a value of "true" (see 5.2.3 SOAP mustUnderstand Attribute and 5.4.8 SOAP
+ * mustUnderstand Faults)
+ *
+ */
+#define SOAP_FAULT_MUST_UNDERSTAND 1
+/**
+ *
+ * A SOAP header block or SOAP body child element information item targeted at
+ * the faulting SOAP node is scoped (see 5.1.1 SOAP encodingStyle Attribute) with
+ * a data encoding that the faulting node does not support.
+ *
+ */
+#define SOAP_FAULT_DATA_ENCODING_UNKOWN 2
-typedef enum _fault_code
-{
- Fault_VersionMismatch,
- Fault_MustUnderstand,
- Fault_Client,
- Fault_Server
-} fault_code_t;
+/**
+ *
+ * The message could not be processed for reasons attributable to the processing
+ * of the message rather than to the contents of the message itself. For example,
+ * processing could include communicating with an upstream SOAP node, which did
+ * not respond. The message could succeed if resent at a later point in time (see
+ * also 5.4 SOAP Fault for a description of the SOAP fault detail sub-element).
+ *
+ */
+#define SOAP_FAULT_RECEIVER 4
+
+/**
+ *
+ * The message was incorrectly formed or did not contain the appropriate
+ * information in order to succeed. For example, the message could lack the
+ * proper authentication or payment information. It is generally an indication
+ * that the message is not to be resent without change (see also 5.4 SOAP Fault
+ * for a description of the SOAP fault detail sub-element).
+ *
+ */
+#define SOAP_FAULT_SENDER 3
#ifdef __cplusplus
extern "C" {
#endif
-xmlDocPtr soap_fault_build(fault_code_t faultcode,
- const char *faultstring,
- const char *faultactor, const char *detail);
+extern xmlDocPtr soap_fault_build(int fault_code, const char *fault_string, const char *fault_actor, const char *detail);
#ifdef __cplusplus
}