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 
00156         axis2_status_t (AXIS2_CALL *
00157                 free)(
00158                     axis2_http_client_t *client,
00159                     const axis2_env_t *env);
00160     };
00161 
00165     struct axis2_http_client
00166     {
00168         axis2_http_client_ops_t *ops;
00169     };
00170 
00175     AXIS2_EXTERN axis2_http_client_t *AXIS2_CALL
00176     axis2_http_client_create (
00177         const axis2_env_t *env,
00178         axis2_url_t *url);
00179 
00187     axis2_status_t AXIS2_CALL
00188     axis2_http_client_free_void_arg (
00189         void *client,
00190         const axis2_env_t *env);
00191 
00192 /************************** Start of function macros **************************/
00193 
00196 #define AXIS2_HTTP_CLIENT_SEND(client, env, request) \
00197                                 ((client)->ops->send(client, env, request))
00198 
00201 #define AXIS2_HTTP_CLIENT_RECIEVE_HEADER(client, env) \
00202                                 ((client)->ops->recieve_header(client, env))
00203 
00206 #define AXIS2_HTTP_CLIENT_GET_RESPONSE(client, env) \
00207                                 ((client)->ops->get_response(client, env))
00208 
00211 #define AXIS2_HTTP_CLIENT_SET_URL(client, env, url) \
00212                                 ((client)->ops->set_url(client, env, url))
00213 
00216 #define AXIS2_HTTP_CLIENT_GET_URL(client, env) \
00217                                 ((client)->ops->get_url(client, env))
00218 
00221 #define AXIS2_HTTP_CLIENT_SET_TIMEOUT(client, env, timeout) \
00222                                 ((client)->ops->set_timeout(client, env,\
00223                         timeout))
00224 
00227 #define AXIS2_HTTP_CLIENT_GET_TIMEOUT(client, env) \
00228                                 ((client)->ops->get_url(client, env))
00229 
00232 #define AXIS2_HTTP_CLIENT_SET_PROXY(client, env, proxy_host, proxy_port) \
00233                                 ((client)->ops->set_proxy(client, env,\
00234                         proxy_host, proxy_port))
00235 
00238 #define AXIS2_HTTP_CLIENT_GET_PROXY(client, env) \
00239                                 ((client)->ops->get_proxy(client, env))
00240 
00243 #define AXIS2_HTTP_CLIENT_FREE(client, env) \
00244                                 ((client)->ops->free(client, env))
00245 
00246 /************************** End of function macros ****************************/
00247 
00249 #ifdef __cplusplus
00250 }
00251 #endif
00252 
00253 #endif                          /* AXIS2_HTTP_CLIENT_H */

Generated on Tue Oct 3 18:21:09 2006 for Axis2/C by  doxygen 1.4.7