You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by di...@apache.org on 2008/04/03 15:11:11 UTC
svn commit: r644303 - in /webservices/axis2/trunk/c: include/
src/core/transport/http/common/ src/core/transport/http/receiver/
src/core/transport/http/sender/ src/core/transport/http/sender/libcurl/
src/core/transport/http/sender/ssl/ src/core/transpo...
Author: dinesh
Date: Thu Apr 3 06:11:06 2008
New Revision: 644303
URL: http://svn.apache.org/viewvc?rev=644303&view=rev
Log:
more comments, error logs and comments added to transport
Modified:
webservices/axis2/trunk/c/include/axis2_http_transport.h
webservices/axis2/trunk/c/src/core/transport/http/common/http_accept_record.c
webservices/axis2/trunk/c/src/core/transport/http/common/simple_http_svr_conn.c
webservices/axis2/trunk/c/src/core/transport/http/receiver/http_receiver.c
webservices/axis2/trunk/c/src/core/transport/http/sender/http_client.c
webservices/axis2/trunk/c/src/core/transport/http/sender/http_sender.c
webservices/axis2/trunk/c/src/core/transport/http/sender/http_transport_sender.c
webservices/axis2/trunk/c/src/core/transport/http/sender/libcurl/axis2_libcurl.c
webservices/axis2/trunk/c/src/core/transport/http/sender/libcurl/libcurl_stream.c
webservices/axis2/trunk/c/src/core/transport/http/sender/ssl/ssl_stream.c
webservices/axis2/trunk/c/src/core/transport/http/util/http_transport_utils.c
Modified: webservices/axis2/trunk/c/include/axis2_http_transport.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_http_transport.h?rev=644303&r1=644302&r2=644303&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_http_transport.h (original)
+++ webservices/axis2/trunk/c/include/axis2_http_transport.h Thu Apr 3 06:11:06 2008
@@ -981,6 +981,10 @@
#define AXIS2_ESC_DOUBLE_QUOTE_STR "\""
+#define AXIS2_ESC_SINGLE_QUOTE '\''
+
+#define AXIS2_DOUBLE_QUOTE '"'
+
#define AXIS2_ESC_NULL '\0'
#define AXIS2_SEMI_COLON_STR ";"
@@ -1029,11 +1033,73 @@
#define AXIS2_EQ '='
+#define AXIS2_AND '&'
+
+#define AXIS2_PERCENT '%'
+
#define AXIS2_HTTP_SERVER " (Simple Axis2 HTTP Server)"
#define AXIS2_COMMA_SPACE_STR ", "
#define AXIS2_SPACE_TAB_EQ " \t="
+
+#define AXIS2_ACTION "action"
+
+ /* Error Messages */
+
+#define AXIS2_HTTP_NOT_FOUND "<html><head><title>404 Not Found</title></head>\
+ <body><h2>Not Found</h2><p>The requested URL was not found on this server.\
+</p></body></html>"
+
+
+#define AXIS2_HTTP_NOT_IMPLEMENTED "<html><head><title>501 Not Implemented\
+</title></head><body><h2>Not Implemented</h2><p>The requested Method is not\
+implemented on this server.</p></body></html>"
+
+
+#define AXIS2_HTTP_INTERNAL_SERVER_ERROR "<html><head><title>500 Internal Server\
+ Error</title></head><body><h2>Internal Server Error</h2><p>The server \
+encountered an unexpected condition which prevented it from fulfilling the \
+request.</p></body></html>"
+
+
+#define AXIS2_HTTP_METHOD_NOT_ALLOWED "<html><head><title>405 Method Not Allowed\
+</title></head><body><h2>Method Not Allowed</h2><p>The requested method is not\
+allowed for this URL.</p></body></html>"
+
+#define AXIS2_HTTP_NOT_ACCEPTABLE "<html><head><title>406 Not Acceptable\
+</title></head><body><h2>Not Acceptable</h2><p>An appropriate representation of \
+the requested resource could not be found on this server.</p></body></html>"
+
+#define AXIS2_HTTP_BAD_REQUEST "<html><head><title>400 Bad Request</title>\
+</head><body><h2>Bad Request</h2><p>Your client sent a request that this server\
+ could not understand.</p></body></html>"
+
+#define AXIS2_HTTP_REQUEST_TIMEOUT "<html><head><title>408 Request Timeout\
+</title></head><body><h2>Request Timeout</h2><p>Cannot wait any longer for \
+the HTTP request from the client.</p></body></html>"
+
+#define AXIS2_HTTP_CONFLICT "<html><head><title>409 Conflict</title></head>\
+<body><h2>Conflict</h2><p>The client attempted to put the server\'s resources\
+ into an invalid state.</p></body></html>"
+
+#define AXIS2_HTTP_GONE "<html><head><title>410 Gone</title></head><body>\
+<h2>Gone</h2><p>The requested resource is no longer available on this server.\
+</p></body></html>"
+
+#define AXIS2_HTTP_PRECONDITION_FAILED "<html><head><title>412 Precondition \
+Failed</title></head><body><h2>Precondition Failed</h2><p>A precondition for\
+ the requested URL failed.</p></body></html>"
+
+#define AXIS2_HTTP_TOO_LARGE "<html><head><title>413 Request Entity Too Large\
+</title></head><body><h2>Request Entity Too Large</h2><p>The data provided in\
+ the request is too large or the requested resource does not allow request \
+data.</p></body></html>"
+
+#define AXIS2_HTTP_SERVICE_UNAVILABLE "<html><head><title>503 Service \
+Unavailable</title></head><body><h2>Service Unavailable</h2><p>The service\
+ is temporarily unable to serve your request.</p></body></html>"
+
/** @} */
#ifdef __cplusplus
Modified: webservices/axis2/trunk/c/src/core/transport/http/common/http_accept_record.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/common/http_accept_record.c?rev=644303&r1=644302&r2=644303&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/common/http_accept_record.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/common/http_accept_record.c Thu Apr 3 06:11:06 2008
@@ -61,6 +61,7 @@
AXIS2_HANDLE_ERROR (env, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
+
memset ((void *)accept_record, 0, sizeof (axis2_http_accept_record_t));
accept_record->record = axutil_strtrim(env, tmp_accept_record, AXIS2_SPACE_COMMA);
Modified: webservices/axis2/trunk/c/src/core/transport/http/common/simple_http_svr_conn.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/common/simple_http_svr_conn.c?rev=644303&r1=644302&r2=644303&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/common/simple_http_svr_conn.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/common/simple_http_svr_conn.c Thu Apr 3 06:11:06 2008
@@ -95,6 +95,7 @@
return AXIS2_SUCCESS;
}
+
AXIS2_EXTERN axis2_bool_t AXIS2_CALL
axis2_simple_http_svr_conn_is_open(
axis2_simple_http_svr_conn_t * svr_conn,
@@ -107,6 +108,7 @@
return AXIS2_FALSE;
}
+
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_simple_http_svr_conn_set_keep_alive(
axis2_simple_http_svr_conn_t * svr_conn,
@@ -117,6 +119,7 @@
return AXIS2_SUCCESS;
}
+
AXIS2_EXTERN axis2_bool_t AXIS2_CALL
axis2_simple_http_svr_conn_is_keep_alive(
axis2_simple_http_svr_conn_t * svr_conn,
@@ -125,6 +128,7 @@
return svr_conn->keep_alive;
}
+
AXIS2_EXTERN axutil_stream_t *AXIS2_CALL
axis2_simple_http_svr_conn_get_stream(
const axis2_simple_http_svr_conn_t * svr_conn,
@@ -133,6 +137,7 @@
return svr_conn->stream;
}
+
AXIS2_EXTERN axis2_http_response_writer_t *AXIS2_CALL
axis2_simple_http_svr_conn_get_writer(
const axis2_simple_http_svr_conn_t * svr_conn,
@@ -141,6 +146,7 @@
return axis2_http_response_writer_create(env, svr_conn->stream);
}
+
AXIS2_EXTERN axis2_http_simple_request_t *AXIS2_CALL
axis2_simple_http_svr_conn_read_request(
axis2_simple_http_svr_conn_t * svr_conn,
@@ -195,7 +201,7 @@
request_line = axis2_http_request_line_parse_line(env, str_line);
if (!request_line)
{
- AXIS2_ERROR_SET(env->error,
+ AXIS2_HANDLE_ERROR(env,
AXIS2_ERROR_INVALID_HTTP_HEADER_START_LINE,
AXIS2_FAILURE);
return NULL;
@@ -328,9 +334,9 @@
status_line = axis2_http_simple_response_get_status_line(response, env);
if (!status_line)
{
- AXIS2_ERROR_SET(env->error,
- AXIS2_ERROR_INVALID_HTTP_HEADER_START_LINE,
- AXIS2_FAILURE);
+ AXIS2_HANDLE_ERROR(env,
+ AXIS2_ERROR_INVALID_HTTP_HEADER_START_LINE,
+ AXIS2_FAILURE);
axis2_http_response_writer_free(response_writer, env);
response_writer = NULL;
return AXIS2_FAILURE;
@@ -377,9 +383,11 @@
{
axis2_status_t write_stat = AXIS2_FAILURE;
if (AXIS2_FALSE == binary_content)
+ {
write_stat = axis2_http_response_writer_println_str(response_writer,
env,
response_body);
+ }
else
{
write_stat = axis2_http_response_writer_write_buf(response_writer,
@@ -390,8 +398,8 @@
if (AXIS2_SUCCESS != write_stat)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_WRITING_RESPONSE,
- AXIS2_FAILURE);
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_WRITING_RESPONSE,
+ AXIS2_FAILURE);
axis2_http_response_writer_free(response_writer, env);
return AXIS2_FAILURE;
}
@@ -415,6 +423,7 @@
return AXIS2_SUCCESS;
}
+
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_simple_http_svr_conn_set_rcv_timeout(
axis2_simple_http_svr_conn_t * svr_conn,
@@ -426,6 +435,7 @@
timeout);
}
+
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_simple_http_svr_conn_set_snd_timeout(
axis2_simple_http_svr_conn_t * svr_conn,
@@ -437,6 +447,7 @@
timeout);
}
+
AXIS2_EXTERN axis2_char_t *AXIS2_CALL
axis2_simple_http_svr_conn_get_svr_ip(
const axis2_simple_http_svr_conn_t * svr_conn,
@@ -444,6 +455,7 @@
{
return axutil_network_handler_get_svr_ip(env, svr_conn->socket);
}
+
AXIS2_EXTERN axis2_char_t *AXIS2_CALL
axis2_simple_http_svr_conn_get_peer_ip(
Modified: webservices/axis2/trunk/c/src/core/transport/http/receiver/http_receiver.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/receiver/http_receiver.c?rev=644303&r1=644302&r2=644303&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/receiver/http_receiver.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/receiver/http_receiver.c Thu Apr 3 06:11:06 2008
@@ -101,7 +101,7 @@
if (!server_impl)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
Modified: webservices/axis2/trunk/c/src/core/transport/http/sender/http_client.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/sender/http_client.c?rev=644303&r1=644302&r2=644303&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/sender/http_client.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/sender/http_client.c Thu Apr 3 06:11:06 2008
@@ -62,7 +62,7 @@
if (!http_client)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
@@ -160,7 +160,7 @@
if (!client->url)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NULL_URL, AXIS2_FAILURE);
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_NULL_URL, AXIS2_FAILURE);
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Request url not set");
return AXIS2_FAILURE;
}
@@ -190,7 +190,7 @@
if (client->sockfd < 0)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_SOCKET_ERROR, AXIS2_FAILURE);
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_SOCKET_ERROR, AXIS2_FAILURE);
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Socket Creation failed.");
return AXIS2_FAILURE;
}
@@ -227,7 +227,7 @@
axis2_http_client_get_key_file
(client, env), ssl_pp);
#else
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_TRANSPORT_PROTOCOL,
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_INVALID_TRANSPORT_PROTOCOL,
AXIS2_FAILURE);
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Invalid Transport Protocol,\
HTTPS transport not enabled.");
@@ -322,7 +322,7 @@
20 * sizeof(axis2_char_t));
if (!host_port_str)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, "memory allocation failed\
for host %s and %s path", host, path);
return AXIS2_FAILURE;
@@ -337,7 +337,7 @@
if (!str_request_line)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, "memory allocation failed\
for host %s and %s path", host, path);
return AXIS2_FAILURE;
@@ -445,7 +445,7 @@
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
"client data stream null or socket error for host \
%s and %d port", host, port);
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_HTTP_REQUEST_NOT_SENT,
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_HTTP_REQUEST_NOT_SENT,
AXIS2_FAILURE);
return -1;
}
@@ -470,14 +470,14 @@
if (read < 0)
{
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
- "[axis2c] http client , response timed out");
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_RESPONSE_TIMED_OUT,
+ "http client , response timed out");
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_RESPONSE_TIMED_OUT,
AXIS2_FAILURE);
return -1;
}
else if (read == 0)
{
- AXIS2_ERROR_SET(env->error,
+ AXIS2_HANDLE_ERROR(env,
AXIS2_ERROR_RESPONSE_SERVER_SHUTDOWN,
AXIS2_FAILURE);
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
@@ -491,7 +491,7 @@
AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI,
"axis2_http_status_line_create failed for \
str_status_line %s", str_status_line);
- AXIS2_ERROR_SET(env->error,
+ AXIS2_HANDLE_ERROR(env,
AXIS2_ERROR_INVALID_HTTP_HEADER_START_LINE,
AXIS2_FAILURE);
http_status = 0;
@@ -562,7 +562,7 @@
axis2_http_simple_response_get_content_length(client->response,
env) > 0)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_RESPONSE_CONTENT_TYPE_MISSING,
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_RESPONSE_CONTENT_TYPE_MISSING,
AXIS2_FAILURE);
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
"Response does not contain" " Content-Type");
@@ -735,14 +735,14 @@
}
if (read < 0)
{
- AXIS2_ERROR_SET(env->error,
+ AXIS2_HANDLE_ERROR(env,
AXIS2_ERROR_RESPONSE_TIMED_OUT, AXIS2_FAILURE);
return AXIS2_FAILURE;
}
status_line = axis2_http_status_line_create(env, str_status_line);
if (!status_line)
{
- AXIS2_ERROR_SET(env->error,
+ AXIS2_HANDLE_ERROR(env,
AXIS2_ERROR_INVALID_HTTP_HEADER_START_LINE,
AXIS2_FAILURE);
return AXIS2_FAILURE;
Modified: webservices/axis2/trunk/c/src/core/transport/http/sender/http_sender.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/sender/http_sender.c?rev=644303&r1=644302&r2=644303&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/sender/http_sender.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/sender/http_sender.c Thu Apr 3 06:11:06 2008
@@ -141,7 +141,7 @@
if (!sender)
{
- AXIS2_ERROR_SET (env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
@@ -271,9 +271,9 @@
{
if (!soap_body)
{
- AXIS2_ERROR_SET (env->error,
- AXIS2_ERROR_SOAP_ENVELOPE_OR_SOAP_BODY_NULL,
- AXIS2_FAILURE);
+ AXIS2_HANDLE_ERROR(env,
+ AXIS2_ERROR_SOAP_ENVELOPE_OR_SOAP_BODY_NULL,
+ AXIS2_FAILURE);
AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, "%s",
AXIS2_ERROR_GET_MESSAGE (env->error));
return AXIS2_FAILURE;
@@ -428,8 +428,8 @@
if (!sender->om_output)
{
- AXIS2_ERROR_SET (env->error, AXIS2_ERROR_NULL_OM_OUTPUT,
- AXIS2_FAILURE);
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_NULL_OM_OUTPUT,
+ AXIS2_FAILURE);
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "%s",
AXIS2_ERROR_GET_MESSAGE(env->error));
return AXIS2_FAILURE;
@@ -1360,9 +1360,9 @@
{
const axis2_char_t *mep =
axis2_op_get_msg_exchange_pattern (op, env);
- AXIS2_ERROR_SET (env->error,
- AXIS2_ERROR_HTTP_CLIENT_TRANSPORT_ERROR,
- AXIS2_FAILURE);
+ AXIS2_HANDLE_ERROR(env,
+ AXIS2_ERROR_HTTP_CLIENT_TRANSPORT_ERROR,
+ AXIS2_FAILURE);
/* handle one way case */
if (axutil_strcmp (mep, AXIS2_MEP_URI_OUT_ONLY) == 0)
@@ -1393,8 +1393,8 @@
}
}
- AXIS2_ERROR_SET (env->error,
- AXIS2_ERROR_HTTP_CLIENT_TRANSPORT_ERROR, AXIS2_FAILURE);
+ AXIS2_HANDLE_ERROR(env,
+ AXIS2_ERROR_HTTP_CLIENT_TRANSPORT_ERROR, AXIS2_FAILURE);
AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Exit:axis2_http_sender_send");
return AXIS2_FAILURE;
}
@@ -1553,8 +1553,8 @@
in_stream = axis2_http_simple_response_get_body (response, env);
if (!in_stream)
{
- AXIS2_ERROR_SET (env->error, AXIS2_ERROR_NULL_STREAM_IN_RESPONSE_BODY,
- AXIS2_FAILURE);
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_NULL_STREAM_IN_RESPONSE_BODY,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
@@ -2950,7 +2950,7 @@
}
else
{
- AXIS2_ERROR_SET (env->error, AXIS2_ERROR_HTTP_CLIENT_TRANSPORT_ERROR,
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_HTTP_CLIENT_TRANSPORT_ERROR,
AXIS2_FAILURE);
}
@@ -3058,7 +3058,7 @@
}
else
{
- AXIS2_ERROR_SET (env->error, AXIS2_ERROR_HTTP_CLIENT_TRANSPORT_ERROR,
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_HTTP_CLIENT_TRANSPORT_ERROR,
AXIS2_FAILURE);
}
@@ -3124,7 +3124,7 @@
}
else
{
- AXIS2_ERROR_SET (env->error, AXIS2_ERROR_HTTP_CLIENT_TRANSPORT_ERROR,
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_HTTP_CLIENT_TRANSPORT_ERROR,
AXIS2_FAILURE);
}
return status;
@@ -3185,7 +3185,7 @@
}
else
{
- AXIS2_ERROR_SET (env->error, AXIS2_ERROR_HTTP_CLIENT_TRANSPORT_ERROR,
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_HTTP_CLIENT_TRANSPORT_ERROR,
AXIS2_FAILURE);
}
return status;
Modified: webservices/axis2/trunk/c/src/core/transport/http/sender/http_transport_sender.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/sender/http_transport_sender.c?rev=644303&r1=644302&r2=644303&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/sender/http_transport_sender.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/sender/http_transport_sender.c Thu Apr 3 06:11:06 2008
@@ -105,10 +105,10 @@
if (!transport_sender_impl)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
- memset (transport_sender_impl, 0, sizeof (axis2_http_transport_sender_impl_t));
+ memset ((void *)transport_sender_impl, 0, sizeof (axis2_http_transport_sender_impl_t));
transport_sender_impl->http_version =
axutil_strdup(env, AXIS2_HTTP_HEADER_PROTOCOL_11);
@@ -124,7 +124,7 @@
if (!transport_sender_impl->libcurl)
{
AXIS2_FREE(env->allocator, transport_sender_impl);
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
#endif
@@ -137,6 +137,11 @@
axis2_transport_sender_t * transport_sender,
const axutil_env_t * env)
{
+ if (!transport_sender)
+ {
+ return;
+ }
+
axis2_http_transport_sender_impl_t *transport_sender_impl = NULL;
transport_sender_impl = AXIS2_INTF_TO_IMPL(transport_sender);
@@ -255,9 +260,9 @@
soap_data_out = axis2_msg_ctx_get_soap_envelope(msg_ctx, env);
if (!soap_data_out)
{
- AXIS2_ERROR_SET(env->error,
- AXIS2_ERROR_NULL_SOAP_ENVELOPE_IN_MSG_CTX,
- AXIS2_FAILURE);
+ AXIS2_HANDLE_ERROR(env,
+ AXIS2_ERROR_NULL_SOAP_ENVELOPE_IN_MSG_CTX,
+ AXIS2_FAILURE);
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "%s",
AXIS2_ERROR_GET_MESSAGE(env->error));
return AXIS2_SUCCESS;
@@ -322,11 +327,9 @@
if (!out_info)
{
- AXIS2_ERROR_SET(env->error,
+ AXIS2_HANDLE_ERROR(env,
AXIS2_ERROR_OUT_TRNSPORT_INFO_NULL,
AXIS2_FAILURE);
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "%s",
- AXIS2_ERROR_GET_MESSAGE(env->error));
axiom_output_free(om_output, env);
om_output = NULL;
xml_writer = NULL;
@@ -426,11 +429,9 @@
if (!soap_body)
{
- AXIS2_ERROR_SET(env->error,
+ AXIS2_HANDLE_ERROR(env,
AXIS2_ERROR_SOAP_ENVELOPE_OR_SOAP_BODY_NULL,
AXIS2_FAILURE);
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "%s",
- AXIS2_ERROR_GET_MESSAGE(env->error));
axiom_output_free(om_output, env);
om_output = NULL;
xml_writer = NULL;
@@ -665,10 +666,8 @@
else
{
/* HTTP version is not available in axis2.xml */
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NULL_HTTP_VERSION,
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_NULL_HTTP_VERSION,
AXIS2_FAILURE);
- AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, "%s",
- AXIS2_ERROR_GET_MESSAGE(env->error));
return AXIS2_FAILURE;
}
Modified: webservices/axis2/trunk/c/src/core/transport/http/sender/libcurl/axis2_libcurl.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/sender/libcurl/axis2_libcurl.c?rev=644303&r1=644302&r2=644303&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/sender/libcurl/axis2_libcurl.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/sender/libcurl/axis2_libcurl.c Thu Apr 3 06:11:06 2008
@@ -519,8 +519,8 @@
if (curl_easy_perform(handler))
{
AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, "%s", &data->errorbuffer);
- AXIS2_ERROR_SET (env->error, AXIS2_ERROR_HTTP_CLIENT_TRANSPORT_ERROR,
- AXIS2_FAILURE);
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_HTTP_CLIENT_TRANSPORT_ERROR,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
Modified: webservices/axis2/trunk/c/src/core/transport/http/sender/libcurl/libcurl_stream.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/sender/libcurl/libcurl_stream.c?rev=644303&r1=644302&r2=644303&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/sender/libcurl/libcurl_stream.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/sender/libcurl/libcurl_stream.c Thu Apr 3 06:11:06 2008
@@ -82,7 +82,7 @@
if (!stream_impl)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
Modified: webservices/axis2/trunk/c/src/core/transport/http/sender/ssl/ssl_stream.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/sender/ssl/ssl_stream.c?rev=644303&r1=644302&r2=644303&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/sender/ssl/ssl_stream.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/sender/ssl/ssl_stream.c Thu Apr 3 06:11:06 2008
@@ -85,7 +85,7 @@
if (!stream_impl)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
memset ((void *)stream_impl, 0, sizeof (ssl_stream_impl_t));
@@ -211,7 +211,7 @@
tmp_buffer = AXIS2_MALLOC(env->allocator, count * sizeof(axis2_char_t));
if (tmp_buffer == NULL)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return -1;
}
len = SSL_read(stream_impl->ssl, tmp_buffer, count);
Modified: webservices/axis2/trunk/c/src/core/transport/http/util/http_transport_utils.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/util/http_transport_utils.c?rev=644303&r1=644302&r2=644303&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/util/http_transport_utils.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/util/http_transport_utils.c Thu Apr 3 06:11:06 2008
@@ -1,4 +1,3 @@
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -204,7 +203,7 @@
axis2_bool_t is_soap11 = AXIS2_FALSE;
axiom_xml_reader_t *xml_reader = NULL;
axutil_string_t *char_set_str = NULL;
- /*axis2_char_t *xml_char_set = NULL; */
+
axis2_conf_ctx_t *conf_ctx = NULL;
axis2_callback_info_t *callback_ctx;
axutil_hash_t *headers = NULL;
@@ -244,19 +243,19 @@
if (soap_action && (soap_action_len > 0))
{
/* remove leading and trailing " s */
- if ('"' == soap_action[0])
+ if (AXIS2_DOUBLE_QUOTE == soap_action[0])
{
memmove(soap_action, soap_action + sizeof(char),
soap_action_len - 1 + sizeof(char));
}
- if ('"' == soap_action[soap_action_len - 2])
+ if (AXIS2_DOUBLE_QUOTE == soap_action[soap_action_len - 2])
{
- soap_action[soap_action_len - 2] = '\0';
+ soap_action[soap_action_len - 2] = AXIS2_ESC_NULL;
}
}else{
/** soap action is null, check whether soap action is in content_type header */
soap_action = axis2_http_transport_utils_get_value_from_content_type(env,
- content_type, "action");
+ content_type, AXIS2_ACTION);
}
@@ -273,17 +272,20 @@
{
axis2_char_t *encoding_value = NULL;
encoding_value = axis2_http_header_get_value(encoding_header, env);
- if (encoding_value && 0 == axutil_strcasecmp(encoding_value,
- AXIS2_HTTP_HEADER_TRANSFER_ENCODING_CHUNKED))
+ if (encoding_value &&
+ 0 == axutil_strcasecmp(encoding_value,
+ AXIS2_HTTP_HEADER_TRANSFER_ENCODING_CHUNKED))
{
callback_ctx->chunked_stream =
axutil_http_chunked_stream_create(env, in_stream);
+
if (!callback_ctx->chunked_stream)
{
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error occured in"
" creating in chunked stream.");
return AXIS2_FAILURE;
}
+
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "HTTP"
" stream chunked");
}
@@ -291,6 +293,7 @@
}
else
{
+ /* Encoding header is not available */
/* check content encoding from msg ctx property */
axis2_char_t *value = axis2_msg_ctx_get_transfer_encoding(msg_ctx, env);
@@ -311,9 +314,10 @@
{
/* get mime boundry */
axis2_char_t *mime_boundary =
- axis2_http_transport_utils_get_value_from_content_type(env,
- content_type,
- AXIS2_HTTP_HEADER_CONTENT_TYPE_MIME_BOUNDARY);
+ axis2_http_transport_utils_get_value_from_content_type(
+ env,
+ content_type,
+ AXIS2_HTTP_HEADER_CONTENT_TYPE_MIME_BOUNDARY);
if (mime_boundary)
{
@@ -358,10 +362,11 @@
if (mime_parser)
{
- binary_data_map = axiom_mime_parser_parse(mime_parser, env,
- axis2_http_transport_utils_on_data_request,
- (void *) callback_ctx,
- mime_boundary);
+ binary_data_map =
+ axiom_mime_parser_parse(mime_parser, env,
+ axis2_http_transport_utils_on_data_request,
+ (void *) callback_ctx,
+ mime_boundary);
if (!binary_data_map)
{
return AXIS2_FAILURE;
@@ -387,9 +392,12 @@
AXIS2_FREE(env->allocator, mime_boundary);
}
- if(soap_action_header){
- axis2_msg_ctx_set_soap_action(msg_ctx, env, soap_action_header);
- }else if (soap_action){
+ if(soap_action_header)
+ {
+ axis2_msg_ctx_set_soap_action(msg_ctx, env, soap_action_header);
+
+ }else if (soap_action)
+ {
axutil_string_t *soap_action_str = NULL;
soap_action_str = axutil_string_create(env,soap_action);
axis2_msg_ctx_set_soap_action(msg_ctx, env, soap_action_str);
@@ -432,7 +440,6 @@
{
/* We should not be freeing om_builder here as it is done by
axiom_soap_builder_create in case of error - Samisa */
- /*axiom_stax_builder_free(om_builder, env); */
om_builder = NULL;
xml_reader = NULL;
axis2_msg_ctx_set_is_soap_11(msg_ctx, env, is_soap11);
@@ -462,7 +469,6 @@
{
/* We should not be freeing om_builder here as it is done by
axiom_soap_builder_create in case of error - Samisa */
- /*axiom_stax_builder_free(om_builder, env); */
om_builder = NULL;
xml_reader = NULL;
axis2_msg_ctx_set_is_soap_11(msg_ctx, env, is_soap11);
@@ -588,6 +594,7 @@
{
status = axis2_engine_receive(engine, env, msg_ctx);
}
+
if (!axis2_msg_ctx_get_soap_envelope(msg_ctx, env) &&
AXIS2_FALSE == is_soap11)
{
@@ -641,7 +648,7 @@
axis2_bool_t is_soap11 = AXIS2_FALSE;
axiom_xml_reader_t *xml_reader = NULL;
axutil_string_t *char_set_str = NULL;
- /*axis2_char_t *xml_char_set = NULL; */
+
axis2_conf_ctx_t *conf_ctx = NULL;
axis2_callback_info_t *callback_ctx;
axutil_hash_t *headers = NULL;
@@ -686,8 +693,9 @@
{
axis2_char_t *encoding_value = NULL;
encoding_value = axis2_http_header_get_value(encoding_header, env);
- if (encoding_value && 0 == axutil_strcasecmp(encoding_value,
- AXIS2_HTTP_HEADER_TRANSFER_ENCODING_CHUNKED))
+ if (encoding_value &&
+ 0 == axutil_strcasecmp(encoding_value,
+ AXIS2_HTTP_HEADER_TRANSFER_ENCODING_CHUNKED))
{
callback_ctx->chunked_stream =
axutil_http_chunked_stream_create(env, in_stream);
@@ -724,9 +732,10 @@
{
/* get mime boundry */
axis2_char_t *mime_boundary =
- axis2_http_transport_utils_get_value_from_content_type(env,
- content_type,
- AXIS2_HTTP_HEADER_CONTENT_TYPE_MIME_BOUNDARY);
+ axis2_http_transport_utils_get_value_from_content_type(
+ env,
+ content_type,
+ AXIS2_HTTP_HEADER_CONTENT_TYPE_MIME_BOUNDARY);
if (mime_boundary)
{
@@ -741,9 +750,10 @@
mime_parser = axiom_mime_parser_create(env);
- chunk_buffer_size_param = axis2_msg_ctx_get_parameter (msg_ctx,
- env,
- AXIS2_MTOM_CHUNK_BUFFER_SIZE);
+ chunk_buffer_size_param =
+ axis2_msg_ctx_get_parameter (msg_ctx,
+ env,
+ AXIS2_MTOM_CHUNK_BUFFER_SIZE);
if (chunk_buffer_size_param)
{
value_size =
@@ -771,10 +781,11 @@
if (mime_parser)
{
- binary_data_map = axiom_mime_parser_parse(mime_parser, env,
- axis2_http_transport_utils_on_data_request,
- (void *) callback_ctx,
- mime_boundary);
+ binary_data_map =
+ axiom_mime_parser_parse(mime_parser, env,
+ axis2_http_transport_utils_on_data_request,
+ (void *) callback_ctx,
+ mime_boundary);
if (!binary_data_map)
{
return AXIS2_FAILURE;
@@ -838,7 +849,6 @@
{
/* We should not be freeing om_builder here as it is done by
axiom_soap_builder_create in case of error - Samisa */
- /*axiom_stax_builder_free(om_builder, env); */
om_builder = NULL;
xml_reader = NULL;
axis2_msg_ctx_set_is_soap_11(msg_ctx, env, is_soap11);
@@ -1024,14 +1034,12 @@
axiom_soap_envelope_t *soap_envelope = NULL;
axis2_engine_t *engine = NULL;
axis2_bool_t do_rest = AXIS2_TRUE;
- /*xml_schema_element_t *schema_element = NULL; */
AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FALSE);
AXIS2_PARAM_CHECK(env->error, in_stream, AXIS2_FALSE);
AXIS2_PARAM_CHECK(env->error, out_stream, AXIS2_FALSE);
- /*AXIS2_PARAM_CHECK(env->error, content_type, AXIS2_FALSE); */
+
AXIS2_PARAM_CHECK(env->error, request_uri, AXIS2_FALSE);
- /*AXIS2_PARAM_CHECK(env->error, request_params, AXIS2_FALSE); */
axis2_msg_ctx_set_to(msg_ctx, env, axis2_endpoint_ref_create(env,
request_uri));
@@ -1213,25 +1221,6 @@
return AXIS2_TRUE;
}
-AXIS2_EXTERN axiom_stax_builder_t *AXIS2_CALL
-axis2_http_transport_utils_select_builder_for_mime(
- const axutil_env_t * env,
- axis2_char_t * request_uri,
- axis2_msg_ctx_t * msg_ctx,
- axutil_stream_t * in_stream,
- axis2_char_t * content_type)
-{
- return NULL;
-}
-
-AXIS2_EXTERN axis2_bool_t AXIS2_CALL
-axis2_http_transport_utils_is_optimized(
- const axutil_env_t * env,
- axiom_element_t * om_element)
-{
- return AXIS2_FALSE;
-}
-
AXIS2_EXTERN axis2_bool_t AXIS2_CALL
axis2_http_transport_utils_do_write_mtom(
const axutil_env_t * env,
@@ -1249,7 +1238,7 @@
{
axis2_char_t *query_str = NULL;
- axis2_char_t *tmp = strchr(request_uri, '?');
+ axis2_char_t *tmp = strchr(request_uri, AXIS2_Q_MARK);
axis2_char_t *tmp2 = NULL;
axis2_char_t *tmp_name = NULL;
axis2_char_t *tmp_value = NULL;
@@ -1257,24 +1246,24 @@
AXIS2_PARAM_CHECK(env->error, request_uri, NULL);
- if (!tmp || '\0' == *(tmp + 1))
+ if (!tmp || AXIS2_ESC_NULL == *(tmp + 1))
{
return NULL;
}
query_str = axutil_strdup(env, tmp + 1);
- for (tmp2 = tmp = query_str; *tmp != '\0'; ++tmp)
+ for (tmp2 = tmp = query_str; *tmp != AXIS2_ESC_NULL; ++tmp)
{
- if ('=' == *tmp)
+ if (AXIS2_EQ == *tmp)
{
- *tmp = '\0';
+ *tmp = AXIS2_ESC_NULL;
tmp_name = axutil_strdup(env, tmp2);
axis2_http_transport_utils_strdecode(env, tmp_name, tmp_name);
tmp2 = tmp + 1;
}
- if ('&' == *tmp)
+ if (AXIS2_AND == *tmp)
{
- *tmp = '\0';
+ *tmp = AXIS2_ESC_NULL;
tmp_value = axutil_strdup(env, tmp2);
axis2_http_transport_utils_strdecode(env, tmp_value, tmp_value);
tmp2 = tmp + 1;
@@ -1290,7 +1279,7 @@
tmp_value = NULL;
}
}
- if (tmp_name && '\0' != *tmp2)
+ if (tmp_name && AXIS2_ESC_NULL != *tmp2)
{
if (!ret)
{
@@ -1313,9 +1302,9 @@
AXIS2_PARAM_CHECK(env->error, dest, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, src, AXIS2_FAILURE);
- for (; *src != '\0'; ++dest, ++src)
+ for (; *src != AXIS2_ESC_NULL; ++dest, ++src)
{
- if (src[0] == '%' && isxdigit(src[1]) && isxdigit(src[2]))
+ if (src[0] == AXIS2_PERCENT && isxdigit(src[1]) && isxdigit(src[2]))
{
*dest = (axis2_char_t)(axis2_http_transport_utils_hexit(src[1]) * 16 +
axis2_http_transport_utils_hexit(src[2]));
@@ -1327,7 +1316,7 @@
*dest = *src;
}
}
- *dest = '\0';
+ *dest = AXIS2_ESC_NULL;
return AXIS2_SUCCESS;
}
@@ -1356,9 +1345,7 @@
const axutil_env_t * env,
axis2_conf_ctx_t * conf_ctx)
{
- return "<html><head><title>404 Not Found</title></head>"
- "<body><h2>Not Found</h2><p>The requested URL was not"
- " found on this server.</p></body></html>";
+ return AXIS2_HTTP_NOT_FOUND;
}
AXIS2_EXTERN axis2_char_t *AXIS2_CALL
@@ -1366,9 +1353,7 @@
const axutil_env_t * env,
axis2_conf_ctx_t * conf_ctx)
{
- return "<html><head><title>501 Not Implemented</title></head>"
- "<body><h2>Not Implemented</h2><p>The requested Method is not"
- " implemented on this server.</p></body></html>";
+ return AXIS2_HTTP_NOT_IMPLEMENTED;
}
AXIS2_EXTERN axis2_char_t *AXIS2_CALL
@@ -1376,10 +1361,7 @@
const axutil_env_t * env,
axis2_conf_ctx_t * conf_ctx)
{
- return "<html><head><title>500 Internal Server Error</title></head>"
- "<body><h2>Internal Server Error</h2><p>The server encountered an unexpected"
- " condition which prevented it from fulfilling the request."
- "</p></body></html>";
+ return AXIS2_HTTP_INTERNAL_SERVER_ERROR;
}
AXIS2_EXTERN axis2_char_t *AXIS2_CALL
@@ -1387,9 +1369,7 @@
const axutil_env_t * env,
axis2_conf_ctx_t * conf_ctx)
{
- return "<html><head><title>405 Method Not Allowed</title></head>"
- "<body><h2>Method Not Allowed</h2><p>The requested method is not"
- " allowed for this URL.</p></body></html>";
+ return AXIS2_HTTP_METHOD_NOT_ALLOWED;
}
AXIS2_EXTERN axis2_char_t *AXIS2_CALL
@@ -1397,10 +1377,7 @@
const axutil_env_t * env,
axis2_conf_ctx_t * conf_ctx)
{
- return "<html><head><title>406 Not Acceptable</title></head>"
- "<body><h2>Not Acceptable</h2><p>An appropriate representation of"
- " the requested resource could not be found on this server."
- "</p></body></html>";
+ return AXIS2_HTTP_NOT_ACCEPTABLE;
}
AXIS2_EXTERN axis2_char_t *AXIS2_CALL
@@ -1408,9 +1385,7 @@
const axutil_env_t * env,
axis2_conf_ctx_t * conf_ctx)
{
- return "<html><head><title>400 Bad Request</title></head>"
- "<body><h2>Bad Request</h2><p>Your client sent a request that this"
- " server could not understand.</p></body></html>";
+ return AXIS2_HTTP_BAD_REQUEST;
}
AXIS2_EXTERN axis2_char_t *AXIS2_CALL
@@ -1418,9 +1393,7 @@
const axutil_env_t * env,
axis2_conf_ctx_t * conf_ctx)
{
- return "<html><head><title>408 Request Timeout</title></head>"
- "<body><h2>Request Timeout</h2><p>Cannot wait any longer for the HTTP request"
- " from the client.</p></body></html>";
+ return AXIS2_HTTP_REQUEST_TIMEOUT;
}
AXIS2_EXTERN axis2_char_t *AXIS2_CALL
@@ -1428,9 +1401,7 @@
const axutil_env_t * env,
axis2_conf_ctx_t * conf_ctx)
{
- return "<html><head><title>409 Conflict</title></head>"
- "<body><h2>Conflict</h2><p>The client attempted to put the server's"
- " resources into an invalid state.</p></body></html>";
+ return AXIS2_HTTP_CONFLICT;
}
AXIS2_EXTERN axis2_char_t *AXIS2_CALL
@@ -1438,9 +1409,7 @@
const axutil_env_t * env,
axis2_conf_ctx_t * conf_ctx)
{
- return "<html><head><title>410 Gone</title></head>"
- "<body><h2>Gone</h2><p>The requested resource is no longer"
- " available on this server.</p></body></html>";
+ return AXIS2_HTTP_GONE;
}
AXIS2_EXTERN axis2_char_t *AXIS2_CALL
@@ -1448,9 +1417,7 @@
const axutil_env_t * env,
axis2_conf_ctx_t * conf_ctx)
{
- return "<html><head><title>412 Precondition Failed</title></head>"
- "<body><h2>Precondition Failed</h2><p>A precondition for the requested URL"
- " failed.</p></body></html>";
+ return AXIS2_HTTP_PRECONDITION_FAILED;
}
AXIS2_EXTERN axis2_char_t *AXIS2_CALL
@@ -1458,10 +1425,7 @@
const axutil_env_t * env,
axis2_conf_ctx_t * conf_ctx)
{
- return "<html><head><title>413 Request Entity Too Large</title></head>"
- "<body><h2>Request Entity Too Large</h2><p>The data provided in the request"
- " is too large or the requested resource does not allow request data."
- "</p></body></html>";
+ return AXIS2_HTTP_TOO_LARGE;
}
AXIS2_EXTERN axis2_char_t *AXIS2_CALL
@@ -1469,11 +1433,10 @@
const axutil_env_t * env,
axis2_conf_ctx_t * conf_ctx)
{
- return "<html><head><title>503 Service Unavailable</title></head>"
- "<body><h2>Service Unavailable</h2><p>The service is temporarily unable"
- " to serve your request.</p></body></html>";
+ return AXIS2_HTTP_SERVICE_UNAVILABLE;
}
+
AXIS2_EXTERN axis2_char_t *AXIS2_CALL
axis2_http_transport_utils_get_services_html(
const axutil_env_t * env,
@@ -1540,7 +1503,9 @@
hi2 = axutil_hash_next(env, hi2))
{
axutil_hash_this(hi2, NULL, NULL, &op);
- oname = axutil_qname_get_localpart(axis2_op_get_qname(((axis2_op_t *) op), env), env);
+ oname = axutil_qname_get_localpart(
+ axis2_op_get_qname(((axis2_op_t *) op), env),
+ env);
ret = axutil_stracat(env, tmp2, "<li>");
AXIS2_FREE(env->allocator, tmp2);
tmp2 = ret;
@@ -1559,11 +1524,11 @@
else
{
ret = axutil_stracat(env, tmp2, "No operations Available");
- /*AXIS2_FREE(env->allocator, tmp); */
tmp2 = ret;
}
}
}
+
if (errorneous_svc_map && 0 != axutil_hash_count(errorneous_svc_map))
{
void *fsname = NULL;
@@ -1687,11 +1652,10 @@
AXIS2_FREE(env->allocator, content);
content = tmp;
}
- /*sprintf(&content[i++], "%c", c);*/
content[i++] = (axis2_char_t)c;
c = fgetc(wsdl_file);
}
- content[i] = '\0';
+ content[i] = AXIS2_ESC_NULL;
wsdl_string = (axis2_char_t *)content;
}
AXIS2_FREE(env->allocator, wsdl_path);
@@ -1728,10 +1692,10 @@
if (tmp)
{
- tmp = strchr(tmp, '=');
+ tmp = strchr(tmp, AXIS2_EQ);
if (tmp)
{
- tmp2 = strchr(tmp, ';');
+ tmp2 = strchr(tmp, AXIS2_SEMI_COLON);
if (!tmp2)
{
tmp2 = tmp + strlen(tmp);
@@ -1745,7 +1709,7 @@
{
tmp2 -= sizeof(axis2_char_t);
}
- *tmp2 = '\0';
+ *tmp2 = AXIS2_ESC_NULL;
}
}
@@ -1757,9 +1721,8 @@
* charset=UTF-8
* But for our requirements charset we get should be UTF-8
*/
- if ('\'' == *(tmp + sizeof(axis2_char_t)) || '\"' == *(tmp +
- sizeof
- (axis2_char_t)))
+ if (AXIS2_ESC_SINGLE_QUOTE == *(tmp + sizeof(axis2_char_t)) ||
+ AXIS2_ESC_DOUBLE_QUOTE == *(tmp + sizeof(axis2_char_t)))
{
tmp += 2 * sizeof(axis2_char_t);
}
@@ -1810,7 +1773,7 @@
buffer, size);
if (len >= 0)
{
- buffer[len] = '\0';
+ buffer[len] = AXIS2_ESC_NULL;
}
}
else
@@ -1822,7 +1785,7 @@
len = axutil_stream_read(in_stream, env, buffer, size);
if (len >= 0)
{
- buffer[len] = '\0';
+ buffer[len] = AXIS2_ESC_NULL;
((axis2_callback_info_t *) ctx)->unread_len -= len;
}
}
@@ -1860,7 +1823,7 @@
as this is passed on to the reader */
if (!callback_ctx)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
callback_ctx->in_stream = in_stream;
@@ -1883,8 +1846,8 @@
}
if (!in_stream)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NULL_IN_STREAM_IN_MSG_CTX,
- AXIS2_FAILURE);
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_NULL_IN_STREAM_IN_MSG_CTX,
+ AXIS2_FAILURE);
AXIS2_FREE(env->allocator, callback_ctx);
return NULL;
}
@@ -1925,6 +1888,7 @@
}
}
+
if (!char_set_enc)
{
char_set_enc = AXIS2_DEFAULT_CHAR_SET_ENCODING;
@@ -1935,9 +1899,10 @@
axis2_msg_ctx_set_doing_mtom(msg_ctx, env, AXIS2_TRUE);
/* get mime boundry */
mime_boundary =
- axis2_http_transport_utils_get_value_from_content_type(env,
- content_type,
- AXIS2_HTTP_HEADER_CONTENT_TYPE_MIME_BOUNDARY);
+ axis2_http_transport_utils_get_value_from_content_type(
+ env,
+ content_type,
+ AXIS2_HTTP_HEADER_CONTENT_TYPE_MIME_BOUNDARY);
if (mime_boundary)
{
@@ -1954,13 +1919,15 @@
mime_parser = axiom_mime_parser_create(env);
- chunk_buffer_size_param = axis2_msg_ctx_get_parameter (msg_ctx,
- env,
- AXIS2_MTOM_CHUNK_BUFFER_SIZE);
+ chunk_buffer_size_param =
+ axis2_msg_ctx_get_parameter (msg_ctx,
+ env,
+ AXIS2_MTOM_CHUNK_BUFFER_SIZE);
if (chunk_buffer_size_param)
{
value_size =
(axis2_char_t *) axutil_param_get_value (chunk_buffer_size_param, env);
+
if(value_size)
{
size = atoi(value_size);
@@ -1969,8 +1936,8 @@
}
max_chunk_buffers_param = axis2_msg_ctx_get_parameter (msg_ctx,
- env,
- AXIS2_MTOM_MAX_CHUNK_BUFFERS);
+ env,
+ AXIS2_MTOM_MAX_CHUNK_BUFFERS);
if(max_chunk_buffers_param)
{
value_num =
@@ -1984,10 +1951,11 @@
if (mime_parser)
{
- binary_data_map = axiom_mime_parser_parse(mime_parser, env,
- axis2_http_transport_utils_on_data_request,
- (void *) callback_ctx,
- mime_boundary);
+ binary_data_map =
+ axiom_mime_parser_parse(mime_parser, env,
+ axis2_http_transport_utils_on_data_request,
+ (void *) callback_ctx,
+ mime_boundary);
if(!binary_data_map)
{
return NULL;
@@ -2020,10 +1988,11 @@
axiom_stax_builder_t *om_builder = NULL;
axiom_soap_builder_t *soap_builder = NULL;
- xml_reader = axiom_xml_reader_create_for_io(env,
- axis2_http_transport_utils_on_data_request,
- NULL, (void *) callback_ctx,
- char_set_enc);
+ xml_reader =
+ axiom_xml_reader_create_for_io(env,
+ axis2_http_transport_utils_on_data_request,
+ NULL, (void *) callback_ctx,
+ char_set_enc);
if (!xml_reader)
{
return NULL;
@@ -2040,7 +2009,6 @@
{
/* We should not be freeing om_builder here as it is done by
axiom_soap_builder_create in case of error - Samisa */
- /*axiom_stax_builder_free(om_builder, env); */
om_builder = NULL;
xml_reader = NULL;
return NULL;
@@ -2068,16 +2036,18 @@
}
else
{
+ /* REST processing */
axiom_xml_reader_t *xml_reader = NULL;
axiom_stax_builder_t *om_builder = NULL;
axiom_soap_body_t *def_body = NULL;
axiom_document_t *om_doc = NULL;
axiom_node_t *root_node = NULL;
- xml_reader = axiom_xml_reader_create_for_io(env,
- axis2_http_transport_utils_on_data_request,
- NULL, (void *) callback_ctx,
- char_set_enc);
+ xml_reader =
+ axiom_xml_reader_create_for_io(env,
+ axis2_http_transport_utils_on_data_request,
+ NULL, (void *) callback_ctx,
+ char_set_enc);
if (!xml_reader)
{
return NULL;
@@ -2125,26 +2095,27 @@
return NULL;
}
- tmp = strchr(tmp, '=');
- tmp2 = strchr(tmp, ';');
+ tmp = strchr(tmp, AXIS2_EQ);
+ tmp2 = strchr(tmp, AXIS2_SEMI_COLON);
if (tmp2)
{
- *tmp2 = '\0';
+ *tmp2 = AXIS2_ESC_NULL;
}
if (!tmp)
{
AXIS2_FREE(env->allocator, tmp_content_type);
return NULL;
}
+
tmp2 = axutil_strdup(env, tmp + 1);
AXIS2_FREE(env->allocator, tmp_content_type);
- if (*tmp2 == '"')
+ if (*tmp2 == AXIS2_DOUBLE_QUOTE)
{
tmp = tmp2;
tmp2 = axutil_strdup(env, tmp + 1);
- tmp2[strlen(tmp2) - 1] = '\0';
+ tmp2[strlen(tmp2) - 1] = AXIS2_ESC_NULL;
}
return tmp2;
}
@@ -2176,8 +2147,8 @@
soap_body = axiom_soap_envelope_get_body(soap_env, env);
if (!soap_body)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_SOAP_ENVELOPE_OR_SOAP_BODY_NULL,
- AXIS2_FAILURE);
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_SOAP_ENVELOPE_OR_SOAP_BODY_NULL,
+ AXIS2_FAILURE);
return NULL;
}
@@ -2222,6 +2193,7 @@
return soap_env;
}
+
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_http_transport_utils_dispatch_and_verify(
const axutil_env_t * env,
@@ -2242,8 +2214,8 @@
if (!axis2_msg_ctx_get_svc(msg_ctx, env) ||
!axis2_msg_ctx_get_op(msg_ctx, env))
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_SVC_OR_OP_NOT_FOUND,
- AXIS2_FAILURE);
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_SVC_OR_OP_NOT_FOUND,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
}
@@ -2256,8 +2228,8 @@
if (!axis2_msg_ctx_get_svc(msg_ctx, env) ||
!axis2_msg_ctx_get_op(msg_ctx, env))
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_SVC_OR_OP_NOT_FOUND,
- AXIS2_FAILURE);
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_SVC_OR_OP_NOT_FOUND,
+ AXIS2_FAILURE);
return AXIS2_FAILURE;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org