axis2_http_client.h

Go to the documentation of this file.
00001 /*
00002 * Licensed to the Apache Software Foundation (ASF) under one or more
00003 * contributor license agreements.  See the NOTICE file distributed with
00004 * this work for additional information regarding copyright ownership.
00005 * The ASF licenses this file to You under the Apache License, Version 2.0
00006 * (the "License"); you may not use this file except in compliance with
00007 * the License.  You may obtain a copy of the License at
00008 *
00009 *      http://www.apache.org/licenses/LICENSE-2.0
00010 *
00011 * Unless required by applicable law or agreed to in writing, software
00012 * distributed under the License is distributed on an "AS IS" BASIS,
00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014 * See the License for the specific language governing permissions and
00015 * limitations under the License.
00016 */
00017 
00018 #ifndef AXIS2_HTTP_CLIENT_H
00019 #define AXIS2_HTTP_CLIENT_H
00020 
00033 #include <axis2_const.h>
00034 #include <axis2_defines.h>
00035 #include <axis2_env.h>
00036 #include <axis2_http_simple_response.h>
00037 #include <axis2_http_simple_request.h>
00038 #include <axis2_url.h>
00039 
00040 #ifdef __cplusplus
00041 extern "C"
00042 {
00043 #endif
00044 
00046     typedef struct axis2_http_client_ops axis2_http_client_ops_t;
00048     typedef struct axis2_http_client axis2_http_client_t;
00049 
00050 
00055     struct axis2_http_client_ops
00056     {
00063         axis2_status_t (AXIS2_CALL *
00064                 send)(
00065                     axis2_http_client_t *client,
00066                     const axis2_env_t *env,
00067                     axis2_http_simple_request_t *request);
00068 
00073         int (AXIS2_CALL *
00074                 recieve_header)(
00075                     axis2_http_client_t *client,
00076                     const axis2_env_t *env);
00077 
00082         axis2_http_simple_response_t *(AXIS2_CALL *
00083                 get_response)(
00084                     const axis2_http_client_t *client,
00085                     const axis2_env_t *env);
00086 
00093         axis2_status_t (AXIS2_CALL *
00094                 set_url)(
00095                     axis2_http_client_t *client,
00096                     const axis2_env_t *env,
00097                     axis2_url_t *url);
00098 
00103         axis2_url_t *(AXIS2_CALL *
00104                 get_url)(
00105                     const axis2_http_client_t *client,
00106                     const axis2_env_t *env);
00107 
00114         axis2_status_t (AXIS2_CALL *
00115                 set_timeout)(
00116                     axis2_http_client_t *client,
00117                     const axis2_env_t *env,
00118                     int timeout_ms);
00119 
00124         int (AXIS2_CALL *
00125                 get_timeout)(
00126                     const axis2_http_client_t *client,
00127                     const axis2_env_t *env);
00128 
00136         axis2_status_t (AXIS2_CALL *
00137                 set_proxy)(
00138                     axis2_http_client_t *client,
00139                     const axis2_env_t *env,
00140                     axis2_char_t *proxy_host,
00141                     int proxy_port);
00142 
00147         axis2_char_t *(AXIS2_CALL *
00148                 get_proxy)(
00149                     const axis2_http_client_t *client,
00150                     const axis2_env_t *env);
00151         
00152         axis2_status_t (AXIS2_CALL *
00153                 set_dump_input_msg) (
00154                     axis2_http_client_t *client,
00155                     const axis2_env_t *env,
00156                     axis2_bool_t dump_input_msg);
00157 
00163         axis2_status_t (AXIS2_CALL *
00164                 free)(
00165                     axis2_http_client_t *client,
00166                     const axis2_env_t *env);
00167     };
00168 
00172     struct axis2_http_client
00173     {
00175         axis2_http_client_ops_t *ops;
00176     };
00177 
00182     AXIS2_EXTERN axis2_http_client_t *AXIS2_CALL
00183     axis2_http_client_create (
00184         const axis2_env_t *env,
00185         axis2_url_t *url);
00186 
00194     axis2_status_t AXIS2_CALL
00195     axis2_http_client_free_void_arg (
00196         void *client,
00197         const axis2_env_t *env);
00198 
00199 /************************** Start of function macros **************************/
00200 
00203 #define AXIS2_HTTP_CLIENT_SEND(client, env, request) \
00204                                 ((client)->ops->send(client, env, request))
00205 
00208 #define AXIS2_HTTP_CLIENT_RECIEVE_HEADER(client, env) \
00209                                 ((client)->ops->recieve_header(client, env))
00210 
00213 #define AXIS2_HTTP_CLIENT_GET_RESPONSE(client, env) \
00214                                 ((client)->ops->get_response(client, env))
00215 
00218 #define AXIS2_HTTP_CLIENT_SET_URL(client, env, url) \
00219                                 ((client)->ops->set_url(client, env, url))
00220 
00223 #define AXIS2_HTTP_CLIENT_GET_URL(client, env) \
00224                                 ((client)->ops->get_url(client, env))
00225 
00228 #define AXIS2_HTTP_CLIENT_SET_TIMEOUT(client, env, timeout) \
00229                                 ((client)->ops->set_timeout(client, env,\
00230                         timeout))
00231 
00234 #define AXIS2_HTTP_CLIENT_GET_TIMEOUT(client, env) \
00235                                 ((client)->ops->get_url(client, env))
00236 
00239 #define AXIS2_HTTP_CLIENT_SET_PROXY(client, env, proxy_host, proxy_port) \
00240                                 ((client)->ops->set_proxy(client, env,\
00241                         proxy_host, proxy_port))
00242 
00245 #define AXIS2_HTTP_CLIENT_GET_PROXY(client, env) \
00246                                 ((client)->ops->get_proxy(client, env))
00247 
00250 #define AXIS2_HTTP_CLIENT_SET_DUMP_INPUT_MSG(client, env, dump_input_msg) \
00251         ((client)->ops->set_dump_input_msg(client, env, dump_input_msg))
00252 
00255 #define AXIS2_HTTP_CLIENT_FREE(client, env) \
00256                                 ((client)->ops->free(client, env))
00257 
00258 /************************** End of function macros ****************************/
00259 
00261 #ifdef __cplusplus
00262 }
00263 #endif
00264 
00265 #endif                          /* AXIS2_HTTP_CLIENT_H */

Generated on Wed Dec 20 20:14:10 2006 for Axis2/C by  doxygen 1.5.1