diff options
author | rans | 2004-09-07 18:43:49 +0000 |
---|---|---|
committer | rans | 2004-09-07 18:43:49 +0000 |
commit | c3e5977c555ede30117481d9601253ba01f1e725 (patch) | |
tree | 3a802007c2d70cbca3132a6b5fbf8ab58f8051b9 /examples | |
parent | e9e02cf4a942250afc7cd41a0629d5f50d70b6f1 (diff) | |
download | csoap-c3e5977c555ede30117481d9601253ba01f1e725.tar.gz csoap-c3e5977c555ede30117481d9601253ba01f1e725.tar.bz2 |
Because Windows httpd_run runs on a thread, have a pause line in here (gets (&c) )
Diffstat (limited to 'examples')
-rw-r--r-- | examples/csoap/simpleserver.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/examples/csoap/simpleserver.c b/examples/csoap/simpleserver.c index 7c16796..f4b7bef 100644 --- a/examples/csoap/simpleserver.c +++ b/examples/csoap/simpleserver.c @@ -1,7 +1,7 @@ /****************************************************************** - * $Id: simpleserver.c,v 1.6 2004/09/02 11:48:58 rans Exp $ + * $Id: simpleserver.c,v 1.7 2004/09/07 18:43:49 rans Exp $ * - * CSOAP Project: CSOAP examples project + * CSOAP Project: CSOAP examples project * Copyright (C) 2003 Ferhat Ayaz * * This program is free software; you can redistribute it and/or modify @@ -32,13 +32,13 @@ static const char *method = "sayHello"; void add_name(xmlNodePtr node, SoapEnv *env) { char *name; - name = (char*)xmlNodeListGetString(node->doc, + name = (char*)xmlNodeListGetString(node->doc, node->xmlChildrenNode, 1); if (!name) return; - soap_env_add_itemf(env,"xsd:string", "echo", + soap_env_add_itemf(env,"xsd:string", "echo", "Hello '%s'", name); xmlFree(BAD_CAST name); @@ -68,23 +68,30 @@ SoapEnv* say_hello(SoapEnv *request) int main(int argc, char *argv[]) { - + char c; SoapRouter *router; - + log_set_level(HLOG_VERBOSE); if (!soap_server_init_args(argc, argv)) { return 1; } - + router = soap_router_new();
soap_router_register_service(router, say_hello, method, urn);
soap_server_register_router(router, url);
+#ifndef WIN32 log_info1("send SIGTERM to shutdown"); +#endif soap_server_run(); - log_info1("shutting down\n"); +#ifdef WIN32 + log_info1("press ENTER to continue!"); + gets(&c); +#endif + + log_info1("shutting down\n"); soap_server_destroy(); return 0; |