summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorGravatar snowdrop2004-11-01 15:16:22 +0000
committerGravatar snowdrop2004-11-01 15:16:22 +0000
commitc28397f760d22a1e8be126725ff7784b2d8fec23 (patch)
treed1d09522031049fda25d5d98deb9a6aa6b7bcfc7 /examples
parent581c961c5b8e511a89addca064f372103d2400ee (diff)
downloadcsoap-c28397f760d22a1e8be126725ff7784b2d8fec23.tar.gz
csoap-c28397f760d22a1e8be126725ff7784b2d8fec23.tar.bz2
added soap_ctx_add_file()
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/csoap/echoattachments-client.c7
-rwxr-xr-xexamples/csoap/echoattachments-server.c32
-rw-r--r--examples/csoap/simpleclient.c4
3 files changed, 8 insertions, 35 deletions
diff --git a/examples/csoap/echoattachments-client.c b/examples/csoap/echoattachments-client.c
index 0f62fa7..a6dfca7 100755
--- a/examples/csoap/echoattachments-client.c
+++ b/examples/csoap/echoattachments-client.c
@@ -1,5 +1,5 @@
/******************************************************************
- * $Id: echoattachments-client.c,v 1.5 2004/10/29 09:27:02 snowdrop Exp $
+ * $Id: echoattachments-client.c,v 1.6 2004/11/01 15:16:22 snowdrop Exp $
*
* CSOAP Project: CSOAP examples project
* Copyright (C) 2003-2004 Ferhat Ayaz
@@ -96,6 +96,8 @@ int main(int argc, char *argv[])
char href[MAX_HREF_SIZE];
xmlNodePtr fault;
herror_t err;
+
+
if (argc < 2) {
fprintf(stderr, "usage: %s <filename> [url]\n", argv[0]);
@@ -110,7 +112,7 @@ int main(int argc, char *argv[])
return 1;
}
- err = soap_client_ctx_new(urn, method, &ctx);
+ 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));
herror_release(err);
@@ -121,6 +123,7 @@ int main(int argc, char *argv[])
soap_ctx_free(ctx);
exit(1);
}
+
soap_env_add_attachment(ctx->env,"source", href);
printf("sending request ...\n");
diff --git a/examples/csoap/echoattachments-server.c b/examples/csoap/echoattachments-server.c
index 5aeeb76..22b5fb2 100755
--- a/examples/csoap/echoattachments-server.c
+++ b/examples/csoap/echoattachments-server.c
@@ -1,5 +1,5 @@
/******************************************************************
- * $Id: echoattachments-server.c,v 1.3 2004/10/28 10:30:42 snowdrop Exp $
+ * $Id: echoattachments-server.c,v 1.4 2004/11/01 15:16:22 snowdrop Exp $
*
* CSOAP Project: CSOAP examples project
* Copyright (C) 2003-2004 Ferhat Ayaz
@@ -29,37 +29,7 @@ static const char *urn = "urn:examples";
static const char *method = "echo";
-/*
-SoapCtx* echo_attachments(SoapCtx *req)
-{
- herror_t err;
- SoapEnv *env;
- SoapCtx* ctx;
- part_t *part;
- char href[MAX_HREF_SIZE];
-
- err = soap_env_new_with_response(req->env, &env);
- if (err != H_OK) {
- herror_release(err);
- return NULL;
- }
-
- ctx = soap_ctx_new(env);
-
- if (req->attachments) {
- part = req->attachments->parts;
- while (part) {
- log_verbose2("Adding part '%s'", part->filename);
- soap_ctx_add_file(ctx, part->filename, "text/plain", href);
- soap_env_add_attachment(ctx->env, "echoFile", href);
- part = part->next;
- }
- }
-
- return ctx;
-}
-*/
herror_t echo_attachments(SoapCtx *req, SoapCtx* res)
{
diff --git a/examples/csoap/simpleclient.c b/examples/csoap/simpleclient.c
index 7b80193..ea9dcac 100644
--- a/examples/csoap/simpleclient.c
+++ b/examples/csoap/simpleclient.c
@@ -1,5 +1,5 @@
/******************************************************************
- * $Id: simpleclient.c,v 1.6 2004/10/28 10:30:42 snowdrop Exp $
+ * $Id: simpleclient.c,v 1.7 2004/11/01 15:16:22 snowdrop Exp $
*
* CSOAP Project: CSOAP examples project
* Copyright (C) 2003-2004 Ferhat Ayaz
@@ -42,7 +42,7 @@ int main(int argc, char *argv[])
return 1;
}
- err = soap_client_ctx_new(urn, method, &ctx);
+ err = soap_ctx_new_with_method(urn, method, &ctx);
if (err != H_OK) {
log_error4("%s():%s [%d]", herror_func(err), herror_message(err), herror_code(err));
herror_release(err);