You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
2.6 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /******************************************************************
  2. * $Id: soap-server.h,v 1.10 2006/03/29 08:35:56 m0gg Exp $
  3. *
  4. * CSOAP Project: A SOAP client/server library in C
  5. * Copyright (C) 2003 Ferhat Ayaz
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Library General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Library General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Library General Public
  18. * License along with this library; if not, write to the
  19. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  20. * Boston, MA 02111-1307, USA.
  21. *
  22. * Email: ferhatayaz@yahoo.com
  23. ******************************************************************/
  24. #ifndef cSOAP_SERVER_H
  25. #define cSOAP_SERVER_H
  26. #include <libcsoap/soap-env.h>
  27. #include <libcsoap/soap-router.h>
  28. #include <libcsoap/soap-ctx.h>
  29. typedef struct _SoapRouterNode
  30. {
  31. char *context;
  32. SoapRouter *router;
  33. struct _SoapRouterNode *next;
  34. } SoapRouterNode;
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif
  38. /**
  39. Initializes the soap server with commandline arguments.
  40. <TABLE border=1>
  41. <TR><TH>Argument</TH><TH>Description</TH></TR>
  42. <TR><TD>-NHTTPport [port]</TD><TD>Port to listen (default: 10000)</TD></TR>
  43. <TR><TD>-NHTTPmaxconn [num]</TD><TD>Maximum thread connections</TD></TR>
  44. <TR><TD>-NHTTPlog [logfilename]</TD><TD>logfile</TD></TR>
  45. </TABLE>
  46. @param argc commandline arg count
  47. @param argv commandline arg vector
  48. @returns 1 if success, 0 otherwise
  49. */
  50. herror_t soap_server_init_args(int argc, char *argv[]);
  51. /**
  52. Register a router to the soap server.
  53. <P>http://<I>host</I>:<I>port</I>/<B>[context]</B>
  54. @param router The router to register
  55. @param context the url context
  56. @returns 1 if success, 0 otherwise
  57. @see soap_router_new
  58. @see soap_router_register_service
  59. */
  60. int soap_server_register_router(SoapRouter * router, const char *context);
  61. SoapRouter *soap_server_find_router(const char *context);
  62. SoapRouterNode * soap_server_get_routers(void);
  63. /**
  64. Enters the server loop and starts to listen to
  65. http requests.
  66. */
  67. herror_t soap_server_run();
  68. int soap_server_get_port(void);
  69. /**
  70. Frees the soap server.
  71. */
  72. void soap_server_destroy();
  73. #ifdef __cplusplus
  74. }
  75. #endif
  76. #endif