axis2_http_client.h

Go to the documentation of this file.
00001 /*
00002 * Copyright 2004,2005 The Apache Software Foundation.
00003 *
00004 * Licensed under the Apache License, Version 2.0 (the "License");
00005 * you may not use this file except in compliance with the License.
00006 * You may obtain a copy of the License at
00007 *
00008 *      http://www.apache.org/licenses/LICENSE-2.0
00009 *
00010 * Unless required by applicable law or agreed to in writing, software
00011 * distributed under the License is distributed on an "AS IS" BASIS,
00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013 * See the License for the specific language governing permissions and
00014 * limitations under the License.
00015 */
00016 
00017 #ifndef AXIS2_HTTP_CLIENT_H
00018 #define AXIS2_HTTP_CLIENT_H
00019 
00032 #include <axis2_const.h>
00033 #include <axis2_defines.h>
00034 #include <axis2_env.h>
00035 #include <axis2_http_simple_response.h>
00036 #include <axis2_http_simple_request.h>
00037 #include <axis2_url.h>
00038 
00039 #ifdef __cplusplus
00040 extern "C"
00041 {
00042 #endif
00043 
00045     typedef struct axis2_http_client_ops axis2_http_client_ops_t;
00047     typedef struct axis2_http_client axis2_http_client_t;
00048 
00049 
00054     struct axis2_http_client_ops
00055     {
00062         axis2_status_t (AXIS2_CALL *
00063                 send)(
00064                     axis2_http_client_t *client,
00065                     const axis2_env_t *env,
00066                     axis2_http_simple_request_t *request);
00067 
00072         int (AXIS2_CALL *
00073                 recieve_header)(
00074                     axis2_http_client_t *client,
00075                     const axis2_env_t *env);
00076 
00081         axis2_http_simple_response_t *(AXIS2_CALL *
00082                 get_response)(
00083                     const axis2_http_client_t *client,
00084                     const axis2_env_t *env);
00085 
00092         axis2_status_t (AXIS2_CALL *
00093                 set_url)(
00094                     axis2_http_client_t *client,
00095                     const axis2_env_t *env,
00096                     axis2_url_t *url);
00097 
00102         axis2_url_t *(AXIS2_CALL *
00103                 get_url)(
00104                     const axis2_http_client_t *client,
00105                     const axis2_env_t *env);
00106 
00113         axis2_status_t (AXIS2_CALL *
00114                 set_timeout)(
00115                     axis2_http_client_t *client,
00116                     const axis2_env_t *env,
00117                     int timeout_ms);
00118 
00123         int (AXIS2_CALL *
00124                 get_timeout)(
00125                     const axis2_http_client_t *client,
00126                     const axis2_env_t *env);
00127 
00135         axis2_status_t (AXIS2_CALL *
00136                 set_proxy)(
00137                     axis2_http_client_t *client,
00138                     const axis2_env_t *env,
00139                     axis2_char_t *proxy_host,
00140                     int proxy_port);
00141 
00146         axis2_char_t *(AXIS2_CALL *
00147                 get_proxy)(
00148                     const axis2_http_client_t *client,
00149                     const axis2_env_t *env);
00150         
00151         axis2_status_t (AXIS2_CALL *
00152                 set_dump_input_msg) (
00153                     axis2_http_client_t *client,
00154                     const axis2_env_t *env,
00155                     axis2_bool_t dump_input_msg);
00156 
00162         axis2_status_t (AXIS2_CALL *
00163                 free)(
00164                     axis2_http_client_t *client,
00165                     const axis2_env_t *env);
00166     };
00167 
00171     struct axis2_http_client
00172     {
00174         axis2_http_client_ops_t *ops;
00175     };
00176 
00181     AXIS2_EXTERN axis2_http_client_t *AXIS2_CALL
00182     axis2_http_client_create (
00183         const axis2_env_t *env,
00184         axis2_url_t *url);
00185 
00193     axis2_status_t AXIS2_CALL
00194     axis2_http_client_free_void_arg (
00195         void *client,
00196         const axis2_env_t *env);
00197 
00198 /************************** Start of function macros **************************/
00199 
00202 #define AXIS2_HTTP_CLIENT_SEND(client, env, request) \
00203                                 ((client)->ops->send(client, env, request))
00204 
00207 #define AXIS2_HTTP_CLIENT_RECIEVE_HEADER(client, env) \
00208                                 ((client)->ops->recieve_header(client, env))
00209 
00212 #define AXIS2_HTTP_CLIENT_GET_RESPONSE(client, env) \
00213                                 ((client)->ops->get_response(client, env))
00214 
00217 #define AXIS2_HTTP_CLIENT_SET_URL(client, env, url) \
00218                                 ((client)->ops->set_url(client, env, url))
00219 
00222 #define AXIS2_HTTP_CLIENT_GET_URL(client, env) \
00223                                 ((client)->ops->get_url(client, env))
00224 
00227 #define AXIS2_HTTP_CLIENT_SET_TIMEOUT(client, env, timeout) \
00228                                 ((client)->ops->set_timeout(client, env,\
00229                         timeout))
00230 
00233 #define AXIS2_HTTP_CLIENT_GET_TIMEOUT(client, env) \
00234                                 ((client)->ops->get_url(client, env))
00235 
00238 #define AXIS2_HTTP_CLIENT_SET_PROXY(client, env, proxy_host, proxy_port) \
00239                                 ((client)->ops->set_proxy(client, env,\
00240                         proxy_host, proxy_port))
00241 
00244 #define AXIS2_HTTP_CLIENT_GET_PROXY(client, env) \
00245                                 ((client)->ops->get_proxy(client, env))
00246 
00249 #define AXIS2_HTTP_CLIENT_SET_DUMP_INPUT_MSG(client, env, dump_input_msg) \
00250         ((client)->ops->set_dump_input_msg(client, env, dump_input_msg))
00251 
00254 #define AXIS2_HTTP_CLIENT_FREE(client, env) \
00255                                 ((client)->ops->free(client, env))
00256 
00257 /************************** End of function macros ****************************/
00258 
00260 #ifdef __cplusplus
00261 }
00262 #endif
00263 
00264 #endif                          /* AXIS2_HTTP_CLIENT_H */

Generated on Thu Oct 26 21:00:11 2006 for Axis2/C by  doxygen 1.4.7