httppost.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. httppost.h
  3. gSOAP HTTP POST plugin for non-SOAP payloads.
  4. See httppost.c for instructions.
  5. Revisions:
  6. register multiple POST content handlers, each for a content type
  7. gSOAP XML Web services tools
  8. Copyright (C) 2000-2018, Robert van Engelen, Genivia, Inc. All Rights Reserved.
  9. --------------------------------------------------------------------------------
  10. gSOAP public license.
  11. The contents of this file are subject to the gSOAP Public License Version 1.3
  12. (the "License"); you may not use this file except in compliance with the
  13. License. You may obtain a copy of the License at
  14. http://www.cs.fsu.edu/~engelen/soaplicense.html
  15. Software distributed under the License is distributed on an "AS IS" basis,
  16. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  17. for the specific language governing rights and limitations under the License.
  18. The Initial Developer of the Original Code is Robert A. van Engelen.
  19. Copyright (C) 2000-2004 Robert A. van Engelen, Genivia inc. All Rights Reserved.
  20. --------------------------------------------------------------------------------
  21. GPL license.
  22. This program is free software; you can redistribute it and/or modify it under
  23. the terms of the GNU General Public License as published by the Free Software
  24. Foundation; either version 2 of the License, or (at your option) any later
  25. version.
  26. This program is distributed in the hope that it will be useful, but WITHOUT ANY
  27. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  28. PARTICULAR PURPOSE. See the GNU General Public License for more details.
  29. You should have received a copy of the GNU General Public License along with
  30. this program; if not, write to the Free Software Foundation, Inc., 59 Temple
  31. Place, Suite 330, Boston, MA 02111-1307 USA
  32. Author contact information:
  33. engelen@genivia.com / engelen@acm.org
  34. This program is released under the GPL with the additional exemption that
  35. compiling, linking, and/or using OpenSSL is allowed.
  36. --------------------------------------------------------------------------------
  37. */
  38. #ifndef HTTPPOST_H
  39. #define HTTPPOST_H
  40. #include "stdsoap2.h"
  41. #ifdef __cplusplus
  42. extern "C" {
  43. #endif
  44. #define HTTP_POST_ID "SOAP-HTTP-POST/2.1" /* plugin identification */
  45. extern const char http_post_id[];
  46. typedef int (*http_handler_t)(struct soap*);
  47. struct http_post_handlers
  48. {
  49. const char *type;
  50. http_handler_t handler;
  51. };
  52. /* This is the local plugin data shared among all copies of the soap struct: */
  53. struct http_post_data
  54. {
  55. int (*fparsehdr)(struct soap*, const char*, const char*); /* to save and call the internal HTTP header parser */
  56. int (*fput)(struct soap*); /* to save */
  57. int (*fpatch)(struct soap*); /* to save */
  58. int (*fdel)(struct soap*); /* to save */
  59. struct http_post_handlers *handlers; /* the server-side POST content type handlers */
  60. };
  61. /* the http post plugin, note: argument should be a table of type-handler pairs */
  62. int http_post(struct soap*, struct soap_plugin*, void*);
  63. /* deprecated: use soap_POST instead */
  64. int soap_post_connect(struct soap*, const char *endpoint, const char *action, const char *type);
  65. /* deprecated: use soap_PUT instead */
  66. int soap_put_connect(struct soap*, const char *endpoint, const char *action, const char *type);
  67. /* deprecated: use soap_DELETE instead */
  68. int soap_delete_connect(struct soap*, const char *endpoint);
  69. /* deprecated: use soap_get_http_body instead */
  70. int soap_http_body(struct soap*, char **buf, size_t *len);
  71. #ifdef __cplusplus
  72. }
  73. #endif
  74. #endif