soup-serializer

Name

soup-serializer -- 

Synopsis



struct      SoupSerializer;
SoupSerializer* soup_serializer_new         (void);
SoupSerializer* soup_serializer_new_full    (gboolean standalone,
                                             const gchar *xml_encoding,
                                             const gchar *env_prefix,
                                             const gchar *env_uri);
xmlDocPtr   soup_serializer_get_xml_doc     (SoupSerializer *ser);
void        soup_serializer_free            (SoupSerializer *ser);
void        soup_serializer_start_envelope  (SoupSerializer *ser);
void        soup_serializer_end_envelope    (SoupSerializer *ser);
void        soup_serializer_start_body      (SoupSerializer *ser);
void        soup_serializer_end_body        (SoupSerializer *ser);
void        soup_serializer_start_element   (SoupSerializer *ser,
                                             const gchar *name,
                                             const gchar *prefix,
                                             const gchar *ns_uri);
void        soup_serializer_end_element     (SoupSerializer *ser);
void        soup_serializer_start_fault     (SoupSerializer *ser,
                                             const gchar *faultcode,
                                             const gchar *faultstring,
                                             const gchar *faultactor);
void        soup_serializer_end_fault       (SoupSerializer *ser);
void        soup_serializer_start_fault_detail
                                            (SoupSerializer *ser);
void        soup_serializer_end_fault_detail
                                            (SoupSerializer *ser);
void        soup_serializer_start_header    (SoupSerializer *ser);
void        soup_serializer_end_header      (SoupSerializer *ser);
void        soup_serializer_start_header_element
                                            (SoupSerializer *ser,
                                             const gchar *name,
                                             gboolean must_understand,
                                             const gchar *actor_uri,
                                             const gchar *prefix,
                                             const gchar *ns_uri);
void        soup_serializer_end_header_element
                                            (SoupSerializer *ser);
void        soup_serializer_write_int       (SoupSerializer *ser,
                                             glong i);
void        soup_serializer_write_double    (SoupSerializer *ser,
                                             gdouble d);
void        soup_serializer_write_base64    (SoupSerializer *ser,
                                             const gchar *string,
                                             guint len);
void        soup_serializer_write_time      (SoupSerializer *ser,
                                             const time_t *timeval);
void        soup_serializer_write_string    (SoupSerializer *ser,
                                             const gchar *string);
void        soup_serializer_write_buffer    (SoupSerializer *ser,
                                             const gchar *buffer,
                                             guint length);
void        soup_serializer_set_type        (SoupSerializer *ser,
                                             const gchar *xsi_type);
void        soup_serializer_set_null        (SoupSerializer *ser);
void        soup_serializer_add_attribute   (SoupSerializer *ser,
                                             const gchar *name,
                                             const gchar *value,
                                             const gchar *prefix,
                                             const gchar *ns_uri);
void        soup_serializer_add_namespace   (SoupSerializer *ser,
                                             const gchar *prefix,
                                             const gchar *ns_uri);
void        soup_serializer_set_default_namespace
                                            (SoupSerializer *ser,
                                             const gchar *ns_uri);
void        soup_serializer_set_encoding_style
                                            (SoupSerializer *ser,
                                             const gchar *enc_style);
void        soup_serializer_reset           (SoupSerializer *ser);
void        soup_serializer_persist         (SoupSerializer *ser,
                                             SoupDataBuffer *dest);

Description

Details

struct SoupSerializer

struct SoupSerializer;


soup_serializer_new ()

SoupSerializer* soup_serializer_new         (void);

Creates a new SoupSerializer.


soup_serializer_new_full ()

SoupSerializer* soup_serializer_new_full    (gboolean standalone,
                                             const gchar *xml_encoding,
                                             const gchar *env_prefix,
                                             const gchar *env_uri);

Creates a new SoupSerializer, using xml_encoding as the encoding attribute for the document, env_prefix as the default XML Namespace prefix for all SOAP elements, and env_uri as the XML Namespace uri for SOAP elements.


soup_serializer_get_xml_doc ()

xmlDocPtr   soup_serializer_get_xml_doc     (SoupSerializer *ser);

Returns the internal xml representation tree of the SoupSerializer pointed to by ser.


soup_serializer_free ()

void        soup_serializer_free            (SoupSerializer *ser);

Frees the SoupSerializer pointed to by ser, and the internal XML represetation of the SOAP message.


soup_serializer_start_envelope ()

void        soup_serializer_start_envelope  (SoupSerializer *ser);

Starts the top level SOAP Envelope element.


soup_serializer_end_envelope ()

void        soup_serializer_end_envelope    (SoupSerializer *ser);

Closes the top level SOAP Envelope element.


soup_serializer_start_body ()

void        soup_serializer_start_body      (SoupSerializer *ser);

Starts the SOAP Body element.


soup_serializer_end_body ()

void        soup_serializer_end_body        (SoupSerializer *ser);

Closes the SOAP Body element.


soup_serializer_start_element ()

void        soup_serializer_start_element   (SoupSerializer *ser,
                                             const gchar *name,
                                             const gchar *prefix,
                                             const gchar *ns_uri);

Starts a new arbitrary message element, with name as the element name, prefix as the XML Namespace prefix, and ns_uri as the XML Namespace uri for the created element.

Passing prefix with no ns_uri will cause a recursive search for an existing namespace with the same prefix. Failing that a new ns will be created with an empty uri.

Passing both prefix and ns_uri always causes new namespace attribute creation.

Passing NULL for both prefix and ns_uri causes no prefix to be used, and the element will be in the default namespace.


soup_serializer_end_element ()

void        soup_serializer_end_element     (SoupSerializer *ser);

Close the current message element.


soup_serializer_start_fault ()

void        soup_serializer_start_fault     (SoupSerializer *ser,
                                             const gchar *faultcode,
                                             const gchar *faultstring,
                                             const gchar *faultactor);

Starts a new SOAP Fault element, creating faultcode, faultstring, and faultactor child elements.

If you wish to add the faultdetail element, use soup_serializer_start_fault_detail, and then soup_serializer_start_element to add arbitrary sub-elements.


soup_serializer_end_fault ()

void        soup_serializer_end_fault       (SoupSerializer *ser);

Close the current SOAP Fault element.


soup_serializer_start_fault_detail ()

void        soup_serializer_start_fault_detail
                                            (SoupSerializer *ser);

Start the faultdetail child element of the current SOAP Fault element. The faultdetail element allows arbitrary data to be sent in a returned fault.


soup_serializer_end_fault_detail ()

void        soup_serializer_end_fault_detail
                                            (SoupSerializer *ser);

Closes the current SOAP faultdetail element.


soup_serializer_start_header ()

void        soup_serializer_start_header    (SoupSerializer *ser);

Creates a new SOAP Header element. You can call soup_serializer_start_header_element after this to add a new header child element. SOAP Header elements allow out-of-band data to be transferred while not interfering with the message body.

This should be called after soup_serializer_start_envelope and before soup_serializer_start_body.


soup_serializer_end_header ()

void        soup_serializer_end_header      (SoupSerializer *ser);

Close the current SOAP Header element.


soup_serializer_start_header_element ()

void        soup_serializer_start_header_element
                                            (SoupSerializer *ser,
                                             const gchar *name,
                                             gboolean must_understand,
                                             const gchar *actor_uri,
                                             const gchar *prefix,
                                             const gchar *ns_uri);

Starts a new SOAP arbitrary header element.


soup_serializer_end_header_element ()

void        soup_serializer_end_header_element
                                            (SoupSerializer *ser);

Closes the current SOAP header element


soup_serializer_write_int ()

void        soup_serializer_write_int       (SoupSerializer *ser,
                                             glong i);

Writes the stringified value of i as the current element's content.


soup_serializer_write_double ()

void        soup_serializer_write_double    (SoupSerializer *ser,
                                             gdouble d);

Writes the stringified value of i as the current element's content.


soup_serializer_write_base64 ()

void        soup_serializer_write_base64    (SoupSerializer *ser,
                                             const gchar *string,
                                             guint len);

Writes the Base-64 encoded value of string as the current element's content.


soup_serializer_write_time ()

void        soup_serializer_write_time      (SoupSerializer *ser,
                                             const time_t *timeval);

Writes the stringified value of timeval as the current element's content.


soup_serializer_write_string ()

void        soup_serializer_write_string    (SoupSerializer *ser,
                                             const gchar *string);

Writes the string as the current element's content.


soup_serializer_write_buffer ()

void        soup_serializer_write_buffer    (SoupSerializer *ser,
                                             const gchar *buffer,
                                             guint length);

Writes the string buffer pointed to by buffer and the current element's content.


soup_serializer_set_type ()

void        soup_serializer_set_type        (SoupSerializer *ser,
                                             const gchar *xsi_type);

Sets the current element's XML Schema xsi:type attribute, which specifies the element's type name.


soup_serializer_set_null ()

void        soup_serializer_set_null        (SoupSerializer *ser);

Sets the current element's XML Schema xsi:null attribute.


soup_serializer_add_attribute ()

void        soup_serializer_add_attribute   (SoupSerializer *ser,
                                             const gchar *name,
                                             const gchar *value,
                                             const gchar *prefix,
                                             const gchar *ns_uri);

Adds an XML attribute to the current element.


soup_serializer_add_namespace ()

void        soup_serializer_add_namespace   (SoupSerializer *ser,
                                             const gchar *prefix,
                                             const gchar *ns_uri);

Adds a new XML namespace to the current element.


soup_serializer_set_default_namespace ()

void        soup_serializer_set_default_namespace
                                            (SoupSerializer *ser,
                                             const gchar *ns_uri);

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.


soup_serializer_set_encoding_style ()

void        soup_serializer_set_encoding_style
                                            (SoupSerializer *ser,
                                             const gchar *enc_style);

Sets the encodingStyle attribute on the current element to the value of enc_style.


soup_serializer_reset ()

void        soup_serializer_reset           (SoupSerializer *ser);

Reset the internal XML representation of the SOAP message.


soup_serializer_persist ()

void        soup_serializer_persist         (SoupSerializer *ser,
                                             SoupDataBuffer *dest);

Writes the serialized XML tree to the SoupDataBuffer pointed to by dest.