axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sen...@apache.org
Subject svn commit: r638980 - in /webservices/axis2/trunk/c: include/axis2_http_transport.h include/axis2_http_transport_utils.h src/core/transport/http/common/http_worker.c src/core/transport/http/util/http_transport_utils.c
Date Wed, 19 Mar 2008 19:42:01 GMT
Author: senaka
Date: Wed Mar 19 12:41:58 2008
New Revision: 638980

URL: http://svn.apache.org/viewvc?rev=638980&view=rev
Log:
Improving HTTP Status Code support

Modified:
    webservices/axis2/trunk/c/include/axis2_http_transport.h
    webservices/axis2/trunk/c/include/axis2_http_transport_utils.h
    webservices/axis2/trunk/c/src/core/transport/http/common/http_worker.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=638980&r1=638979&r2=638980&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_http_transport.h (original)
+++ webservices/axis2/trunk/c/include/axis2_http_transport.h Wed Mar 19 12:41:58 2008
@@ -80,17 +80,57 @@
      */
 #define AXIS2_HTTP_RESPONSE_OK_CODE_VAL 200
 
+    /*
+     * RESPONSE_CREATED_CODE_VAL
+     */
+#define AXIS2_HTTP_RESPONSE_CREATED_CODE_VAL 201
+
     /**
      * RESPONSE_ACK_CODE_VAL
      */
 #define AXIS2_HTTP_RESPONSE_ACK_CODE_VAL 202
 
     /**
+     * RESPONSE_NON_AUTHORITATIVE_INFO_CODE_VAL
+     */
+#define AXIS2_HTTP_RESPONSE_NON_AUTHORITATIVE_INFO_CODE_VAL 203
+
+    /**
      * RESPONSE_NO_CONTENT_CODE_VAL
      */
 #define AXIS2_HTTP_RESPONSE_NO_CONTENT_CODE_VAL 204
 
     /**
+     * RESPONSE_RESET_CONTENT_CODE_VAL
+     */
+#define AXIS2_HTTP_RESPONSE_RESET_CONTENT_CODE_VAL 205
+
+    /**
+     * RESPONSE_MULTIPLE_CHOICES_CODE_VAL
+     */
+#define AXIS2_HTTP_RESPONSE_MULTIPLE_CHOICES_CODE_VAL 300
+
+    /**
+     * RESPONSE_MOVED_PERMANENTLY_CODE_VAL
+     */
+#define AXIS2_HTTP_RESPONSE_MOVED_PERMANENTLY_CODE_VAL 301
+
+    /**
+     * RESPONSE_SEE_OTHER_CODE_VAL
+     */
+#define AXIS2_HTTP_RESPONSE_SEE_OTHER_CODE_VAL 303
+
+    /**
+     * RESPONSE_NOT_MODIFIED_CODE_VAL
+     */
+#define AXIS2_HTTP_RESPONSE_NOT_MODIFIED_CODE_VAL 304
+
+    /**
+     * RESPONSE_TEMPORARY_REDIRECT_CODE_VAL
+     */
+#define AXIS2_HTTP_RESPONSE_TEMPORARY_REDIRECT_CODE_VAL 307
+
+    /**
      * RESPONSE_BAD_REQUEST_CODE_VAL
      */
 #define AXIS2_HTTP_RESPONSE_BAD_REQUEST_CODE_VAL 400
@@ -121,11 +161,36 @@
 #define AXIS2_HTTP_RESPONSE_PROXY_AUTHENTICATION_REQUIRED_CODE_VAL 407
 
     /**
+     * RESPONSE_REQUEST_TIMEOUT_CODE_VAL
+     */
+#define AXIS2_HTTP_RESPONSE_REQUEST_TIMEOUT_CODE_VAL 408
+
+    /**
+     * RESPONSE_CONFLICT_CODE_VAL
+     */
+#define AXIS2_HTTP_RESPONSE_CONFLICT_CODE_VAL 409
+
+    /**
+     * RESPONSE_GONE_CODE_VAL
+     */
+#define AXIS2_HTTP_RESPONSE_GONE_CODE_VAL 410
+
+    /**
      * RESPONSE_LENGTH_REQUIRED_CODE_VAL
      */
 #define AXIS2_HTTP_RESPONSE_LENGTH_REQUIRED_CODE_VAL 411
 
     /**
+     * RESPONSE_PRECONDITION_FAILED_CODE_VAL
+     */
+#define AXIS2_HTTP_RESPONSE_PRECONDITION_FAILED_CODE_VAL 412
+
+    /**
+     * RESPONSE_REQUEST_ENTITY_TOO_LARGE_CODE_VAL
+     */
+#define AXIS2_HTTP_RESPONSE_REQUEST_ENTITY_TOO_LARGE_CODE_VAL 413
+
+    /**
      * RESPONSE_INTERNAL_SERVER_ERROR_CODE_VAL
      */
 #define AXIS2_HTTP_RESPONSE_INTERNAL_SERVER_ERROR_CODE_VAL 500
@@ -136,6 +201,11 @@
 #define AXIS2_HTTP_RESPONSE_NOT_IMPLEMENTED_CODE_VAL 501
 
     /**
+     * RESPONSE_SERVICE_UNAVAILABLE_CODE_VAL
+     */
+#define AXIS2_HTTP_RESPONSE_SERVICE_UNAVAILABLE_CODE_VAL 503
+
+    /**
      * RESPONSE_CONTINUE_CODE_NAME
      */
 #define AXIS2_HTTP_RESPONSE_CONTINUE_CODE_NAME "Continue"
@@ -145,6 +215,11 @@
      */
 #define AXIS2_HTTP_RESPONSE_OK_CODE_NAME "OK"
 
+    /*
+     * RESPONSE_CREATED_CODE_NAME
+     */
+#define AXIS2_HTTP_RESPONSE_CREATED_CODE_NAME "Created"
+
     /**
      * RESPONSE_ACK_CODE_NAME
      */
@@ -156,6 +231,41 @@
 #define AXIS2_HTTP_RESPONSE_NO_CONTENT_CODE_NAME "No Content"
 
     /**
+     * RESPONSE_NON_AUTHORITATIVE_INFO_CODE_NAME
+     */
+#define AXIS2_HTTP_RESPONSE_NON_AUTHORITATIVE_INFO_CODE_NAME "Non-Authoritative Information"
+
+    /**
+     * RESPONSE_RESET_CONTENT_CODE_NAME
+     */
+#define AXIS2_HTTP_RESPONSE_RESET_CONTENT_CODE_NAME "Reset Content"
+
+    /**
+     * RESPONSE_MULTIPLE_CHOICES_CODE_NAME
+     */
+#define AXIS2_HTTP_RESPONSE_MULTIPLE_CHOICES_CODE_NAME "Multiple Choices"
+
+    /**
+     * RESPONSE_MOVED_PERMANENTLY_CODE_NAME
+     */
+#define AXIS2_HTTP_RESPONSE_MOVED_PERMANENTLY_CODE_NAME "Moved Permanently"
+
+    /**
+     * RESPONSE_SEE_OTHER_CODE_NAME
+     */
+#define AXIS2_HTTP_RESPONSE_SEE_OTHER_CODE_NAME "See Other"
+
+    /**
+     * RESPONSE_NOT_MODIFIED_CODE_NAME
+     */
+#define AXIS2_HTTP_RESPONSE_NOT_MODIFIED_CODE_NAME "Not Modified"
+
+    /**
+     * RESPONSE_TEMPORARY_REDIRECT_CODE_NAME
+     */
+#define AXIS2_HTTP_RESPONSE_TEMPORARY_REDIRECT_CODE_NAME "Temporary Redirect"
+
+    /**
      * RESPONSE_BAD_REQUEST_CODE_NAME
      */
 #define AXIS2_HTTP_RESPONSE_BAD_REQUEST_CODE_NAME "Bad Request"
@@ -186,11 +296,36 @@
 #define AXIS2_HTTP_RESPONSE_PROXY_AUTHENTICATION_REQUIRED_CODE_NAME "Proxy Authentication
Required"
 
     /**
+     * RESPONSE_REQUEST_TIMEOUT_CODE_NAME
+     */
+#define AXIS2_HTTP_RESPONSE_REQUEST_TIMEOUT_CODE_NAME "Request Timeout"
+
+    /**
+     * RESPONSE_CONFLICT_CODE_NAME
+     */
+#define AXIS2_HTTP_RESPONSE_CONFLICT_CODE_NAME "Conflict"
+
+    /**
+     * RESPONSE_GONE_CODE_NAME
+     */
+#define AXIS2_HTTP_RESPONSE_GONE_CODE_NAME "Gone"
+
+    /**
      * RESPONSE_LENGTH_REQUIRED_CODE_NAME
      */
 #define AXIS2_HTTP_RESPONSE_LENGTH_REQUIRED_CODE_NAME "Length Required"
 
     /**
+     * RESPONSE_PRECONDITION_FAILED_CODE_NAME
+     */
+#define AXIS2_HTTP_RESPONSE_PRECONDITION_FAILED_CODE_NAME "Precondition Failed"
+
+    /**
+     * RESPONSE_REQUEST_ENTITY_TOO_LARGE_CODE_NAME
+     */
+#define AXIS2_HTTP_RESPONSE_REQUEST_ENTITY_TOO_LARGE_CODE_NAME "Request Entity Too Large"
+
+    /**
      * RESPONSE_INTERNAL_SERVER_ERROR_CODE_NAME
      */
 #define AXIS2_HTTP_RESPONSE_INTERNAL_SERVER_ERROR_CODE_NAME "Internal Server Error"
@@ -199,6 +334,11 @@
      * RESPONSE_NOT_IMPLEMENTED_CODE_NAME
      */
 #define AXIS2_HTTP_RESPONSE_NOT_IMPLEMENTED_CODE_NAME "Not Implemented"
+
+    /**
+     * RESPONSE_SERVICE_UNAVAILABLE_CODE_NAME
+     */
+#define AXIS2_HTTP_RESPONSE_SERVICE_UNAVAILABLE_CODE_NAME "Service Unavailable"
 
     /**
      * SOCKET

Modified: webservices/axis2/trunk/c/include/axis2_http_transport_utils.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_http_transport_utils.h?rev=638980&r1=638979&r2=638980&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_http_transport_utils.h (original)
+++ webservices/axis2/trunk/c/include/axis2_http_transport_utils.h Wed Mar 19 12:41:58 2008
@@ -166,6 +166,41 @@
         axis2_conf_ctx_t * conf_ctx);
 
     AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+    axis2_http_transport_utils_get_bad_request(
+        const axutil_env_t * env,
+        axis2_conf_ctx_t * conf_ctx);
+
+    AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+    axis2_http_transport_utils_get_request_timeout(
+        const axutil_env_t * env,
+        axis2_conf_ctx_t * conf_ctx);
+
+    AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+    axis2_http_transport_utils_get_conflict(
+        const axutil_env_t * env,
+        axis2_conf_ctx_t * conf_ctx);
+
+    AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+    axis2_http_transport_utils_get_gone(
+        const axutil_env_t * env,
+        axis2_conf_ctx_t * conf_ctx);
+
+    AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+    axis2_http_transport_utils_get_precondition_failed(
+        const axutil_env_t * env,
+        axis2_conf_ctx_t * conf_ctx);
+
+    AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+    axis2_http_transport_utils_get_request_entity_too_large(
+        const axutil_env_t * env,
+        axis2_conf_ctx_t * conf_ctx);
+
+    AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+    axis2_http_transport_utils_get_service_unavailable(
+        const axutil_env_t * env,
+        axis2_conf_ctx_t * conf_ctx);
+
+    AXIS2_EXTERN axis2_char_t *AXIS2_CALL
     axis2_http_transport_utils_get_internal_server_error(
         const axutil_env_t * env,
         axis2_conf_ctx_t * conf_ctx);

Modified: webservices/axis2/trunk/c/src/core/transport/http/common/http_worker.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/common/http_worker.c?rev=638980&r1=638979&r2=638980&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/common/http_worker.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/common/http_worker.c Wed Mar 19 12:41:58
2008
@@ -633,6 +633,111 @@
                                                      AXIS2_HTTP_HEADER_ACCEPT_TEXT_HTML);
                 axis2_http_simple_response_set_header(response, env, cont_type);
             }
+            else if (axis2_msg_ctx_get_status_code(msg_ctx, env) == 
+                AXIS2_HTTP_RESPONSE_BAD_REQUEST_CODE_VAL)
+            {
+                axis2_http_simple_response_set_status_line(response, env,
+                                                           http_version,
+                                                           AXIS2_HTTP_RESPONSE_BAD_REQUEST_CODE_VAL,
+                                                           AXIS2_HTTP_RESPONSE_BAD_REQUEST_CODE_NAME);
+
+                body_string = axis2_http_transport_utils_get_bad_request(env,
+                                                                         conf_ctx);
+                cont_type = axis2_http_header_create(env,
+                                                     AXIS2_HTTP_HEADER_CONTENT_TYPE,
+                                                     AXIS2_HTTP_HEADER_ACCEPT_TEXT_HTML);
+                axis2_http_simple_response_set_header(response, env, cont_type);
+            }
+            else if (axis2_msg_ctx_get_status_code(msg_ctx, env) == 
+                AXIS2_HTTP_RESPONSE_REQUEST_TIMEOUT_CODE_VAL)
+            {
+                axis2_http_simple_response_set_status_line(response, env,
+                                                           http_version,
+                                                           AXIS2_HTTP_RESPONSE_REQUEST_TIMEOUT_CODE_VAL,
+                                                           AXIS2_HTTP_RESPONSE_REQUEST_TIMEOUT_CODE_NAME);
+
+                body_string = axis2_http_transport_utils_get_request_timeout(env,
+                                                                             conf_ctx);
+                cont_type = axis2_http_header_create(env,
+                                                     AXIS2_HTTP_HEADER_CONTENT_TYPE,
+                                                     AXIS2_HTTP_HEADER_ACCEPT_TEXT_HTML);
+                axis2_http_simple_response_set_header(response, env, cont_type);
+            }
+            else if (axis2_msg_ctx_get_status_code(msg_ctx, env) == 
+                AXIS2_HTTP_RESPONSE_CONFLICT_CODE_VAL)
+            {
+                axis2_http_simple_response_set_status_line(response, env,
+                                                           http_version,
+                                                           AXIS2_HTTP_RESPONSE_CONFLICT_CODE_VAL,
+                                                           AXIS2_HTTP_RESPONSE_CONFLICT_CODE_NAME);
+
+                body_string = axis2_http_transport_utils_get_conflict(env,
+                                                                      conf_ctx);
+                cont_type = axis2_http_header_create(env,
+                                                     AXIS2_HTTP_HEADER_CONTENT_TYPE,
+                                                     AXIS2_HTTP_HEADER_ACCEPT_TEXT_HTML);
+                axis2_http_simple_response_set_header(response, env, cont_type);
+            }
+            else if (axis2_msg_ctx_get_status_code(msg_ctx, env) == 
+                AXIS2_HTTP_RESPONSE_GONE_CODE_VAL)
+            {
+                axis2_http_simple_response_set_status_line(response, env,
+                                                           http_version,
+                                                           AXIS2_HTTP_RESPONSE_GONE_CODE_VAL,
+                                                           AXIS2_HTTP_RESPONSE_GONE_CODE_NAME);
+
+                body_string = axis2_http_transport_utils_get_gone(env,
+                                                                  conf_ctx);
+                cont_type = axis2_http_header_create(env,
+                                                     AXIS2_HTTP_HEADER_CONTENT_TYPE,
+                                                     AXIS2_HTTP_HEADER_ACCEPT_TEXT_HTML);
+                axis2_http_simple_response_set_header(response, env, cont_type);
+            }
+            else if (axis2_msg_ctx_get_status_code(msg_ctx, env) == 
+                AXIS2_HTTP_RESPONSE_PRECONDITION_FAILED_CODE_VAL)
+            {
+                axis2_http_simple_response_set_status_line(response, env,
+                                                           http_version,
+                                                           AXIS2_HTTP_RESPONSE_PRECONDITION_FAILED_CODE_VAL,
+                                                           AXIS2_HTTP_RESPONSE_PRECONDITION_FAILED_CODE_NAME);
+
+                body_string = axis2_http_transport_utils_get_precondition_failed(env,
+                                                                                 conf_ctx);
+                cont_type = axis2_http_header_create(env,
+                                                     AXIS2_HTTP_HEADER_CONTENT_TYPE,
+                                                     AXIS2_HTTP_HEADER_ACCEPT_TEXT_HTML);
+                axis2_http_simple_response_set_header(response, env, cont_type);
+            }
+            else if (axis2_msg_ctx_get_status_code(msg_ctx, env) == 
+                AXIS2_HTTP_RESPONSE_REQUEST_ENTITY_TOO_LARGE_CODE_VAL)
+            {
+                axis2_http_simple_response_set_status_line(response, env,
+                                                           http_version,
+                                                           AXIS2_HTTP_RESPONSE_REQUEST_ENTITY_TOO_LARGE_CODE_VAL,
+                                                           AXIS2_HTTP_RESPONSE_REQUEST_ENTITY_TOO_LARGE_CODE_NAME);
+
+                body_string = axis2_http_transport_utils_get_request_entity_too_large(env,
+                                                                                      conf_ctx);
+                cont_type = axis2_http_header_create(env,
+                                                     AXIS2_HTTP_HEADER_CONTENT_TYPE,
+                                                     AXIS2_HTTP_HEADER_ACCEPT_TEXT_HTML);
+                axis2_http_simple_response_set_header(response, env, cont_type);
+            }
+            else if (axis2_msg_ctx_get_status_code(msg_ctx, env) == 
+                AXIS2_HTTP_RESPONSE_SERVICE_UNAVAILABLE_CODE_VAL)
+            {
+                axis2_http_simple_response_set_status_line(response, env,
+                                                           http_version,
+                                                           AXIS2_HTTP_RESPONSE_SERVICE_UNAVAILABLE_CODE_VAL,
+                                                           AXIS2_HTTP_RESPONSE_SERVICE_UNAVAILABLE_CODE_NAME);
+
+                body_string = axis2_http_transport_utils_get_service_unavailable(env,
+                                                                      conf_ctx);
+                cont_type = axis2_http_header_create(env,
+                                                     AXIS2_HTTP_HEADER_CONTENT_TYPE,
+                                                     AXIS2_HTTP_HEADER_ACCEPT_TEXT_HTML);
+                axis2_http_simple_response_set_header(response, env, cont_type);
+            }
             else
             {
                 axis2_http_simple_response_set_status_line(response, env,
@@ -750,6 +855,111 @@
                                                      AXIS2_HTTP_HEADER_ACCEPT_TEXT_HTML);
                 axis2_http_simple_response_set_header(response, env, cont_type);
             }
+            else if (axis2_msg_ctx_get_status_code(msg_ctx, env) == 
+                AXIS2_HTTP_RESPONSE_BAD_REQUEST_CODE_VAL)
+            {
+                axis2_http_simple_response_set_status_line(response, env,
+                                                           http_version,
+                                                           AXIS2_HTTP_RESPONSE_BAD_REQUEST_CODE_VAL,
+                                                           AXIS2_HTTP_RESPONSE_BAD_REQUEST_CODE_NAME);
+
+                body_string = axis2_http_transport_utils_get_bad_request(env,
+                                                                         conf_ctx);
+                cont_type = axis2_http_header_create(env,
+                                                     AXIS2_HTTP_HEADER_CONTENT_TYPE,
+                                                     AXIS2_HTTP_HEADER_ACCEPT_TEXT_HTML);
+                axis2_http_simple_response_set_header(response, env, cont_type);
+            }
+            else if (axis2_msg_ctx_get_status_code(msg_ctx, env) == 
+                AXIS2_HTTP_RESPONSE_REQUEST_TIMEOUT_CODE_VAL)
+            {
+                axis2_http_simple_response_set_status_line(response, env,
+                                                           http_version,
+                                                           AXIS2_HTTP_RESPONSE_REQUEST_TIMEOUT_CODE_VAL,
+                                                           AXIS2_HTTP_RESPONSE_REQUEST_TIMEOUT_CODE_NAME);
+
+                body_string = axis2_http_transport_utils_get_request_timeout(env,
+                                                                             conf_ctx);
+                cont_type = axis2_http_header_create(env,
+                                                     AXIS2_HTTP_HEADER_CONTENT_TYPE,
+                                                     AXIS2_HTTP_HEADER_ACCEPT_TEXT_HTML);
+                axis2_http_simple_response_set_header(response, env, cont_type);
+            }
+            else if (axis2_msg_ctx_get_status_code(msg_ctx, env) == 
+                AXIS2_HTTP_RESPONSE_CONFLICT_CODE_VAL)
+            {
+                axis2_http_simple_response_set_status_line(response, env,
+                                                           http_version,
+                                                           AXIS2_HTTP_RESPONSE_CONFLICT_CODE_VAL,
+                                                           AXIS2_HTTP_RESPONSE_CONFLICT_CODE_NAME);
+
+                body_string = axis2_http_transport_utils_get_conflict(env,
+                                                                      conf_ctx);
+                cont_type = axis2_http_header_create(env,
+                                                     AXIS2_HTTP_HEADER_CONTENT_TYPE,
+                                                     AXIS2_HTTP_HEADER_ACCEPT_TEXT_HTML);
+                axis2_http_simple_response_set_header(response, env, cont_type);
+            }
+            else if (axis2_msg_ctx_get_status_code(msg_ctx, env) == 
+                AXIS2_HTTP_RESPONSE_GONE_CODE_VAL)
+            {
+                axis2_http_simple_response_set_status_line(response, env,
+                                                           http_version,
+                                                           AXIS2_HTTP_RESPONSE_GONE_CODE_VAL,
+                                                           AXIS2_HTTP_RESPONSE_GONE_CODE_NAME);
+
+                body_string = axis2_http_transport_utils_get_gone(env,
+                                                                  conf_ctx);
+                cont_type = axis2_http_header_create(env,
+                                                     AXIS2_HTTP_HEADER_CONTENT_TYPE,
+                                                     AXIS2_HTTP_HEADER_ACCEPT_TEXT_HTML);
+                axis2_http_simple_response_set_header(response, env, cont_type);
+            }
+            else if (axis2_msg_ctx_get_status_code(msg_ctx, env) == 
+                AXIS2_HTTP_RESPONSE_PRECONDITION_FAILED_CODE_VAL)
+            {
+                axis2_http_simple_response_set_status_line(response, env,
+                                                           http_version,
+                                                           AXIS2_HTTP_RESPONSE_PRECONDITION_FAILED_CODE_VAL,
+                                                           AXIS2_HTTP_RESPONSE_PRECONDITION_FAILED_CODE_NAME);
+
+                body_string = axis2_http_transport_utils_get_precondition_failed(env,
+                                                                                 conf_ctx);
+                cont_type = axis2_http_header_create(env,
+                                                     AXIS2_HTTP_HEADER_CONTENT_TYPE,
+                                                     AXIS2_HTTP_HEADER_ACCEPT_TEXT_HTML);
+                axis2_http_simple_response_set_header(response, env, cont_type);
+            }
+            else if (axis2_msg_ctx_get_status_code(msg_ctx, env) == 
+                AXIS2_HTTP_RESPONSE_REQUEST_ENTITY_TOO_LARGE_CODE_VAL)
+            {
+                axis2_http_simple_response_set_status_line(response, env,
+                                                           http_version,
+                                                           AXIS2_HTTP_RESPONSE_REQUEST_ENTITY_TOO_LARGE_CODE_VAL,
+                                                           AXIS2_HTTP_RESPONSE_REQUEST_ENTITY_TOO_LARGE_CODE_NAME);
+
+                body_string = axis2_http_transport_utils_get_request_entity_too_large(env,
+                                                                                      conf_ctx);
+                cont_type = axis2_http_header_create(env,
+                                                     AXIS2_HTTP_HEADER_CONTENT_TYPE,
+                                                     AXIS2_HTTP_HEADER_ACCEPT_TEXT_HTML);
+                axis2_http_simple_response_set_header(response, env, cont_type);
+            }
+            else if (axis2_msg_ctx_get_status_code(msg_ctx, env) == 
+                AXIS2_HTTP_RESPONSE_SERVICE_UNAVAILABLE_CODE_VAL)
+            {
+                axis2_http_simple_response_set_status_line(response, env,
+                                                           http_version,
+                                                           AXIS2_HTTP_RESPONSE_SERVICE_UNAVAILABLE_CODE_VAL,
+                                                           AXIS2_HTTP_RESPONSE_SERVICE_UNAVAILABLE_CODE_NAME);
+
+                body_string = axis2_http_transport_utils_get_service_unavailable(env,
+                                                                      conf_ctx);
+                cont_type = axis2_http_header_create(env,
+                                                     AXIS2_HTTP_HEADER_CONTENT_TYPE,
+                                                     AXIS2_HTTP_HEADER_ACCEPT_TEXT_HTML);
+                axis2_http_simple_response_set_header(response, env, cont_type);
+            }
             else
             {
                 axis2_http_simple_response_set_status_line(response, env,
@@ -1175,9 +1385,46 @@
                             case AXIS2_HTTP_RESPONSE_ACK_CODE_VAL:
                                 status_code_str = AXIS2_HTTP_RESPONSE_ACK_CODE_NAME;
                                 break;
+                            case AXIS2_HTTP_RESPONSE_MULTIPLE_CHOICES_CODE_VAL:
+                                status_code_str = AXIS2_HTTP_RESPONSE_MULTIPLE_CHOICES_CODE_NAME;
+                                break;
+                            case AXIS2_HTTP_RESPONSE_MOVED_PERMANENTLY_CODE_VAL:
+                                status_code_str = AXIS2_HTTP_RESPONSE_MOVED_PERMANENTLY_CODE_NAME;
+                                break;
+                            case AXIS2_HTTP_RESPONSE_SEE_OTHER_CODE_VAL:
+                                status_code_str = AXIS2_HTTP_RESPONSE_SEE_OTHER_CODE_NAME;
+                                break;
+                            case AXIS2_HTTP_RESPONSE_NOT_MODIFIED_CODE_VAL:
+                                status_code_str = AXIS2_HTTP_RESPONSE_NOT_MODIFIED_CODE_NAME;
+                                break;
+                            case AXIS2_HTTP_RESPONSE_TEMPORARY_REDIRECT_CODE_VAL:
+                                status_code_str = AXIS2_HTTP_RESPONSE_TEMPORARY_REDIRECT_CODE_NAME;
+                                break;
                             case AXIS2_HTTP_RESPONSE_BAD_REQUEST_CODE_VAL:
                                 status_code_str = AXIS2_HTTP_RESPONSE_BAD_REQUEST_CODE_NAME;
                                 break;
+                            case AXIS2_HTTP_RESPONSE_REQUEST_TIMEOUT_CODE_VAL:
+                                status_code_str = AXIS2_HTTP_RESPONSE_REQUEST_TIMEOUT_CODE_NAME;
+                                break;
+                            case AXIS2_HTTP_RESPONSE_CONFLICT_CODE_VAL:
+                                status_code_str = AXIS2_HTTP_RESPONSE_CONFLICT_CODE_NAME;
+                                break;
+                            case AXIS2_HTTP_RESPONSE_GONE_CODE_VAL:
+                                status_code_str = AXIS2_HTTP_RESPONSE_GONE_CODE_NAME;
+                                break;
+                            case AXIS2_HTTP_RESPONSE_PRECONDITION_FAILED_CODE_VAL:
+                                status_code_str = AXIS2_HTTP_RESPONSE_PRECONDITION_FAILED_CODE_NAME;
+                                break;
+                            case AXIS2_HTTP_RESPONSE_REQUEST_ENTITY_TOO_LARGE_CODE_VAL:
+                                status_code_str = AXIS2_HTTP_RESPONSE_REQUEST_ENTITY_TOO_LARGE_CODE_NAME;
+                                break;
+                            case AXIS2_HTTP_RESPONSE_SERVICE_UNAVAILABLE_CODE_VAL:
+                                status_code_str = AXIS2_HTTP_RESPONSE_SERVICE_UNAVAILABLE_CODE_NAME;
+                                break;
+                            default:
+                                status_code = AXIS2_HTTP_RESPONSE_OK_CODE_VAL;
+                                status_code_str = AXIS2_HTTP_RESPONSE_OK_CODE_NAME;
+                                break;
                             }
                             axis2_http_simple_response_set_status_line(response, env, http_version,
                                                                        status_code,
@@ -1229,9 +1476,33 @@
                         }
                         if (axis2_msg_ctx_get_no_content(out_msg_ctx, env))
                         {
-                            axis2_http_simple_response_set_status_line(response, env, http_version,
-                                                                       AXIS2_HTTP_RESPONSE_NO_CONTENT_CODE_VAL,
-                                                                       AXIS2_HTTP_RESPONSE_NO_CONTENT_CODE_NAME);
+                            if (axis2_msg_ctx_get_status_code(out_msg_ctx, env))
+                            {
+                                int status_code = axis2_msg_ctx_get_status_code(out_msg_ctx,
env);
+                                axis2_char_t *status_code_str = NULL;
+                                switch (status_code)
+                                {
+                                case AXIS2_HTTP_RESPONSE_RESET_CONTENT_CODE_VAL:
+                                    status_code_str = AXIS2_HTTP_RESPONSE_RESET_CONTENT_CODE_NAME;
+                                    break;
+                                case AXIS2_HTTP_RESPONSE_NOT_MODIFIED_CODE_VAL:
+                                    status_code_str = AXIS2_HTTP_RESPONSE_NOT_MODIFIED_CODE_NAME;
+                                    break;
+                                default:
+                                    status_code = AXIS2_HTTP_RESPONSE_NO_CONTENT_CODE_VAL;
+                                    status_code_str = AXIS2_HTTP_RESPONSE_NO_CONTENT_CODE_NAME;
+                                    break;
+                                }
+                                axis2_http_simple_response_set_status_line(response, env,
http_version,
+                                                                           status_code,
+                                                                           status_code_str);
+                            }
+                            else
+                            {
+                                axis2_http_simple_response_set_status_line(response, env,
http_version,
+                                                                           AXIS2_HTTP_RESPONSE_NO_CONTENT_CODE_VAL,
+                                                                           AXIS2_HTTP_RESPONSE_NO_CONTENT_CODE_NAME);
+                            }
                             request_handled = AXIS2_TRUE;
                         }
                         else if (axis2_msg_ctx_get_status_code(out_msg_ctx, env))
@@ -1246,8 +1517,45 @@
                             case AXIS2_HTTP_RESPONSE_OK_CODE_VAL:
                                 status_code_str = AXIS2_HTTP_RESPONSE_OK_CODE_NAME;
                                 break;
+                            case AXIS2_HTTP_RESPONSE_MULTIPLE_CHOICES_CODE_VAL:
+                                status_code_str = AXIS2_HTTP_RESPONSE_MULTIPLE_CHOICES_CODE_NAME;
+                                break;
+                            case AXIS2_HTTP_RESPONSE_MOVED_PERMANENTLY_CODE_VAL:
+                                status_code_str = AXIS2_HTTP_RESPONSE_MOVED_PERMANENTLY_CODE_NAME;
+                                break;
+                            case AXIS2_HTTP_RESPONSE_SEE_OTHER_CODE_VAL:
+                                status_code_str = AXIS2_HTTP_RESPONSE_SEE_OTHER_CODE_NAME;
+                                break;
+                            case AXIS2_HTTP_RESPONSE_NOT_MODIFIED_CODE_VAL:
+                                status_code_str = AXIS2_HTTP_RESPONSE_NOT_MODIFIED_CODE_NAME;
+                                break;
+                            case AXIS2_HTTP_RESPONSE_TEMPORARY_REDIRECT_CODE_VAL:
+                                status_code_str = AXIS2_HTTP_RESPONSE_TEMPORARY_REDIRECT_CODE_NAME;
+                                break;
                             case AXIS2_HTTP_RESPONSE_BAD_REQUEST_CODE_VAL:
                                 status_code_str = AXIS2_HTTP_RESPONSE_BAD_REQUEST_CODE_NAME;
+                                break;
+                            case AXIS2_HTTP_RESPONSE_REQUEST_TIMEOUT_CODE_VAL:
+                                status_code_str = AXIS2_HTTP_RESPONSE_REQUEST_TIMEOUT_CODE_NAME;
+                                break;
+                            case AXIS2_HTTP_RESPONSE_CONFLICT_CODE_VAL:
+                                status_code_str = AXIS2_HTTP_RESPONSE_CONFLICT_CODE_NAME;
+                                break;
+                            case AXIS2_HTTP_RESPONSE_GONE_CODE_VAL:
+                                status_code_str = AXIS2_HTTP_RESPONSE_GONE_CODE_NAME;
+                                break;
+                            case AXIS2_HTTP_RESPONSE_PRECONDITION_FAILED_CODE_VAL:
+                                status_code_str = AXIS2_HTTP_RESPONSE_PRECONDITION_FAILED_CODE_NAME;
+                                break;
+                            case AXIS2_HTTP_RESPONSE_REQUEST_ENTITY_TOO_LARGE_CODE_VAL:
+                                status_code_str = AXIS2_HTTP_RESPONSE_REQUEST_ENTITY_TOO_LARGE_CODE_NAME;
+                                break;
+                            case AXIS2_HTTP_RESPONSE_SERVICE_UNAVAILABLE_CODE_VAL:
+                                status_code_str = AXIS2_HTTP_RESPONSE_SERVICE_UNAVAILABLE_CODE_NAME;
+                                break;
+                            default:
+                                status_code = AXIS2_HTTP_RESPONSE_ACK_CODE_VAL;
+                                status_code_str = AXIS2_HTTP_RESPONSE_ACK_CODE_NAME;
                                 break;
                             }
                             axis2_http_simple_response_set_status_line(response, env, http_version,

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=638980&r1=638979&r2=638980&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 Wed Mar
19 12:41:58 2008
@@ -1386,6 +1386,77 @@
 }
 
 AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+axis2_http_transport_utils_get_bad_request(
+    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>";
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+axis2_http_transport_utils_get_request_timeout(
+    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>";
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+axis2_http_transport_utils_get_conflict(
+    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>";
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+axis2_http_transport_utils_get_gone(
+    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>";
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+axis2_http_transport_utils_get_precondition_failed(
+    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>";
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+axis2_http_transport_utils_get_request_entity_too_large(
+    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>";
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+axis2_http_transport_utils_get_service_unavailable(
+    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>";
+}
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
 axis2_http_transport_utils_get_services_html(
     const axutil_env_t * env,
     axis2_conf_ctx_t * conf_ctx)



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message