summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorGravatar m0gg2006-11-26 20:13:05 +0000
committerGravatar m0gg2006-11-26 20:13:05 +0000
commit65985c4e6527c82a75367d9c5418b009dfbc6379 (patch)
tree2050e9f4ccd9f460c3f3dbb27446baaa0fbbd9ae /examples
parentc8705844bd924e8e00bc79ec0f4ae92c85f7e48e (diff)
downloadcsoap-65985c4e6527c82a75367d9c5418b009dfbc6379.tar.gz
csoap-65985c4e6527c82a75367d9c5418b009dfbc6379.tar.bz2
soap.udp transport added (alpha)
Diffstat (limited to 'examples')
-rw-r--r--examples/csoap/simpleclient.c8
-rw-r--r--examples/csoap/simpleserver.c28
-rw-r--r--examples/csoap/soapclient.c3
3 files changed, 26 insertions, 13 deletions
diff --git a/examples/csoap/simpleclient.c b/examples/csoap/simpleclient.c
index 1af42f5..10924d2 100644
--- a/examples/csoap/simpleclient.c
+++ b/examples/csoap/simpleclient.c
@@ -1,5 +1,5 @@
/******************************************************************
- * $Id: simpleclient.c,v 1.17 2006/11/25 17:03:20 m0gg Exp $
+ * $Id: simpleclient.c,v 1.18 2006/11/26 20:13:05 m0gg Exp $
*
* CSOAP Project: CSOAP examples project
* Copyright (C) 2003-2004 Ferhat Ayaz
@@ -47,7 +47,7 @@ main(int argc, char **argv)
err = soap_client_init_args(argc, argv);
if (err != H_OK)
{
- printf("%s():%s [%d]", herror_func(err), herror_message(err), herror_code(err));
+ printf("%s():%s [%d]\n", herror_func(err), herror_message(err), herror_code(err));
herror_release(err);
exit(1);
}
@@ -55,7 +55,7 @@ main(int argc, char **argv)
err = soap_ctx_new_with_method(urn, method, &ctx);
if (err != H_OK)
{
- printf("%s():%s [%d]", herror_func(err), herror_message(err), herror_code(err));
+ printf("%s():%s [%d]\n", herror_func(err), herror_message(err), herror_code(err));
herror_release(err);
exit(1);
}
@@ -71,7 +71,7 @@ main(int argc, char **argv)
if ((err = soap_client_invoke(ctx, &ctx2, url, "")) != H_OK)
{
- printf("[%d] %s(): %s ", herror_code(err), herror_func(err), herror_message(err));
+ printf("[%d] %s(): %s\n", herror_code(err), herror_func(err), herror_message(err));
herror_release(err);
soap_ctx_free(ctx);
exit(1);
diff --git a/examples/csoap/simpleserver.c b/examples/csoap/simpleserver.c
index 03c3c5d..5803a33 100644
--- a/examples/csoap/simpleserver.c
+++ b/examples/csoap/simpleserver.c
@@ -1,5 +1,5 @@
/******************************************************************
- * $Id: simpleserver.c,v 1.25 2006/11/25 17:03:20 m0gg Exp $
+ * $Id: simpleserver.c,v 1.26 2006/11/26 20:13:05 m0gg Exp $
*
* CSOAP Project: CSOAP examples project
* Copyright (C) 2003-2004 Ferhat Ayaz
@@ -45,28 +45,40 @@ say_hello(struct SoapCtx *req, struct SoapCtx *res)
{
herror_t err;
char *name;
+ xmlNodePtr method, node;
- printf("service request");
+ printf("processing service request\n");
- xmlNodePtr method, node;
+ xmlDocFormatDump(stdout, req->env->root->doc, 1);
err = soap_env_new_with_response(req->env, &res->env);
if (err != H_OK)
{
+ printf("soap_env_new_with_response failed (%s)\n", herror_message(err));
return err;
}
+ printf("empty response created\n");
- method = soap_env_get_method(req->env);
- node = soap_xml_get_children(method);
+ if (!(method = soap_env_get_method(req->env)))
+ {
+ printf("soap_env_get_method failed\n");
+ return herror_new("say_hello", 0, "There may be a bug in the library...");
+ }
+ printf("method found\n");
+ printf("adding response content...\n");
+ node = soap_xml_get_children(method);
while (node)
{
name = (char *) xmlNodeListGetString(node->doc, node->xmlChildrenNode, 1);
soap_env_add_itemf(res->env, "xsd:string", "echo", "Hello '%s'", name);
node = soap_xml_get_next(node);
- xmlFree(name);
+ if (name)
+ xmlFree(name);
}
+ printf("service request done\n");
+
return H_OK;
}
@@ -102,7 +114,7 @@ main(int argc, char **argv)
if ((err = soap_server_register_router(router, url)))
{
- printf("%s(): %s [%s]\n", herror_func(err), herror_message(err), herror_code(err));
+ printf("%s(): %s [%d]\n", herror_func(err), herror_message(err), herror_code(err));
herror_release(err);
exit(1);
}
@@ -111,7 +123,7 @@ main(int argc, char **argv)
printf("press ctrl-c to shutdown\n");
if ((err = soap_server_run()) != H_OK)
{
- printf("%s(): %s [%s]\n", herror_func(err), herror_message(err), herror_code(err));
+ printf("%s(): %s [%d]\n", herror_func(err), herror_message(err), herror_code(err));
herror_release(err);
exit(1);
}
diff --git a/examples/csoap/soapclient.c b/examples/csoap/soapclient.c
index e39802a..5b98e91 100644
--- a/examples/csoap/soapclient.c
+++ b/examples/csoap/soapclient.c
@@ -1,5 +1,5 @@
/******************************************************************
- * $Id: soapclient.c,v 1.11 2006/11/25 17:03:20 m0gg Exp $
+ * $Id: soapclient.c,v 1.12 2006/11/26 20:13:05 m0gg Exp $
*
* CSOAP Project: CSOAP examples project
* Copyright (C) 2003-2006 Adrianus Warmehoven
@@ -22,6 +22,7 @@
******************************************************************/
#include <stdio.h>
#include <string.h>
+#include <ctype.h>
#include <libxml/tree.h>