Beispiel #1
0
void  cg_xml_node_print(CgXmlNode *node)
{
	CgString *str = cg_string_new();
	cg_xml_node_tostring(node, TRUE, str);
	printf("%s", cg_string_getvalue(str));
	cg_string_delete(str);
}
void cg_soap_request_setcontent(CgSoapRequest *soapReq, CgXmlNode *node)
{
    CgHttpRequest *httpReq;

    cg_log_debug_l4("Entering...\n");

    httpReq = cg_soap_request_gethttprequest(soapReq);

    /**** content type ****/
    cg_http_request_setcontenttype(httpReq, CG_XML_CONTENT_TYPE);

    /**** content ****/
    cg_http_request_appendncontent(httpReq, CG_SOAP_VERSION_HEADER,
                    cg_strlen(CG_SOAP_VERSION_HEADER));
    cg_http_request_appendncontent(httpReq, CG_XML_CONTENT_LF,
                    cg_strlen(CG_XML_CONTENT_LF));
    cg_xml_node_tostring(node, TRUE, httpReq->content);

    /**** content length ****/
    cg_http_request_setcontentlength(httpReq,
                     cg_string_length(httpReq->content));

    cg_log_debug_l4("Leaving...\n");
}