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.

104 lines
3.0 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /******************************************************************
  2. * $Id: soap-router.h,v 1.8 2006/05/15 06:41:34 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: ayaz@jprogrammer.net
  23. ******************************************************************/
  24. #ifndef cSOAP_ROUTER_H
  25. #define cSOAP_ROUTER_H
  26. #include <libcsoap/soap-service.h>
  27. /**
  28. The router object. A router can store a set of
  29. services. A service is a C function.
  30. */
  31. typedef struct _SoapRouter
  32. {
  33. SoapServiceNode *service_head;
  34. SoapServiceNode *service_tail;
  35. SoapService *default_service;
  36. httpd_auth auth;
  37. xmlDocPtr wsdl;
  38. } SoapRouter;
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42. /**
  43. Creates a new router object. Create a router if
  44. you are implementing a soap server. Then register
  45. the services to this router.
  46. <P>A router points also to http url context.
  47. @returns Soap router
  48. @see soap_router_free
  49. */
  50. SoapRouter *soap_router_new(void);
  51. /**
  52. Registers a SOAP service (in this case a C function)
  53. to the router.
  54. @param router The router object
  55. @param func Function to register as a soap service
  56. @param method Method name to call the function from
  57. the client side.
  58. @param urn The urn for this service
  59. */
  60. void soap_router_register_service(SoapRouter * router,
  61. SoapServiceFunc func,
  62. const char *method, const char *urn);
  63. void soap_router_register_default_service(SoapRouter * router, SoapServiceFunc func, const char *method, const char *urn);
  64. void soap_router_register_description(SoapRouter *router, xmlDocPtr doc);
  65. void soap_router_register_security(SoapRouter *router, httpd_auth auth);
  66. /**
  67. Searches for a registered soap service.
  68. @param router The router object
  69. @param urn URN of the service
  70. @param method The name under which the service was registered.
  71. @return The service if found, NULL otherwise.
  72. */
  73. SoapService *soap_router_find_service(SoapRouter * router,
  74. const char *urn, const char *method);
  75. /**
  76. Frees the router object.
  77. @param router The router object to free
  78. */
  79. void soap_router_free(SoapRouter * router);
  80. #ifdef __cplusplus
  81. }
  82. #endif
  83. #endif