diff options
| -rw-r--r-- | lasso/xml/Makefile.am | 8 | ||||
| -rw-r--r-- | lasso/xml/soap_binding_consent.c | 129 | ||||
| -rw-r--r-- | lasso/xml/soap_binding_consent.h | 75 | ||||
| -rw-r--r-- | lasso/xml/soap_binding_processing_context.c | 123 | ||||
| -rw-r--r-- | lasso/xml/soap_binding_processing_context.h | 74 | ||||
| -rw-r--r-- | lasso/xml/soap_binding_provider.c | 128 | ||||
| -rw-r--r-- | lasso/xml/soap_binding_provider.h | 76 | ||||
| -rw-r--r-- | lasso/xml/soap_binding_usage_directive.c | 130 | ||||
| -rw-r--r-- | lasso/xml/soap_binding_usage_directive.h | 77 |
9 files changed, 820 insertions, 0 deletions
diff --git a/lasso/xml/Makefile.am b/lasso/xml/Makefile.am index b1188847..f9f49161 100644 --- a/lasso/xml/Makefile.am +++ b/lasso/xml/Makefile.am @@ -102,7 +102,11 @@ liblasso_xml_la_SOURCES = \ samlp_response_abstract.c \ samlp_status.c \ samlp_status_code.c \ + soap_binding_consent.c \ soap_binding_correlation.c \ + soap_binding_processing_context.c \ + soap_binding_provider.c \ + soap_binding_usage_directive.c \ soap_binding_ext_credential.c \ soap_binding_ext_credentials_context.c \ soap_binding_ext_service_instance_update.c \ @@ -206,7 +210,11 @@ liblassoinclude_HEADERS = \ samlp_response_abstract.h \ samlp_status.h \ samlp_status_code.h \ + soap_binding_consent.h \ soap_binding_correlation.h \ + soap_binding_processing_context.h \ + soap_binding_provider.h \ + soap_binding_usage_directive.h \ soap_binding_ext_credential.h \ soap_binding_ext_credentials_context.h \ soap_binding_ext_service_instance_update.h \ diff --git a/lasso/xml/soap_binding_consent.c b/lasso/xml/soap_binding_consent.c new file mode 100644 index 00000000..cf34e1ae --- /dev/null +++ b/lasso/xml/soap_binding_consent.c @@ -0,0 +1,129 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include <lasso/xml/soap_binding_consent.h> + +/* + * Schema fragments (liberty-idwsf-soap-binding-v1.1.xsd): + * + * <xs:complexType name="ConsentType"> + * <xs:attribute name="uri" type="xs:anyURI" use="required"/> + * <xs:attribute name="timestamp" type="xs:dateTime" use="optional"/> + * <xs:attribute name="id" type="xs:ID" use="optional"/> + * <xs:attribute ref="S:mustUnderstand" use="optional"/> + * <xs:attribute ref="S:actor" use="optional"/> + * </xs:complexType> + * <xs:element name="Consent" type="ConsentType"/> + * + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + +static struct XmlSnippet schema_snippets[] = { + { "uri", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSoapBindingConsent, uri) }, + { "timestamp", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSoapBindingConsent, timestamp) }, + { "id", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoSoapBindingConsent, id) }, + { "mustUnderstand", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSoapBindingConsent, mustUnderstand) }, + { "actor", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoSoapBindingConsent, actor) }, + { NULL, 0, 0} +}; + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSoapBindingConsent *node) +{ + node->uri = NULL; + node->timestamp = NULL; + node->id = NULL; + node->mustUnderstand = NULL; + node->actor = NULL; +} + +static void +class_init(LassoSoapBindingConsentClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "Consent"); + lasso_node_class_set_ns(nclass, LASSO_SOAP_BINDING_HREF, LASSO_SOAP_BINDING_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_soap_binding_consent_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSoapBindingConsentClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSoapBindingConsent), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSoapBindingConsent", &this_info, 0); + } + return this_type; +} + +LassoSoapBindingConsent* +lasso_soap_binding_consent_new(const gchar *uri) +{ + LassoSoapBindingConsent *node; + + node = g_object_new(LASSO_TYPE_SOAP_BINDING_CONSENT, NULL); + + node->uri = g_strdup(uri); + + return node; +} + +LassoSoapBindingConsent* +lasso_soap_binding_consent_new_from_message(const gchar *message) +{ + LassoSoapBindingConsent *node; + + g_return_val_if_fail(message != NULL, NULL); + + node = g_object_new(LASSO_TYPE_SOAP_BINDING_CONSENT, NULL); + lasso_node_init_from_message(LASSO_NODE(node), message); + + return node; +} diff --git a/lasso/xml/soap_binding_consent.h b/lasso/xml/soap_binding_consent.h new file mode 100644 index 00000000..373a043e --- /dev/null +++ b/lasso/xml/soap_binding_consent.h @@ -0,0 +1,75 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __LASSO_SOAP_BINDING_CONSENT_H__ +#define __LASSO_SOAP_BINDING_CONSENT_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/xml/xml.h> + +#define LASSO_TYPE_SOAP_BINDING_CONSENT (lasso_soap_binding_consent_get_type()) +#define LASSO_SOAP_BINDING_CONSENT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \ + LASSO_TYPE_SOAP_BINDING_CONSENT, LassoSoapBindingConsent)) +#define LASSO_SOAP_BINDING_CONSENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \ + LASSO_TYPE_SOAP_BINDING_CONSENT, LassoSoapBindingConsentClass)) +#define LASSO_IS_SOAP_BINDING_CONSENT(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SOAP_BINDING_CONSENT)) +#define LASSO_IS_SOAP_BINDING_CONSENT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass),LASSO_TYPE_SOAP_BINDING_CONSENT)) +#define LASSO_SOAP_BINDING_CONSENT_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), \ + LASSO_TYPE_SOAP_BINDING_CONSENT, LassoSoapBindingConsentClass)) + +typedef struct _LassoSoapBindingConsent LassoSoapBindingConsent; +typedef struct _LassoSoapBindingConsentClass LassoSoapBindingConsentClass; + +struct _LassoSoapBindingConsent { + LassoNode parent; + + gchar *uri; + gchar *timestamp; + gchar *id; + gchar *mustUnderstand; + gchar *actor; +}; + +struct _LassoSoapBindingConsentClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_soap_binding_consent_get_type(void); + +LASSO_EXPORT LassoSoapBindingConsent* lasso_soap_binding_consent_new(const gchar *uri); + +LASSO_EXPORT LassoSoapBindingConsent* lasso_soap_binding_consent_new_from_message( + const gchar *message); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SOAP_BINDING_CONSENT_H__ */ diff --git a/lasso/xml/soap_binding_processing_context.c b/lasso/xml/soap_binding_processing_context.c new file mode 100644 index 00000000..bee51272 --- /dev/null +++ b/lasso/xml/soap_binding_processing_context.c @@ -0,0 +1,123 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include <lasso/xml/soap_binding_processing_context.h> + +/* + * Schema fragments (liberty-idwsf-soap-binding-v1.1.xsd): + * + * <xs:complexType name="ProcessingContextType"> + * <xs:simpleContent> + * <xs:extension base="xs:anyURI"> + * <xs:attribute name="id" type="xs:ID" use="optional"/> + * <xs:attribute ref="S:mustUnderstand" use="optional"/> + * <xs:attribute ref="S:actor" use="optional"/> + * </xs:extension> + * </xs:simpleContent> + * </xs:complexType> + * <xs:element name="ProcessingContext" type="ProcessingContextType"/> + * + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + +static struct XmlSnippet schema_snippets[] = { + { "id", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoSoapBindingProcessingContext, id) }, + { "mustUnderstand", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSoapBindingProcessingContext, mustUnderstand) }, + { "actor", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoSoapBindingProcessingContext, actor) }, + { NULL, 0, 0} +}; + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSoapBindingProcessingContext *node) +{ + node->id = NULL; + node->mustUnderstand = NULL; + node->actor = NULL; +} + +static void +class_init(LassoSoapBindingProcessingContextClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "ProcessingContext"); + lasso_node_class_set_ns(nclass, LASSO_SOAP_BINDING_HREF, LASSO_SOAP_BINDING_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_soap_binding_processing_context_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSoapBindingProcessingContextClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSoapBindingProcessingContext), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSoapBindingProcessingContext", &this_info, 0); + } + return this_type; +} + +LassoSoapBindingProcessingContext* +lasso_soap_binding_processing_context_new() +{ + LassoSoapBindingProcessingContext *node; + + node = g_object_new(LASSO_TYPE_SOAP_BINDING_PROCESSING_CONTEXT, NULL); + + return node; +} + +LassoSoapBindingProcessingContext* +lasso_soap_binding_processing_context_new_from_message(const gchar *message) +{ + LassoSoapBindingProcessingContext *node; + + g_return_val_if_fail(message != NULL, NULL); + + node = g_object_new(LASSO_TYPE_SOAP_BINDING_PROCESSING_CONTEXT, NULL); + lasso_node_init_from_message(LASSO_NODE(node), message); + + return node; +} diff --git a/lasso/xml/soap_binding_processing_context.h b/lasso/xml/soap_binding_processing_context.h new file mode 100644 index 00000000..f1cf18ec --- /dev/null +++ b/lasso/xml/soap_binding_processing_context.h @@ -0,0 +1,74 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __LASSO_SOAP_BINDING_PROCESSING_CONTEXT_H__ +#define __LASSO_SOAP_BINDING_PROCESSING_CONTEXT_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/xml/xml.h> + +#define LASSO_TYPE_SOAP_BINDING_PROCESSING_CONTEXT \ + (lasso_soap_binding_processing_context_get_type()) +#define LASSO_SOAP_BINDING_PROCESSING_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \ + LASSO_TYPE_SOAP_BINDING_PROCESSING_CONTEXT, LassoSoapBindingProcessingContext)) +#define LASSO_SOAP_BINDING_PROCESSING_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \ + LASSO_TYPE_SOAP_BINDING_PROCESSING_CONTEXT, LassoSoapBindingProcessingContextClass)) +#define LASSO_IS_SOAP_BINDING_PROCESSING_CONTEXT(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SOAP_BINDING_PROCESSING_CONTEXT)) +#define LASSO_IS_SOAP_BINDING_PROCESSING_CONTEXT_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass),LASSO_TYPE_SOAP_BINDING_PROCESSING_CONTEXT)) +#define LASSO_SOAP_BINDING_PROCESSING_CONTEXT_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SOAP_BINDING_PROCESSING_CONTEXT, \ + LassoSoapBindingProcessingContextClass)) + +typedef struct _LassoSoapBindingProcessingContext LassoSoapBindingProcessingContext; +typedef struct _LassoSoapBindingProcessingContextClass LassoSoapBindingProcessingContextClass; + +struct _LassoSoapBindingProcessingContext { + LassoNode parent; + + gchar *id; + gchar *mustUnderstand; + gchar *actor; +}; + +struct _LassoSoapBindingProcessingContextClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_soap_binding_processing_context_get_type(void); + +LASSO_EXPORT LassoSoapBindingProcessingContext* lasso_soap_binding_processing_context_new(); + +LASSO_EXPORT LassoSoapBindingProcessingContext* \ + lasso_soap_binding_processing_context_new_from_message(const gchar *message); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SOAP_BINDING_PROCESSING_CONTEXT_H__ */ diff --git a/lasso/xml/soap_binding_provider.c b/lasso/xml/soap_binding_provider.c new file mode 100644 index 00000000..a56962ce --- /dev/null +++ b/lasso/xml/soap_binding_provider.c @@ -0,0 +1,128 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include <lasso/xml/soap_binding_provider.h> + +/* + * Schema fragments (liberty-idwsf-soap-binding-v1.1.xsd): + * <xs:complexType name="ProviderType"> + * <xs:attribute name="providerID" type="xs:anyURI" use="required"/> + * <xs:attribute name="affiliationID" type="xs: nyURI" use="optional"/> + * <xs:attribute name="id" type="xs:ID" use="optional"/> + * <xs:attribute ref="S:mustUnderstand" use="optional"/> + * <xs:attribute ref="S:actor" use="optional"/> + * </xs:complexType> + * <xs:element name="Provider" type="ProviderType"/> + * + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + +static struct XmlSnippet schema_snippets[] = { + { "providerID", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSoapBindingProvider, providerID) }, + { "affiliationID", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSoapBindingProvider, affiliationID) }, + { "id", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoSoapBindingProvider, id) }, + { "mustUnderstand", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSoapBindingProvider, mustUnderstand) }, + { "actor", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoSoapBindingProvider, actor) }, + { NULL, 0, 0} +}; + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSoapBindingProvider *node) +{ + node->providerID = NULL; + node->affiliationID = NULL; + node->id = NULL; + node->mustUnderstand = NULL; + node->actor = NULL; +} + +static void +class_init(LassoSoapBindingProviderClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "Provider"); + lasso_node_class_set_ns(nclass, LASSO_SOAP_BINDING_HREF, LASSO_SOAP_BINDING_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_soap_binding_provider_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSoapBindingProviderClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSoapBindingProvider), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSoapBindingProvider", &this_info, 0); + } + return this_type; +} + +LassoSoapBindingProvider* +lasso_soap_binding_provider_new(const gchar *providerID) +{ + LassoSoapBindingProvider *node; + + node = g_object_new(LASSO_TYPE_SOAP_BINDING_PROVIDER, NULL); + + node->providerID = g_strdup(providerID); + + return node; +} + +LassoSoapBindingProvider* +lasso_soap_binding_provider_new_from_message(const gchar *message) +{ + LassoSoapBindingProvider *node; + + g_return_val_if_fail(message != NULL, NULL); + + node = g_object_new(LASSO_TYPE_SOAP_BINDING_PROVIDER, NULL); + lasso_node_init_from_message(LASSO_NODE(node), message); + + return node; +} diff --git a/lasso/xml/soap_binding_provider.h b/lasso/xml/soap_binding_provider.h new file mode 100644 index 00000000..05ddeda9 --- /dev/null +++ b/lasso/xml/soap_binding_provider.h @@ -0,0 +1,76 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __LASSO_SOAP_BINDING_PROVIDER_H__ +#define __LASSO_SOAP_BINDING_PROVIDER_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/xml/xml.h> + +#define LASSO_TYPE_SOAP_BINDING_PROVIDER (lasso_soap_binding_provider_get_type()) +#define LASSO_SOAP_BINDING_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \ + LASSO_TYPE_SOAP_BINDING_PROVIDER, LassoSoapBindingProvider)) +#define LASSO_SOAP_BINDING_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \ + LASSO_TYPE_SOAP_BINDING_PROVIDER, LassoSoapBindingProviderClass)) +#define LASSO_IS_SOAP_BINDING_PROVIDER(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SOAP_BINDING_PROVIDER)) +#define LASSO_IS_SOAP_BINDING_PROVIDER_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass),LASSO_TYPE_SOAP_BINDING_PROVIDER)) +#define LASSO_SOAP_BINDING_PROVIDER_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), \ + LASSO_TYPE_SOAP_BINDING_PROVIDER, LassoSoapBindingProviderClass)) + +typedef struct _LassoSoapBindingProvider LassoSoapBindingProvider; +typedef struct _LassoSoapBindingProviderClass LassoSoapBindingProviderClass; + +struct _LassoSoapBindingProvider { + LassoNode parent; + + gchar *providerID; + gchar *affiliationID; + + gchar *id; + gchar *mustUnderstand; + gchar *actor; +}; + +struct _LassoSoapBindingProviderClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_soap_binding_provider_get_type(void); + +LASSO_EXPORT LassoSoapBindingProvider* lasso_soap_binding_provider_new(const gchar *providerID); + +LASSO_EXPORT LassoSoapBindingProvider* lasso_soap_binding_provider_new_from_message( + const gchar *message); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SOAP_BINDING_PROVIDER_H__ */ diff --git a/lasso/xml/soap_binding_usage_directive.c b/lasso/xml/soap_binding_usage_directive.c new file mode 100644 index 00000000..99d65b95 --- /dev/null +++ b/lasso/xml/soap_binding_usage_directive.c @@ -0,0 +1,130 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include <lasso/xml/soap_binding_usage_directive.h> + +/* + * Schema fragments (liberty-idwsf-soap-binding-v1.1.xsd): + * <xs:complexType name="UsageDirectiveType"> + * <xs:sequence> + * <xs:any namespace="##other" processContents="lax" maxOccurs="unbounded"/> + * </xs:sequence> + * <xs:attribute name="id" type="xs:ID" use="optional"/> + * <xs:attribute name="ref" type="xs:IDREF" use="required"/> + * <xs:attribute ref="S:mustUnderstand" use="optional"/> + * <xs:attribute ref="S:actor" use="optional"/> + * </xs:complexType> + * <xs:element name="UsageDirective" type="UsageDirectiveType"/> + * + */ + +/*****************************************************************************/ +/* private methods */ +/*****************************************************************************/ + +static struct XmlSnippet schema_snippets[] = { + { "", SNIPPET_LIST_NODES, + G_STRUCT_OFFSET(LassoSoapBindingUsageDirective, other) }, + { "ref", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSoapBindingUsageDirective, ref) }, + { "id", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoSoapBindingUsageDirective, id) }, + { "mustUnderstand", SNIPPET_ATTRIBUTE, + G_STRUCT_OFFSET(LassoSoapBindingUsageDirective, mustUnderstand) }, + { "actor", SNIPPET_ATTRIBUTE, G_STRUCT_OFFSET(LassoSoapBindingUsageDirective, actor) }, + { NULL, 0, 0} +}; + +/*****************************************************************************/ +/* instance and class init functions */ +/*****************************************************************************/ + +static void +instance_init(LassoSoapBindingUsageDirective *node) +{ + node->other = NULL; + node->ref = 0; + node->id = NULL; + node->mustUnderstand = NULL; + node->actor = NULL; +} + +static void +class_init(LassoSoapBindingUsageDirectiveClass *klass) +{ + LassoNodeClass *nclass = LASSO_NODE_CLASS(klass); + + nclass->node_data = g_new0(LassoNodeClassData, 1); + lasso_node_class_set_nodename(nclass, "UsageDirective"); + lasso_node_class_set_ns(nclass, LASSO_SOAP_BINDING_HREF, LASSO_SOAP_BINDING_PREFIX); + lasso_node_class_add_snippets(nclass, schema_snippets); +} + +GType +lasso_soap_binding_usage_directive_get_type() +{ + static GType this_type = 0; + + if (!this_type) { + static const GTypeInfo this_info = { + sizeof (LassoSoapBindingUsageDirectiveClass), + NULL, + NULL, + (GClassInitFunc) class_init, + NULL, + NULL, + sizeof(LassoSoapBindingUsageDirective), + 0, + (GInstanceInitFunc) instance_init, + }; + + this_type = g_type_register_static(LASSO_TYPE_NODE, + "LassoSoapBindingUsageDirective", &this_info, 0); + } + return this_type; +} + +LassoSoapBindingUsageDirective* +lasso_soap_binding_usage_directive_new(const gchar *ref) +{ + LassoSoapBindingUsageDirective *node; + + node = g_object_new(LASSO_TYPE_SOAP_BINDING_USAGE_DIRECTIVE, NULL); + + node->ref = g_strdup(ref); + + return node; +} + +LassoSoapBindingUsageDirective* +lasso_soap_binding_usage_directive_new_from_message(const gchar *message) +{ + LassoSoapBindingUsageDirective *node; + + g_return_val_if_fail(message != NULL, NULL); + + node = g_object_new(LASSO_TYPE_SOAP_BINDING_USAGE_DIRECTIVE, NULL); + lasso_node_init_from_message(LASSO_NODE(node), message); + + return node; +} diff --git a/lasso/xml/soap_binding_usage_directive.h b/lasso/xml/soap_binding_usage_directive.h new file mode 100644 index 00000000..17af797e --- /dev/null +++ b/lasso/xml/soap_binding_usage_directive.h @@ -0,0 +1,77 @@ +/* $Id$ + * + * Lasso - A free implementation of the Liberty Alliance specifications. + * + * Copyright (C) 2004, 2005 Entr'ouvert + * http://lasso.entrouvert.org + * + * Authors: See AUTHORS file in top-level directory. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __LASSO_SOAP_BINDING_USAGE_DIRECTIVE_H__ +#define __LASSO_SOAP_BINDING_USAGE_DIRECTIVE_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <lasso/xml/xml.h> + +#define LASSO_TYPE_SOAP_BINDING_USAGE_DIRECTIVE (lasso_soap_binding_usage_directive_get_type()) +#define LASSO_SOAP_BINDING_USAGE_DIRECTIVE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \ + LASSO_TYPE_SOAP_BINDING_USAGE_DIRECTIVE, LassoSoapBindingUsageDirective)) +#define LASSO_SOAP_BINDING_USAGE_DIRECTIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \ + LASSO_TYPE_SOAP_BINDING_USAGE_DIRECTIVE, LassoSoapBindingUsageDirectiveClass)) +#define LASSO_IS_SOAP_BINDING_USAGE_DIRECTIVE(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SOAP_BINDING_USAGE_DIRECTIVE)) +#define LASSO_IS_SOAP_BINDING_USAGE_DIRECTIVE_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass),LASSO_TYPE_SOAP_BINDING_USAGE_DIRECTIVE)) +#define LASSO_SOAP_BINDING_USAGE_DIRECTIVE_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), \ + LASSO_TYPE_SOAP_BINDING_USAGE_DIRECTIVE, LassoSoapBindingUsageDirectiveClass)) + +typedef struct _LassoSoapBindingUsageDirective LassoSoapBindingUsageDirective; +typedef struct _LassoSoapBindingUsageDirectiveClass LassoSoapBindingUsageDirectiveClass; + +struct _LassoSoapBindingUsageDirective { + LassoNode parent; + + GList *other; + + gchar *id; + gchar *ref; + gchar *mustUnderstand; + gchar *actor; +}; + +struct _LassoSoapBindingUsageDirectiveClass { + LassoNodeClass parent; +}; + +LASSO_EXPORT GType lasso_soap_binding_usage_directive_get_type(void); + +LASSO_EXPORT LassoSoapBindingUsageDirective* lasso_soap_binding_usage_directive_new( + const gchar *ref); + +LASSO_EXPORT LassoSoapBindingUsageDirective* lasso_soap_binding_usage_directive_new_from_message( + const gchar *message); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __LASSO_SOAP_BINDING_USAGE_DIRECTIVE_H__ */ |
