[evolution-ews] ESoapMessage cleanups.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-ews] ESoapMessage cleanups.
- Date: Fri, 13 Jul 2012 12:33:52 +0000 (UTC)
commit dcf78e97350645f0be717309f0e070d267f3a1bc
Author: Matthew Barnes <mbarnes redhat com>
Date: Thu Jul 12 17:22:44 2012 -0400
ESoapMessage cleanups.
src/server/e-ews-message.c | 42 +++--
src/server/e-ews-message.h | 7 +-
src/server/e-soap-message.c | 514 ++++++++++++++++++++-----------------------
src/server/e-soap-message.h | 194 ++++++++++-------
4 files changed, 384 insertions(+), 373 deletions(-)
---
diff --git a/src/server/e-ews-message.c b/src/server/e-ews-message.c
index f929ef7..8c523b6 100644
--- a/src/server/e-ews-message.c
+++ b/src/server/e-ews-message.c
@@ -36,16 +36,22 @@ e_ews_message_new_with_header (const gchar *uri,
ESoapMessage *msg;
const gchar *server_ver;
- msg = e_soap_message_new (SOUP_METHOD_POST, uri, FALSE, NULL, NULL, NULL);
- if (!msg) {
+ msg = e_soap_message_new (
+ SOUP_METHOD_POST, uri, FALSE, NULL, NULL, NULL);
+ if (msg == NULL) {
g_warning (G_STRLOC ": Could not build SOAP message");
return NULL;
}
- soup_message_headers_append (SOUP_MESSAGE (msg)->request_headers, "Content-Type", "text/xml; charset=utf-8");
- soup_message_headers_append (SOUP_MESSAGE (msg)->request_headers, "User-Agent",
- "Evolution/" VERSION);
- soup_message_headers_append (SOUP_MESSAGE (msg)->request_headers,"Connection", "Keep-Alive");
+ soup_message_headers_append (
+ SOUP_MESSAGE (msg)->request_headers,
+ "Content-Type", "text/xml; charset=utf-8");
+ soup_message_headers_append (
+ SOUP_MESSAGE (msg)->request_headers,
+ "User-Agent", "Evolution/" VERSION);
+ soup_message_headers_append (
+ SOUP_MESSAGE (msg)->request_headers,
+ "Connection", "Keep-Alive");
e_soap_message_start_envelope (msg);
@@ -57,21 +63,26 @@ e_ews_message_new_with_header (const gchar *uri,
e_soap_message_start_header (msg);
- e_soap_message_start_element (msg, "RequestServerVersion", "types",
- "http://schemas.microsoft.com/exchange/services/2006/types");
+ e_soap_message_start_element (
+ msg, "RequestServerVersion", "types",
+ "http://schemas.microsoft.com/exchange/services/2006/types");
e_soap_message_add_attribute (msg, "Version", server_ver, NULL, NULL);
e_soap_message_end_element (msg);
e_soap_message_end_header (msg);
e_soap_message_start_body (msg);
- e_soap_message_add_namespace(msg, "messages",
- "http://schemas.microsoft.com/exchange/services/2006/messages");
+ e_soap_message_add_namespace(
+ msg, "messages",
+ "http://schemas.microsoft.com/exchange/services/2006/messages");
e_soap_message_start_element(msg, method_name, "messages", NULL);
- e_soap_message_set_default_namespace (msg,
- "http://schemas.microsoft.com/exchange/services/2006/types");
- if (attribute_name)
- e_soap_message_add_attribute (msg, attribute_name, attribute_value, NULL, NULL);
+ e_soap_message_set_default_namespace (
+ msg,
+ "http://schemas.microsoft.com/exchange/services/2006/types");
+ if (attribute_name != NULL)
+ e_soap_message_add_attribute (
+ msg, attribute_name, attribute_value, NULL, NULL);
+
return msg;
}
@@ -95,7 +106,8 @@ e_ews_message_write_string_parameter_with_attribute (ESoapMessage *msg,
const gchar *attribute_value)
{
e_soap_message_start_element (msg, name, prefix, NULL);
- e_soap_message_add_attribute (msg, attribute_name, attribute_value, NULL, NULL);
+ e_soap_message_add_attribute (
+ msg, attribute_name, attribute_value, NULL, NULL);
e_soap_message_write_string (msg, value);
e_soap_message_end_element (msg);
}
diff --git a/src/server/e-ews-message.h b/src/server/e-ews-message.h
index a5067de..ed2ec7b 100644
--- a/src/server/e-ews-message.h
+++ b/src/server/e-ews-message.h
@@ -39,8 +39,10 @@ ESoapMessage * e_ews_message_new_with_header (const gchar *uri,
const gchar *attribute_value,
EwsServerVersion version);
void e_ews_message_write_string_parameter
- (ESoapMessage *msg, const gchar *name,
- const gchar *prefix, const gchar *value);
+ (ESoapMessage *msg,
+ const gchar *name,
+ const gchar *prefix,
+ const gchar *value);
void e_ews_message_write_string_parameter_with_attribute
(ESoapMessage *msg,
const gchar *name,
@@ -58,7 +60,6 @@ void e_ews_message_write_int_parameter
const gchar *name,
const gchar *prefix,
glong value);
-
void e_ews_message_write_footer (ESoapMessage *msg);
G_END_DECLS
diff --git a/src/server/e-soap-message.c b/src/server/e-soap-message.c
index 587d084..69301e8 100644
--- a/src/server/e-soap-message.c
+++ b/src/server/e-soap-message.c
@@ -13,9 +13,11 @@
#endif
#include "e-soap-message.h"
-G_DEFINE_TYPE (ESoapMessage, e_soap_message, SOUP_TYPE_MESSAGE)
+#define E_SOAP_MESSAGE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_SOAP_MESSAGE, ESoapMessagePrivate))
-typedef struct {
+struct _ESoapMessagePrivate {
/* Serialization fields */
xmlParserCtxtPtr ctxt;
xmlDocPtr doc;
@@ -41,56 +43,66 @@ typedef struct {
gsize response_received;
ESoapProgressFn progress_fn;
gpointer progress_data;
+};
-} ESoapMessagePrivate;
-#define E_SOAP_MESSAGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), E_TYPE_SOAP_MESSAGE, ESoapMessagePrivate))
+G_DEFINE_TYPE (ESoapMessage, e_soap_message, SOUP_TYPE_MESSAGE)
static void
-finalize (GObject *object)
+soap_message_finalize (GObject *object)
{
- ESoapMessagePrivate *priv = E_SOAP_MESSAGE_GET_PRIVATE (object);
+ ESoapMessagePrivate *priv;
- if (priv->ctxt) {
- if (priv->ctxt->myDoc)
+ priv = E_SOAP_MESSAGE_GET_PRIVATE (object);
+
+ if (priv->ctxt != NULL) {
+ if (priv->ctxt->myDoc != NULL)
xmlFreeDoc (priv->ctxt->myDoc);
xmlFreeParserCtxt (priv->ctxt);
}
- if (priv->doc)
+
+ if (priv->doc != NULL)
xmlFreeDoc (priv->doc);
- if (priv->action)
+
+ if (priv->action != NULL)
g_free (priv->action);
- if (priv->env_uri)
+
+ if (priv->env_uri != NULL)
xmlFree (priv->env_uri);
- if (priv->env_prefix)
+
+ if (priv->env_prefix != NULL)
xmlFree (priv->env_prefix);
g_free (priv->steal_node);
g_free (priv->steal_dir);
+
if (priv->steal_fd != -1)
close (priv->steal_fd);
+
+ /* Chain up to parent's finalize() method. */
G_OBJECT_CLASS (e_soap_message_parent_class)->finalize (object);
}
static void
-e_soap_message_class_init (ESoapMessageClass *e_soap_message_class)
+e_soap_message_class_init (ESoapMessageClass *class)
{
- GObjectClass *object_class = G_OBJECT_CLASS (e_soap_message_class);
+ GObjectClass *object_class;
- g_type_class_add_private (e_soap_message_class, sizeof (ESoapMessagePrivate));
+ g_type_class_add_private (class, sizeof (ESoapMessagePrivate));
- object_class->finalize = finalize;
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = soap_message_finalize;
}
static void
e_soap_message_init (ESoapMessage *msg)
{
- ESoapMessagePrivate *priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
+ msg->priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
/* initialize XML structures */
- priv->doc = xmlNewDoc ((const xmlChar *)"1.0");
- priv->doc->standalone = FALSE;
- priv->doc->encoding = xmlCharStrdup ("UTF-8");
- priv->steal_fd = -1;
+ msg->priv->doc = xmlNewDoc ((const xmlChar *) "1.0");
+ msg->priv->doc->standalone = FALSE;
+ msg->priv->doc->encoding = xmlCharStrdup ("UTF-8");
+ msg->priv->steal_fd = -1;
}
static xmlNsPtr
@@ -106,7 +118,7 @@ fetch_ns (ESoapMessage *msg,
else if (prefix && !ns_uri) {
ns = xmlSearchNs (priv->doc, priv->last_node, (const xmlChar *) prefix);
if (!ns)
- ns = xmlNewNs (priv->last_node, (const xmlChar *)"", (const xmlChar *)prefix);
+ ns = xmlNewNs (priv->last_node, (const xmlChar *) "", (const xmlChar *)prefix);
}
return ns;
@@ -288,8 +300,6 @@ soap_got_chunk (SoupMessage *msg,
*
* Returns: the new #ESoapMessage (or %NULL if @uri_string could not be
* parsed).
- *
- * Since: 2.92
*/
ESoapMessage *
e_soap_message_new (const gchar *method,
@@ -334,8 +344,6 @@ e_soap_message_new (const gchar *method,
* Creates a new empty #ESoapMessage, which will connect to @uri
*
* Returns: the new #ESoapMessage
- *
- * Since: 2.92
*/
ESoapMessage *
e_soap_message_new_from_uri (const gchar *method,
@@ -346,26 +354,23 @@ e_soap_message_new_from_uri (const gchar *method,
const gchar *env_uri)
{
ESoapMessage *msg;
- ESoapMessagePrivate *priv;
-
- msg = g_object_new (E_TYPE_SOAP_MESSAGE,
- SOUP_MESSAGE_METHOD, method,
- SOUP_MESSAGE_URI, uri,
- NULL);
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
+ msg = g_object_new (
+ E_TYPE_SOAP_MESSAGE,
+ SOUP_MESSAGE_METHOD, method,
+ SOUP_MESSAGE_URI, uri, NULL);
- priv->doc->standalone = standalone;
+ msg->priv->doc->standalone = standalone;
if (xml_encoding) {
- xmlFree ((xmlChar *) priv->doc->encoding);
- priv->doc->encoding = xmlCharStrdup (xml_encoding);
+ xmlFree ((xmlChar *) msg->priv->doc->encoding);
+ msg->priv->doc->encoding = xmlCharStrdup (xml_encoding);
}
- if (env_prefix)
- priv->env_prefix = xmlCharStrdup (env_prefix);
- if (env_uri)
- priv->env_uri = xmlCharStrdup (env_uri);
+ if (env_prefix != NULL)
+ msg->priv->env_prefix = xmlCharStrdup (env_prefix);
+ if (env_uri != NULL)
+ msg->priv->env_uri = xmlCharStrdup (env_uri);
return msg;
}
@@ -380,8 +385,6 @@ e_soap_message_new_from_uri (const gchar *method,
* This requests that character data for certain XML nodes should
* be streamed directly to a disk file as it arrives, rather than
* being stored in memory in the soup response buffer.
- *
- * Since: xxx
*/
void
@@ -390,14 +393,11 @@ e_soap_message_store_node_data (ESoapMessage *msg,
const gchar *directory,
gboolean base64)
{
- ESoapMessagePrivate *priv;
-
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
- priv->steal_node = g_strdup (nodename);
- priv->steal_dir = g_strdup (directory);
- priv->steal_base64 = base64;
+ msg->priv->steal_node = g_strdup (nodename);
+ msg->priv->steal_dir = g_strdup (directory);
+ msg->priv->steal_base64 = base64;
}
/**
@@ -407,21 +407,16 @@ e_soap_message_store_node_data (ESoapMessage *msg,
* @object: first argument to callback function
*
* Starts the top level SOAP Envelope element.
- *
- * Since: xxx
*/
void
e_soap_message_set_progress_fn (ESoapMessage *msg,
ESoapProgressFn fn,
gpointer object)
{
- ESoapMessagePrivate *priv;
-
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
- priv->progress_fn = fn;
- priv->progress_data = object;
+ msg->priv->progress_fn = fn;
+ msg->priv->progress_data = object;
}
/**
@@ -429,47 +424,54 @@ e_soap_message_set_progress_fn (ESoapMessage *msg,
* @msg: the %ESoapMessage.
*
* Starts the top level SOAP Envelope element.
- *
- * Since: 2.92
*/
void
e_soap_message_start_envelope (ESoapMessage *msg)
{
- ESoapMessagePrivate *priv;
-
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
- priv->last_node = priv->doc->xmlRootNode =
- xmlNewDocNode (priv->doc, NULL, (const xmlChar *)"Envelope", NULL);
-
- priv->soap_ns = xmlNewNs (priv->doc->xmlRootNode,
- priv->env_uri ? priv->env_uri :
- (const xmlChar *)"http://schemas.xmlsoap.org/soap/envelope/",
- priv->env_prefix ? priv->env_prefix : (const xmlChar *)"SOAP-ENV");
- if (priv->env_uri) {
- xmlFree (priv->env_uri);
- priv->env_uri = NULL;
+ msg->priv->doc->xmlRootNode = xmlNewDocNode (
+ msg->priv->doc, NULL,
+ (const xmlChar *) "Envelope",
+ (const xmlChar *) NULL);
+ msg->priv->last_node = msg->priv->doc->xmlRootNode;
+
+ msg->priv->soap_ns = xmlNewNs (
+ msg->priv->doc->xmlRootNode,
+ msg->priv->env_uri ? msg->priv->env_uri :
+ (const xmlChar *) "http://schemas.xmlsoap.org/soap/envelope/",
+ msg->priv->env_prefix ? msg->priv->env_prefix :
+ (const xmlChar *) "SOAP-ENV");
+
+ if (msg->priv->env_uri != NULL) {
+ xmlFree (msg->priv->env_uri);
+ msg->priv->env_uri = NULL;
}
- if (priv->env_prefix) {
- xmlFree (priv->env_prefix);
- priv->env_prefix = NULL;
+
+ if (msg->priv->env_prefix) {
+ xmlFree (msg->priv->env_prefix);
+ msg->priv->env_prefix = NULL;
}
- xmlSetNs (priv->doc->xmlRootNode, priv->soap_ns);
-
- xmlNewNs (priv->doc->xmlRootNode,
- (const xmlChar *)"http://schemas.xmlsoap.org/soap/encoding/",
- (const xmlChar *)"SOAP-ENC");
- xmlNewNs (priv->doc->xmlRootNode,
- (const xmlChar *)"http://www.w3.org/1999/XMLSchema",
- (const xmlChar *)"xsd");
- xmlNewNs (priv->doc->xmlRootNode,
- (const xmlChar *)"http://schemas.xmlsoap.org/soap/envelope/",
- (const xmlChar *)"SOAP-ENV");
- priv->xsi_ns = xmlNewNs (priv->doc->xmlRootNode,
- (const xmlChar *)"http://www.w3.org/1999/XMLSchema-instance",
- (const xmlChar *)"xsi");
+ xmlSetNs (
+ msg->priv->doc->xmlRootNode,
+ msg->priv->soap_ns);
+ xmlNewNs (
+ msg->priv->doc->xmlRootNode,
+ (const xmlChar *) "http://schemas.xmlsoap.org/soap/encoding/",
+ (const xmlChar *) "SOAP-ENC");
+ xmlNewNs (
+ msg->priv->doc->xmlRootNode,
+ (const xmlChar *) "http://www.w3.org/1999/XMLSchema",
+ (const xmlChar *) "xsd");
+ xmlNewNs (
+ msg->priv->doc->xmlRootNode,
+ (const xmlChar *) "http://schemas.xmlsoap.org/soap/envelope/",
+ (const xmlChar *) "SOAP-ENV");
+ msg->priv->xsi_ns = xmlNewNs (
+ msg->priv->doc->xmlRootNode,
+ (const xmlChar *) "http://www.w3.org/1999/XMLSchema-instance",
+ (const xmlChar *) "xsi");
}
/**
@@ -477,8 +479,6 @@ e_soap_message_start_envelope (ESoapMessage *msg)
* @msg: the %ESoapMessage.
*
* Closes the top level SOAP Envelope element.
- *
- * Since: 2.92
*/
void
e_soap_message_end_envelope (ESoapMessage *msg)
@@ -491,25 +491,21 @@ e_soap_message_end_envelope (ESoapMessage *msg)
* @msg: the %ESoapMessage.
*
* Starts the SOAP Body element.
- *
- * Since: 2.92
*/
void
e_soap_message_start_body (ESoapMessage *msg)
{
- ESoapMessagePrivate *priv;
-
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
- if (priv->body_started)
+ if (msg->priv->body_started)
return;
- priv->last_node = xmlNewChild (priv->last_node,
- priv->soap_ns,
- (const xmlChar *)"Body", NULL);
+ msg->priv->last_node = xmlNewChild (
+ msg->priv->last_node,
+ msg->priv->soap_ns,
+ (const xmlChar *) "Body", NULL);
- priv->body_started = TRUE;
+ msg->priv->body_started = TRUE;
}
/**
@@ -517,8 +513,6 @@ e_soap_message_start_body (ESoapMessage *msg)
* @msg: the %ESoapMessage.
*
* Closes the SOAP Body element.
- *
- * Since: 2.92
*/
void
e_soap_message_end_body (ESoapMessage *msg)
@@ -546,8 +540,6 @@ e_soap_message_end_body (ESoapMessage *msg)
*
* Passing NULL for both @prefix and @ns_uri causes no prefix to be
* used, and the element will be in the default namespace.
- *
- * Since: 2.92
*/
void
e_soap_message_start_element (ESoapMessage *msg,
@@ -555,18 +547,19 @@ e_soap_message_start_element (ESoapMessage *msg,
const gchar *prefix,
const gchar *ns_uri)
{
- ESoapMessagePrivate *priv;
-
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
- priv->last_node = xmlNewChild (priv->last_node, NULL, (const xmlChar *) name, NULL);
+ msg->priv->last_node = xmlNewChild (
+ msg->priv->last_node, NULL,
+ (const xmlChar *) name, NULL);
- xmlSetNs (priv->last_node, fetch_ns (msg, prefix, ns_uri));
+ xmlSetNs (msg->priv->last_node, fetch_ns (msg, prefix, ns_uri));
- if (priv->body_started && !priv->action)
- priv->action = g_strconcat (ns_uri ? ns_uri : "",
- "#", name, NULL);
+ if (ns_uri == NULL)
+ ns_uri = "";
+
+ if (msg->priv->body_started && msg->priv->action == NULL)
+ msg->priv->action = g_strconcat (ns_uri, "#", name, NULL);
}
/**
@@ -574,18 +567,13 @@ e_soap_message_start_element (ESoapMessage *msg,
* @msg: the #ESoapMessage.
*
* Closes the current message element.
- *
- * Since: 2.92
*/
void
e_soap_message_end_element (ESoapMessage *msg)
{
- ESoapMessagePrivate *priv;
-
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
- priv->last_node = priv->last_node->parent;
+ msg->priv->last_node = msg->priv->last_node->parent;
}
/**
@@ -601,8 +589,6 @@ e_soap_message_end_element (ESoapMessage *msg)
* If you wish to add the faultdetail element, use
* e_soap_message_start_fault_detail(), and then
* e_soap_message_start_element() to add arbitrary sub-elements.
- *
- * Since: 2.92
*/
void
e_soap_message_start_fault (ESoapMessage *msg,
@@ -610,20 +596,29 @@ e_soap_message_start_fault (ESoapMessage *msg,
const gchar *faultstring,
const gchar *faultfactor)
{
- ESoapMessagePrivate *priv;
-
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
- priv->last_node = xmlNewChild (priv->last_node,
- priv->soap_ns,
- (const xmlChar *)"Fault", NULL);
- xmlNewChild (priv->last_node, priv->soap_ns, (const xmlChar *)"faultcode", (const xmlChar *)faultcode);
- xmlNewChild (priv->last_node, priv->soap_ns, (const xmlChar *)"faultstring", (const xmlChar *)faultstring);
-
- priv->last_node = xmlNewChild (priv->last_node, priv->soap_ns,
- (const xmlChar *)"faultfactor", (const xmlChar *)faultfactor);
- if (!faultfactor)
+ msg->priv->last_node = xmlNewChild (
+ msg->priv->last_node,
+ msg->priv->soap_ns,
+ (const xmlChar *) "Fault", NULL);
+ xmlNewChild (
+ msg->priv->last_node,
+ msg->priv->soap_ns,
+ (const xmlChar *) "faultcode",
+ (const xmlChar *) faultcode);
+ xmlNewChild (
+ msg->priv->last_node,
+ msg->priv->soap_ns,
+ (const xmlChar *) "faultstring",
+ (const xmlChar *) faultstring);
+
+ msg->priv->last_node = xmlNewChild (
+ msg->priv->last_node,
+ msg->priv->soap_ns,
+ (const xmlChar *) "faultfactor",
+ (const xmlChar *) faultfactor);
+ if (faultfactor == NULL)
e_soap_message_set_null (msg);
e_soap_message_end_element (msg);
@@ -634,8 +629,6 @@ e_soap_message_start_fault (ESoapMessage *msg,
* @msg: the #ESoapMessage.
*
* Closes the current SOAP Fault element.
- *
- * Since: 2.92
*/
void
e_soap_message_end_fault (ESoapMessage *msg)
@@ -650,21 +643,18 @@ e_soap_message_end_fault (ESoapMessage *msg)
* Start the faultdetail child element of the current SOAP Fault
* element. The faultdetail element allows arbitrary data to be sent
* in a returned fault.
- *
- * Since: 2.92
**/
void
e_soap_message_start_fault_detail (ESoapMessage *msg)
{
- ESoapMessagePrivate *priv;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
- priv->last_node = xmlNewChild (priv->last_node,
- priv->soap_ns,
- (const xmlChar *)"detail",
- NULL);
+ msg->priv->last_node = xmlNewChild (
+ msg->priv->last_node,
+ msg->priv->soap_ns,
+ (const xmlChar *) "detail",
+ (const xmlChar *) NULL);
}
/**
@@ -672,8 +662,6 @@ e_soap_message_start_fault_detail (ESoapMessage *msg)
* @msg: the #ESoapMessage.
*
* Closes the current SOAP faultdetail element.
- *
- * Since: 2.92
*/
void
e_soap_message_end_fault_detail (ESoapMessage *msg)
@@ -692,19 +680,17 @@ e_soap_message_end_fault_detail (ESoapMessage *msg)
*
* This should be called after e_soap_message_start_envelope() and
* before e_soap_message_start_body().
- *
- * Since: 2.92
*/
void
e_soap_message_start_header (ESoapMessage *msg)
{
- ESoapMessagePrivate *priv;
-
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
- priv->last_node = xmlNewChild (priv->last_node, priv->soap_ns,
- (const xmlChar *)"Header", NULL);
+ msg->priv->last_node = xmlNewChild (
+ msg->priv->last_node,
+ msg->priv->soap_ns,
+ (const xmlChar *) "Header",
+ (const xmlChar *) NULL);
}
/**
@@ -712,8 +698,6 @@ e_soap_message_start_header (ESoapMessage *msg)
* @msg: the #ESoapMessage.
*
* Closes the current SOAP Header element.
- *
- * Since: 2.92
*/
void
e_soap_message_end_header (ESoapMessage *msg)
@@ -732,8 +716,6 @@ e_soap_message_end_header (ESoapMessage *msg)
* @ns_uri: the namespace URI
*
* Starts a new SOAP arbitrary header element.
- *
- * Since: 2.92
*/
void
e_soap_message_start_header_element (ESoapMessage *msg,
@@ -743,16 +725,21 @@ e_soap_message_start_header_element (ESoapMessage *msg,
const gchar *prefix,
const gchar *ns_uri)
{
- ESoapMessagePrivate *priv;
-
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
e_soap_message_start_element (msg, name, prefix, ns_uri);
- if (actor_uri)
- xmlNewNsProp (priv->last_node, priv->soap_ns, (const xmlChar *)"actorUri", (const xmlChar *)actor_uri);
+ if (actor_uri != NULL)
+ xmlNewNsProp (
+ msg->priv->last_node,
+ msg->priv->soap_ns,
+ (const xmlChar *) "actorUri",
+ (const xmlChar *) actor_uri);
if (must_understand)
- xmlNewNsProp (priv->last_node, priv->soap_ns, (const xmlChar *)"mustUnderstand", (const xmlChar *)"1");
+ xmlNewNsProp (
+ msg->priv->last_node,
+ msg->priv->soap_ns,
+ (const xmlChar *) "mustUnderstand",
+ (const xmlChar *) "1");
}
/**
@@ -760,8 +747,6 @@ e_soap_message_start_header_element (ESoapMessage *msg,
* @msg: the #ESoapMessage.
*
* Closes the current SOAP header element.
- *
- * Since: 2.92
*/
void
e_soap_message_end_header_element (ESoapMessage *msg)
@@ -775,16 +760,18 @@ e_soap_message_end_header_element (ESoapMessage *msg)
* @i: the integer value to write.
*
* Writes the stringified value of @i as the current element's content.
- *
- * Since: 2.92
*/
void
e_soap_message_write_int (ESoapMessage *msg,
glong i)
{
- gchar *str = g_strdup_printf ("%ld", i);
- e_soap_message_write_string (msg, str);
- g_free (str);
+ gchar *string;
+
+ g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
+
+ string = g_strdup_printf ("%ld", i);
+ e_soap_message_write_string (msg, string);
+ g_free (string);
}
/**
@@ -793,16 +780,18 @@ e_soap_message_write_int (ESoapMessage *msg,
* @d: the double value to write.
*
* Writes the stringified value of @d as the current element's content.
- *
- * Since: 2.92
*/
void
e_soap_message_write_double (ESoapMessage *msg,
gdouble d)
{
- gchar *str = g_strdup_printf ("%f", d);
- e_soap_message_write_string (msg, str);
- g_free (str);
+ gchar *string;
+
+ g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
+
+ string = g_strdup_printf ("%f", d);
+ e_soap_message_write_string (msg, string);
+ g_free (string);
}
/**
@@ -813,17 +802,19 @@ e_soap_message_write_double (ESoapMessage *msg,
*
* Writes the Base-64 encoded value of @string as the current
* element's content.
- *
- * Since: 2.92
**/
void
e_soap_message_write_base64 (ESoapMessage *msg,
const gchar *string,
gint len)
{
- gchar *str = g_base64_encode ((const guchar *) string, len);
- e_soap_message_write_string (msg, str);
- g_free (str);
+ gchar *encoded;
+
+ g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
+
+ encoded = g_base64_encode ((const guchar *) string, len);
+ e_soap_message_write_string (msg, encoded);
+ g_free (encoded);
}
/**
@@ -833,15 +824,17 @@ e_soap_message_write_base64 (ESoapMessage *msg,
*
* Writes the stringified value of @timeval as the current element's
* content.
- *
- * Since: 2.92
**/
void
e_soap_message_write_time (ESoapMessage *msg,
const time_t *timeval)
{
- gchar *str = g_strchomp (ctime (timeval));
- e_soap_message_write_string (msg, str);
+ gchar *string;
+
+ g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
+
+ string = g_strchomp (ctime (timeval));
+ e_soap_message_write_string (msg, string);
}
/**
@@ -850,19 +843,16 @@ e_soap_message_write_time (ESoapMessage *msg,
* @string: string to write.
*
* Writes the @string as the current element's content.
- *
- * Since: 2.92
*/
void
e_soap_message_write_string (ESoapMessage *msg,
const gchar *string)
{
- ESoapMessagePrivate *priv;
-
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
- xmlNodeAddContent (priv->last_node, (const xmlChar *) string);
+ xmlNodeAddContent (
+ msg->priv->last_node,
+ (const xmlChar *) string);
}
/**
@@ -873,20 +863,17 @@ e_soap_message_write_string (ESoapMessage *msg,
*
* Writes the string buffer pointed to by @buffer as the current
* element's content.
- *
- * Since: 2.92
*/
void
e_soap_message_write_buffer (ESoapMessage *msg,
const gchar *buffer,
gint len)
{
- ESoapMessagePrivate *priv;
-
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
- xmlNodeAddContentLen (priv->last_node, (const xmlChar *) buffer, len);
+ xmlNodeAddContentLen (
+ msg->priv->last_node,
+ (const xmlChar *) buffer, len);
}
/**
@@ -896,19 +883,18 @@ e_soap_message_write_buffer (ESoapMessage *msg,
*
* Sets the current element's XML schema xsi:type attribute, which
* specifies the element's type name.
- *
- * Since: 2.92
*/
void
e_soap_message_set_element_type (ESoapMessage *msg,
const gchar *xsi_type)
{
- ESoapMessagePrivate *priv;
-
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
- xmlNewNsProp (priv->last_node, priv->xsi_ns, (const xmlChar *)"type", (const xmlChar *)xsi_type);
+ xmlNewNsProp (
+ msg->priv->last_node,
+ msg->priv->xsi_ns,
+ (const xmlChar *) "type",
+ (const xmlChar *) xsi_type);
}
/**
@@ -916,18 +902,17 @@ e_soap_message_set_element_type (ESoapMessage *msg,
* @msg: the #ESoapMessage.
*
* Sets the current element's XML Schema xsi:null attribute.
- *
- * Since: 2.92
*/
void
e_soap_message_set_null (ESoapMessage *msg)
{
- ESoapMessagePrivate *priv;
-
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
- xmlNewNsProp (priv->last_node, priv->xsi_ns, (const xmlChar *)"null", (const xmlChar *)"1");
+ xmlNewNsProp (
+ msg->priv->last_node,
+ msg->priv->xsi_ns,
+ (const xmlChar *) "null",
+ (const xmlChar *) "1");
}
/**
@@ -939,8 +924,6 @@ e_soap_message_set_null (ESoapMessage *msg)
* @ns_uri: the namespace URI
*
* Adds an XML attribute to the current element.
- *
- * Since: 2.92
*/
void
e_soap_message_add_attribute (ESoapMessage *msg,
@@ -949,14 +932,13 @@ e_soap_message_add_attribute (ESoapMessage *msg,
const gchar *prefix,
const gchar *ns_uri)
{
- ESoapMessagePrivate *priv;
-
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
- xmlNewNsProp (priv->last_node,
- fetch_ns (msg, prefix, ns_uri),
- (const xmlChar *) name, (const xmlChar *) value);
+ xmlNewNsProp (
+ msg->priv->last_node,
+ fetch_ns (msg, prefix, ns_uri),
+ (const xmlChar *) name,
+ (const xmlChar *) value);
}
/**
@@ -966,20 +948,21 @@ e_soap_message_add_attribute (ESoapMessage *msg,
* @ns_uri: the namespace URI, or NULL for empty namespace
*
* Adds a new XML namespace to the current element.
- *
- * Since: 2.92
*/
void
e_soap_message_add_namespace (ESoapMessage *msg,
const gchar *prefix,
const gchar *ns_uri)
{
- ESoapMessagePrivate *priv;
-
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
- xmlNewNs (priv->last_node, (const xmlChar *)(ns_uri ? ns_uri : ""), (const xmlChar *)prefix);
+ if (ns_uri == NULL)
+ ns_uri = "";
+
+ xmlNewNs (
+ msg->priv->last_node,
+ (const xmlChar *) ns_uri,
+ (const xmlChar *) prefix);
}
/**
@@ -990,8 +973,6 @@ e_soap_message_add_namespace (ESoapMessage *msg,
* Sets the default namespace to the URI specified in @ns_uri. The
* default namespace becomes the namespace all non-explicitly
* namespaced child elements fall into.
- *
- * Since: 2.92
*/
void
e_soap_message_set_default_namespace (ESoapMessage *msg,
@@ -1009,19 +990,18 @@ e_soap_message_set_default_namespace (ESoapMessage *msg,
*
* Sets the encodingStyle attribute on the current element to the
* value of @enc_style.
- *
- * Since: 2.92
*/
void
e_soap_message_set_encoding_style (ESoapMessage *msg,
const gchar *enc_style)
{
- ESoapMessagePrivate *priv;
-
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
- xmlNewNsProp (priv->last_node, priv->soap_ns, (const xmlChar *)"encodingStyle", (const xmlChar *)enc_style);
+ xmlNewNsProp (
+ msg->priv->last_node,
+ msg->priv->soap_ns,
+ (const xmlChar *) "encodingStyle",
+ (const xmlChar *) enc_style);
}
/**
@@ -1029,32 +1009,29 @@ e_soap_message_set_encoding_style (ESoapMessage *msg,
* @msg: the #ESoapMessage.
*
* Resets the internal XML representation of the SOAP message.
- *
- * Since: 2.92
*/
void
e_soap_message_reset (ESoapMessage *msg)
{
- ESoapMessagePrivate *priv;
-
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
- xmlFreeDoc (priv->doc);
- priv->doc = xmlNewDoc ((const xmlChar *)"1.0");
- priv->last_node = NULL;
+ xmlFreeDoc (msg->priv->doc);
+ msg->priv->doc = xmlNewDoc ((const xmlChar *) "1.0");
+ msg->priv->last_node = NULL;
- g_free (priv->action);
- priv->action = NULL;
- priv->body_started = FALSE;
+ g_free (msg->priv->action);
+ msg->priv->action = NULL;
+ msg->priv->body_started = FALSE;
- if (priv->env_uri)
- xmlFree (priv->env_uri);
- priv->env_uri = NULL;
+ if (msg->priv->env_uri != NULL) {
+ xmlFree (msg->priv->env_uri);
+ msg->priv->env_uri = NULL;
+ }
- if (priv->env_prefix)
- xmlFree (priv->env_prefix);
- priv->env_prefix = NULL;
+ if (msg->priv->env_prefix != NULL) {
+ xmlFree (msg->priv->env_prefix);
+ msg->priv->env_prefix = NULL;
+ }
}
/**
@@ -1062,24 +1039,22 @@ e_soap_message_reset (ESoapMessage *msg)
* @msg: the #ESoapMessage.
*
* Writes the serialized XML tree to the #SoupMessage's buffer.
- *
- * Since: 2.92
*/
void
e_soap_message_persist (ESoapMessage *msg)
{
- ESoapMessagePrivate *priv;
xmlChar *body;
gint len;
g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
- xmlDocDumpMemory (priv->doc, &body, &len);
+ xmlDocDumpMemory (msg->priv->doc, &body, &len);
/* serialize to SoupMessage class */
- soup_message_set_request (SOUP_MESSAGE (msg), "text/xml; charset=utf-8",
- SOUP_MEMORY_TAKE, (gchar *) body, len);
+ soup_message_set_request (
+ SOUP_MESSAGE (msg),
+ "text/xml; charset=utf-8",
+ SOUP_MEMORY_TAKE, (gchar *) body, len);
}
/**
@@ -1092,23 +1067,22 @@ e_soap_message_persist (ESoapMessage *msg)
*
* Returns: The namespace prefix, or %NULL if no namespace exists
* for the URI given.
- *
- * Since: 2.92
*/
const gchar *
e_soap_message_get_namespace_prefix (ESoapMessage *msg,
const gchar *ns_uri)
{
- ESoapMessagePrivate *priv;
xmlNsPtr ns = NULL;
g_return_val_if_fail (E_IS_SOAP_MESSAGE (msg), NULL);
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
g_return_val_if_fail (ns_uri != NULL, NULL);
- ns = xmlSearchNsByHref (priv->doc, priv->last_node, (const xmlChar *) ns_uri);
- if (ns) {
- if (ns->prefix)
+ ns = xmlSearchNsByHref (
+ msg->priv->doc,
+ msg->priv->last_node,
+ (const xmlChar *) ns_uri);
+ if (ns != NULL) {
+ if (ns->prefix != NULL)
return (const gchar *) ns->prefix;
else
return "";
@@ -1125,18 +1099,13 @@ e_soap_message_get_namespace_prefix (ESoapMessage *msg,
* #ESoapMessage pointed to by @msg.
*
* Returns: the #xmlDocPtr representing the SOAP message.
- *
- * Since: 2.92
*/
xmlDocPtr
e_soap_message_get_xml_doc (ESoapMessage *msg)
{
- ESoapMessagePrivate *priv;
-
g_return_val_if_fail (E_IS_SOAP_MESSAGE (msg), NULL);
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
- return priv->doc;
+ return msg->priv->doc;
}
/**
@@ -1147,30 +1116,25 @@ e_soap_message_get_xml_doc (ESoapMessage *msg)
*
* Returns: a #ESoapResponse representing the response from
* the server, or %NULL if there was an error.
- *
- * Since: 2.92
*/
ESoapResponse *
e_soap_message_parse_response (ESoapMessage *msg)
{
- ESoapMessagePrivate *priv;
xmlDocPtr xmldoc;
g_return_val_if_fail (E_IS_SOAP_MESSAGE (msg), NULL);
- priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
-
- if (!priv->ctxt)
+ if (msg->priv->ctxt == NULL)
return NULL;
- xmlParseChunk (priv->ctxt, 0, 0, 1);
+ xmlParseChunk (msg->priv->ctxt, 0, 0, 1);
- xmldoc = priv->ctxt->myDoc;
+ xmldoc = msg->priv->ctxt->myDoc;
- xmlFreeParserCtxt (priv->ctxt);
- priv->ctxt = NULL;
+ xmlFreeParserCtxt (msg->priv->ctxt);
+ msg->priv->ctxt = NULL;
- if (!xmldoc)
+ if (xmldoc == NULL)
return NULL;
return e_soap_response_new_from_xmldoc (xmldoc);
diff --git a/src/server/e-soap-message.h b/src/server/e-soap-message.h
index baccc22..c44b73d 100644
--- a/src/server/e-soap-message.h
+++ b/src/server/e-soap-message.h
@@ -4,104 +4,138 @@
*/
#ifndef EWS_SOAP_MESSAGE_H
-#define EWS_SOAP_MESSAGE_H 1
+#define EWS_SOAP_MESSAGE_H
#include <time.h>
#include <libxml/tree.h>
#include <libsoup/soup-message.h>
#include "e-soap-response.h"
+/* Standard GObject macros */
+#define E_TYPE_SOAP_MESSAGE \
+ (e_soap_message_get_type ())
+#define E_SOAP_MESSAGE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), E_TYPE_SOAP_MESSAGE, ESoapMessage))
+#define E_SOAP_MESSAGE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), E_TYPE_SOAP_MESSAGE, ESoapMessageClass))
+#define E_IS_SOAP_MESSAGE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), E_TYPE_SOAP_MESSAGE))
+#define E_IS_SOAP_MESSAGE_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), E_TYPE_SOAP_MESSAGE))
+#define E_SOAP_MESSAGE_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), E_TYPE_SOAP_MESSAGE, ESoapMessageClass))
+
G_BEGIN_DECLS
-#define E_TYPE_SOAP_MESSAGE (e_soap_message_get_type ())
-#define E_SOAP_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_SOAP_MESSAGE, ESoapMessage))
-#define E_SOAP_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_SOAP_MESSAGE, ESoapMessageClass))
-#define E_IS_SOAP_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_SOAP_MESSAGE))
-#define E_IS_SOAP_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_SOAP_MESSAGE))
-#define E_SOAP_MESSAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), E_TYPE_SOAP_MESSAGE, ESoapMessageClass))
+typedef struct _ESoapMessage ESoapMessage;
+typedef struct _ESoapMessageClass ESoapMessageClass;
+typedef struct _ESoapMessagePrivate ESoapMessagePrivate;
-typedef struct {
+struct _ESoapMessage {
SoupMessage parent;
+ ESoapMessagePrivate *priv;
+};
-} ESoapMessage;
-
-typedef struct {
+struct _ESoapMessageClass {
SoupMessageClass parent_class;
-} ESoapMessageClass;
-
-GType e_soap_message_get_type (void);
-
-ESoapMessage *e_soap_message_new (const gchar *method, const gchar *uri_string,
- gboolean standalone, const gchar *xml_encoding,
- const gchar *env_prefix, const gchar *env_uri);
-ESoapMessage *e_soap_message_new_from_uri (const gchar *method, SoupURI *uri,
- gboolean standalone, const gchar *xml_encoding,
- const gchar *env_prefix, const gchar *env_uri);
-
-void e_soap_message_start_envelope (ESoapMessage *msg);
-void e_soap_message_end_envelope (ESoapMessage *msg);
-void e_soap_message_start_body (ESoapMessage *msg);
-void e_soap_message_end_body (ESoapMessage *msg);
-void e_soap_message_start_element (ESoapMessage *msg,
- const gchar *name,
- const gchar *prefix,
- const gchar *ns_uri);
-void e_soap_message_end_element (ESoapMessage *msg);
-void e_soap_message_start_fault (ESoapMessage *msg,
+};
+
+GType e_soap_message_get_type (void) G_GNUC_CONST;
+ESoapMessage * e_soap_message_new (const gchar *method,
+ const gchar *uri_string,
+ gboolean standalone,
+ const gchar *xml_encoding,
+ const gchar *env_prefix,
+ const gchar *env_uri);
+ESoapMessage * e_soap_message_new_from_uri (const gchar *method,
+ SoupURI *uri,
+ gboolean standalone,
+ const gchar *xml_encoding,
+ const gchar *env_prefix,
+ const gchar *env_uri);
+void e_soap_message_start_envelope (ESoapMessage *msg);
+void e_soap_message_end_envelope (ESoapMessage *msg);
+void e_soap_message_start_body (ESoapMessage *msg);
+void e_soap_message_end_body (ESoapMessage *msg);
+void e_soap_message_start_element (ESoapMessage *msg,
+ const gchar *name,
+ const gchar *prefix,
+ const gchar *ns_uri);
+void e_soap_message_end_element (ESoapMessage *msg);
+void e_soap_message_start_fault (ESoapMessage *msg,
const gchar *faultcode,
const gchar *faultstring,
const gchar *faultfactor);
-void e_soap_message_end_fault (ESoapMessage *msg);
-void e_soap_message_start_fault_detail (ESoapMessage *msg);
-void e_soap_message_end_fault_detail (ESoapMessage *msg);
-void e_soap_message_start_header (ESoapMessage *msg);
-void e_soap_message_end_header (ESoapMessage *msg);
-void e_soap_message_start_header_element (ESoapMessage *msg,
- const gchar *name,
- gboolean must_understand,
- const gchar *actor_uri,
- const gchar *prefix,
- const gchar *ns_uri);
-void e_soap_message_end_header_element (ESoapMessage *msg);
-void e_soap_message_write_int (ESoapMessage *msg, glong i);
-void e_soap_message_write_double (ESoapMessage *msg, gdouble d);
-void e_soap_message_write_base64 (ESoapMessage *msg, const gchar *string, gint len);
-void e_soap_message_write_time (ESoapMessage *msg, const time_t *timeval);
-void e_soap_message_write_string (ESoapMessage *msg, const gchar *string);
-void e_soap_message_write_buffer (ESoapMessage *msg, const gchar *buffer, gint len);
-void e_soap_message_set_element_type (ESoapMessage *msg, const gchar *xsi_type);
-void e_soap_message_set_null (ESoapMessage *msg);
-void e_soap_message_add_attribute (ESoapMessage *msg,
- const gchar *name,
- const gchar *value,
- const gchar *prefix,
- const gchar *ns_uri);
-void e_soap_message_add_namespace (ESoapMessage *msg,
- const gchar *prefix,
- const gchar *ns_uri);
-void e_soap_message_set_default_namespace (ESoapMessage *msg,
- const gchar *ns_uri);
-void e_soap_message_set_encoding_style (ESoapMessage *msg, const gchar *enc_style);
-void e_soap_message_reset (ESoapMessage *msg);
-void e_soap_message_persist (ESoapMessage *msg);
-
-const gchar *e_soap_message_get_namespace_prefix (ESoapMessage *msg, const gchar *ns_uri);
-
-xmlDocPtr e_soap_message_get_xml_doc (ESoapMessage *msg);
-
-void e_soap_message_store_node_data (ESoapMessage *msg,
- const gchar *nodename,
- const gchar *directory,
- gboolean base64);
-
-ESoapResponse *e_soap_message_parse_response (ESoapMessage *msg);
+void e_soap_message_end_fault (ESoapMessage *msg);
+void e_soap_message_start_fault_detail
+ (ESoapMessage *msg);
+void e_soap_message_end_fault_detail (ESoapMessage *msg);
+void e_soap_message_start_header (ESoapMessage *msg);
+void e_soap_message_end_header (ESoapMessage *msg);
+void e_soap_message_start_header_element
+ (ESoapMessage *msg,
+ const gchar *name,
+ gboolean must_understand,
+ const gchar *actor_uri,
+ const gchar *prefix,
+ const gchar *ns_uri);
+void e_soap_message_end_header_element
+ (ESoapMessage *msg);
+void e_soap_message_write_int (ESoapMessage *msg,
+ glong i);
+void e_soap_message_write_double (ESoapMessage *msg,
+ gdouble d);
+void e_soap_message_write_base64 (ESoapMessage *msg,
+ const gchar *string,
+ gint len);
+void e_soap_message_write_time (ESoapMessage *msg,
+ const time_t *timeval);
+void e_soap_message_write_string (ESoapMessage *msg,
+ const gchar *string);
+void e_soap_message_write_buffer (ESoapMessage *msg,
+ const gchar *buffer,
+ gint len);
+void e_soap_message_set_element_type (ESoapMessage *msg,
+ const gchar *xsi_type);
+void e_soap_message_set_null (ESoapMessage *msg);
+void e_soap_message_add_attribute (ESoapMessage *msg,
+ const gchar *name,
+ const gchar *value,
+ const gchar *prefix,
+ const gchar *ns_uri);
+void e_soap_message_add_namespace (ESoapMessage *msg,
+ const gchar *prefix,
+ const gchar *ns_uri);
+void e_soap_message_set_default_namespace
+ (ESoapMessage *msg,
+ const gchar *ns_uri);
+void e_soap_message_set_encoding_style
+ (ESoapMessage *msg,
+ const gchar *enc_style);
+void e_soap_message_reset (ESoapMessage *msg);
+void e_soap_message_persist (ESoapMessage *msg);
+const gchar * e_soap_message_get_namespace_prefix
+ (ESoapMessage *msg,
+ const gchar *ns_uri);
+xmlDocPtr e_soap_message_get_xml_doc (ESoapMessage *msg);
+void e_soap_message_store_node_data (ESoapMessage *msg,
+ const gchar *nodename,
+ const gchar *directory,
+ gboolean base64);
+ESoapResponse * e_soap_message_parse_response (ESoapMessage *msg);
/* By an amazing coincidence, this looks a lot like camel_progress() */
typedef void (*ESoapProgressFn) (gpointer object, gint percent);
-void e_soap_message_set_progress_fn (ESoapMessage *msg,
- ESoapProgressFn fn,
- gpointer object);
+void e_soap_message_set_progress_fn (ESoapMessage *msg,
+ ESoapProgressFn fn,
+ gpointer object);
+
G_END_DECLS
-#endif
+#endif /* E_SOAP_MESSAGE_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]