diff options
author | m0gg | 2006-12-02 21:50:47 +0000 |
---|---|---|
committer | m0gg | 2006-12-02 21:50:47 +0000 |
commit | 088da5ce241680069c8881de30f29bed5639a065 (patch) | |
tree | 1246e45688d6667af859fafe0f7147de6c396dcc /libcsoap | |
parent | 1e0e97fe7b654ecd7f5315d129df6e57f3e63371 (diff) | |
download | csoap-088da5ce241680069c8881de30f29bed5639a065.tar.gz csoap-088da5ce241680069c8881de30f29bed5639a065.tar.bz2 |
Added XML preamble
Diffstat (limited to 'libcsoap')
-rw-r--r-- | libcsoap/soap-nhttp.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/libcsoap/soap-nhttp.c b/libcsoap/soap-nhttp.c index fe5539d..8574f67 100644 --- a/libcsoap/soap-nhttp.c +++ b/libcsoap/soap-nhttp.c @@ -1,5 +1,5 @@ /****************************************************************** -* $Id: soap-nhttp.c,v 1.6 2006/11/28 23:45:57 m0gg Exp $ +* $Id: soap-nhttp.c,v 1.7 2006/12/02 21:50:47 m0gg Exp $ * * CSOAP Project: A SOAP client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -68,11 +68,12 @@ _soap_nhttp_send_document(httpd_conn_t *conn, xmlDocPtr doc) { char length[16]; xmlBufferPtr buf; + int size; buf = xmlBufferCreate(); - xmlNodeDump(buf, doc, xmlDocGetRootElement(doc), 1, 1); + xmlDocDumpMemory(doc, buf, &size); - sprintf(length, "%d", xmlBufferLength(buf)); + sprintf(length, "%d", size); httpd_set_header(conn, HEADER_CONTENT_TYPE, "text/xml"); httpd_set_header(conn, HEADER_CONTENT_LENGTH, length); httpd_send_header(conn, 200, HTTP_STATUS_200_REASON_PHRASE); @@ -159,15 +160,15 @@ soap_nhttp_process(httpd_conn_t * conn, struct hrequest_t * req) { httpd_send_header(conn, 200, HTTP_STATUS_200_REASON_PHRASE); http_output_stream_write_string(conn->out, - "<html>" - "<head>" - "</head>" - "<body>" - "<h1>Sorry!</h1>" - "<hr />" - "<div>I only speak with 'POST' method.</div>" - "</body>" - "</html>"); + "<html>" + "<head>" + "</head>" + "<body>" + "<h1>Sorry!</h1>" + "<hr />" + "<div>I only speak with 'POST' method.</div>" + "</body>" + "</html>"); return; } |