1
/* $Id: soap_fault.c,v 1.1 2005/09/27 21:36:26 nclapies Exp $
3
* Lasso - A free implementation of the Liberty Alliance specifications.
5
* Copyright (C) 2004, 2005 Entr'ouvert
6
* http://lasso.entrouvert.org
8
* Authors: See AUTHORS file in top-level directory.
10
* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* (at your option) any later version.
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
20
* You should have received a copy of the GNU General Public License
21
* along with this program; if not, write to the Free Software
22
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25
#include <lasso/xml/soap_fault.h>
29
* <xs: element name="Fault" type="tns: Fault"/>
30
* <xs: complexType name="Fault" final="extension">
33
* Fault reporting structure
34
* </xs: documentation>
37
* <xs: element name="faultcode" type="xs: QName"/>
38
* <xs: element name="faultstring" type="xs: string"/>
39
* <xs: element name="faultactor" type="xs: anyURI" minOccurs="0"/>
40
* <xs: element name="detail" type="tns: detail" minOccurs="0"/>
44
* <xs: complexType name="detail">
46
* <xs: any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
48
* <xs: anyAttribute namespace="##any" processContents="lax"/>
53
/*****************************************************************************/
55
/*****************************************************************************/
57
static struct XmlSnippet schema_snippets[] = {
58
{ "faultcode", SNIPPET_CONTENT, G_STRUCT_OFFSET(LassoSoapFault, faultcode) },
59
{ "faultstring", SNIPPET_CONTENT, G_STRUCT_OFFSET(LassoSoapFault, faultstring) },
60
{ "detail", SNIPPET_LIST_NODES, G_STRUCT_OFFSET(LassoSoapFault, detail) },
64
/*****************************************************************************/
65
/* instance and class init functions */
66
/*****************************************************************************/
69
instance_init(LassoSoapFault *node)
71
node->faultcode = NULL;
72
node->faultstring = NULL;
73
node->faultactor = NULL;
78
class_init(LassoSoapFaultClass *klass)
80
LassoNodeClass *nclass = LASSO_NODE_CLASS(klass);
82
nclass->node_data = g_new0(LassoNodeClassData, 1);
83
lasso_node_class_set_nodename(nclass, "Fault");
84
lasso_node_class_set_ns(nclass, LASSO_SOAP_ENV_HREF, LASSO_SOAP_ENV_PREFIX);
85
lasso_node_class_add_snippets(nclass, schema_snippets);
89
lasso_soap_fault_get_type()
91
static GType this_type = 0;
94
static const GTypeInfo this_info = {
95
sizeof (LassoSoapFaultClass),
98
(GClassInitFunc) class_init,
101
sizeof(LassoSoapFault),
103
(GInstanceInitFunc) instance_init,
106
this_type = g_type_register_static(LASSO_TYPE_NODE,
107
"LassoSoapFault", &this_info, 0);
113
lasso_soap_fault_new()
115
LassoSoapFault *node;
117
node = g_object_new(LASSO_TYPE_SOAP_FAULT, NULL);
123
lasso_soap_fault_new_from_message(const gchar *message)
125
LassoSoapFault *node;
127
g_return_val_if_fail(message != NULL, NULL);
129
node = g_object_new(LASSO_TYPE_SOAP_FAULT, NULL);
130
lasso_node_init_from_message(LASSO_NODE(node), message);