From 6457c46897d6e0c63476bf4ba4ca14b4844fac0d Mon Sep 17 00:00:00 2001 From: m0gg Date: Thu, 23 Nov 2006 15:27:32 +0000 Subject: Code cleanup --- examples/csoap/echoattachments-client.c | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) (limited to 'examples/csoap/echoattachments-client.c') diff --git a/examples/csoap/echoattachments-client.c b/examples/csoap/echoattachments-client.c index b128563..26c65ff 100755 --- a/examples/csoap/echoattachments-client.c +++ b/examples/csoap/echoattachments-client.c @@ -1,5 +1,5 @@ /****************************************************************** - * $Id: echoattachments-client.c,v 1.13 2006/11/21 20:58:59 m0gg Exp $ + * $Id: echoattachments-client.c,v 1.14 2006/11/23 15:27:33 m0gg Exp $ * * CSOAP Project: CSOAP examples project * Copyright (C) 2003-2004 Ferhat Ayaz @@ -20,30 +20,22 @@ * * Email: ferhatayaz@yahoo.com ******************************************************************/ -#include #include -#include +#include #include #include -#include -#include -#include -#include -#include #include #include #include #include - static const char *urn = "urn:examples"; static const char *url = "http://localhost:10000/echoattachments"; static const char *method = "echo"; - void compareFiles(const char *received, const char *sent) { @@ -116,14 +108,13 @@ compareFiles(const char *received, const char *sent) } int -main(int argc, char *argv[]) +main(int argc, char **argv) { - SoapCtx *ctx, *ctx2; + struct SoapCtx *ctx, *ctx2; char href[MAX_HREF_SIZE]; xmlNodePtr fault; herror_t err; - if (argc < 2) { fprintf(stderr, "usage: %s [url]\n", argv[0]); @@ -135,8 +126,7 @@ main(int argc, char *argv[]) err = soap_client_init_args(argc, argv); if (err != H_OK) { - log_error4("[%d] %s():%s ", herror_code(err), herror_func(err), - herror_message(err)); + printf("[%d] %s():%s ", herror_code(err), herror_func(err), herror_message(err)); herror_release(err); return 1; } @@ -146,8 +136,7 @@ main(int argc, char *argv[]) err = soap_ctx_new_with_method(urn, method, &ctx); if (err != H_OK) { - log_error4("[%d] %s():%s ", herror_code(err), herror_func(err), - herror_message(err)); + printf("[%d] %s():%s ", herror_code(err), herror_func(err), herror_message(err)); herror_release(err); return 1; } @@ -157,8 +146,7 @@ main(int argc, char *argv[]) err = soap_ctx_add_file(ctx, argv[1], "application/octet-stream", href); if (err != H_OK) { - log_error4("%s():%s [%d]", herror_func(err), herror_message(err), - herror_code(err)); + printf("%s():%s [%d]", herror_func(err), herror_message(err), herror_code(err)); herror_release(err); return 1; } @@ -177,8 +165,7 @@ main(int argc, char *argv[]) if (err != H_OK) { - log_error4("%s():%s [%d]", herror_func(err), herror_message(err), - herror_code(err)); + printf("%s():%s [%d]", herror_func(err), herror_message(err), herror_code(err)); herror_release(err); return 1; } @@ -188,7 +175,7 @@ main(int argc, char *argv[]) fault = soap_env_get_fault(ctx2->env); if (fault) { - soap_xml_doc_print(ctx2->env->root->doc); + xmlDocDump(stdout, ctx2->env->root->doc); } else if (ctx2->attachments) { @@ -197,7 +184,7 @@ main(int argc, char *argv[]) else { printf("No attachments!"); - soap_xml_doc_print(ctx2->env->root->doc); + xmlDocDump(stdout, ctx2->env->root->doc); } /* -- cgit v1.1-32-gdbae