TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
httppost.h
Go to the documentation of this file.
1 /*
2  httppost.h
3 
4  gSOAP HTTP POST plugin for non-SOAP payloads.
5 
6  See httppost.c for instructions.
7 
8  Revisions:
9  register multiple POST content handlers, each for a content type
10 
11 gSOAP XML Web services tools
12 Copyright (C) 2004-2009, Robert van Engelen, Genivia, Inc. All Rights Reserved.
13 
14 --------------------------------------------------------------------------------
15 gSOAP public license.
16 
17 The contents of this file are subject to the gSOAP Public License Version 1.3
18 (the "License"); you may not use this file except in compliance with the
19 License. You may obtain a copy of the License at
20 http://www.cs.fsu.edu/~engelen/soaplicense.html
21 Software distributed under the License is distributed on an "AS IS" basis,
22 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
23 for the specific language governing rights and limitations under the License.
24 
25 The Initial Developer of the Original Code is Robert A. van Engelen.
26 Copyright (C) 2000-2004 Robert A. van Engelen, Genivia inc. All Rights Reserved.
27 --------------------------------------------------------------------------------
28 GPL license.
29 
30 This program is free software; you can redistribute it and/or modify it under
31 the terms of the GNU General Public License as published by the Free Software
32 Foundation; either version 2 of the License, or (at your option) any later
33 version.
34 
35 This program is distributed in the hope that it will be useful, but WITHOUT ANY
36 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
37 PARTICULAR PURPOSE. See the GNU General Public License for more details.
38 
39 You should have received a copy of the GNU General Public License along with
40 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
41 Place, Suite 330, Boston, MA 02111-1307 USA
42 
43 Author contact information:
44 [email protected] / [email protected]
45 
46 This program is released under the GPL with the additional exemption that
47 compiling, linking, and/or using OpenSSL is allowed.
48 --------------------------------------------------------------------------------
49 */
50 
51 #ifndef HTTPPOST_H
52 #define HTTPPOST_H
53 
54 #include "stdsoap2.h"
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
60 #define HTTP_POST_ID "HTTP-POST-1.1" /* plugin identification */
61 
62 extern const char http_post_id[];
63 
64 typedef int (*http_handler_t)(struct soap*);
65 
67 { const char *type;
69 };
70 
71 /* This is the local plugin data shared among all copies of the soap struct: */
73 { int (*fparsehdr)(struct soap*, const char*, const char*); /* to save and call the internal HTTP header parser */
74  int (*fput)(struct soap*); /* to save */
75  int (*fdel)(struct soap*); /* to save */
76  struct http_post_handlers *handlers; /* the server-side POST content type handlers */
77 };
78 
79 /* the http post plugin, note: argument should be a table of type-handler pairs */
80 int http_post(struct soap*, struct soap_plugin*, void*);
81 
82 /* a function to send HTTP POST, should be followd by a soap_send to transmit and soap_get_http_body to retrieve the HTTP body returned into an internal buffer */
83 int soap_post_connect(struct soap*, const char *endpoint, const char *action, const char *type);
84 
85 /* a function to send HTTP PUT, should be followed by a soap_send to transmit data */
86 int soap_put_connect(struct soap*, const char *endpoint, const char *action, const char *type);
87 
88 /* a function to send HTTP DELETE */
89 int soap_delete_connect(struct soap*, const char *endpoint, const char *action, const char *type);
90 
91 /* a function to retrieve the HTTP body into an internal buffer */
92 int soap_http_body(struct soap*, char **buf, size_t *len);
93 
94 #ifdef __cplusplus
95 }
96 #endif
97 
98 #endif
int soap_http_body(struct soap *, char **buf, size_t *len)
Definition: httppost.cpp:258
int(* fdel)(struct soap *)
Definition: httppost.h:75
int(* fparsehdr)(struct soap *, const char *, const char *)
Definition: httppost.h:73
int soap_put_connect(struct soap *, const char *endpoint, const char *action, const char *type)
Definition: httppost.cpp:244
Definition: httppost.h:72
Definition: stdsoap2.h:1933
struct http_post_handlers * handlers
Definition: httppost.h:76
Definition: stdsoap2.h:2250
const char http_post_id[]
Definition: httppost.cpp:146
int(* http_handler_t)(struct soap *)
Definition: httppost.h:64
int soap_delete_connect(struct soap *, const char *endpoint, const char *action, const char *type)
Definition: httppost.cpp:251
Definition: httppost.h:66
const char * type
Definition: httppost.h:67
http_handler_t handler
Definition: httppost.h:68
int http_post(struct soap *, struct soap_plugin *, void *)
Definition: httppost.cpp:156
int(* fput)(struct soap *)
Definition: httppost.h:74
int soap_post_connect(struct soap *, const char *endpoint, const char *action, const char *type)
Definition: httppost.cpp:237