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 da...@apache.org on 2008/04/30 07:32:31 UTC

svn commit: r652265 - in /webservices/axis2/trunk/c/src/core: context/op_ctx.c transport/http/sender/http_sender.c

Author: damitha
Date: Tue Apr 29 22:32:31 2008
New Revision: 652265

URL: http://svn.apache.org/viewvc?rev=652265&view=rev
Log:
Fixing jira https://issues.apache.org/jira/browse/AXIS2C-1120

Modified:
    webservices/axis2/trunk/c/src/core/context/op_ctx.c
    webservices/axis2/trunk/c/src/core/transport/http/sender/http_sender.c

Modified: webservices/axis2/trunk/c/src/core/context/op_ctx.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/context/op_ctx.c?rev=652265&r1=652264&r2=652265&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/context/op_ctx.c (original)
+++ webservices/axis2/trunk/c/src/core/context/op_ctx.c Tue Apr 29 22:32:31 2008
@@ -143,11 +143,14 @@
     const axutil_env_t * env)
 {
     int i = 0;
-
     if (--(op_ctx->ref) > 0)
     {
         return;
     }
+    if(op_ctx->is_in_use)
+    {
+        return;
+    }
 
     if (op_ctx->base)
     {

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=652265&r1=652264&r2=652265&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 Tue Apr 29 22:32:31 2008
@@ -269,22 +269,14 @@
 
     if (!is_soap)
     {
-        if (!soap_body)
+        if(soap_body)
         {
-            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;
+            body_node = axiom_soap_body_get_base_node (soap_body, env);
         }
-        body_node = axiom_soap_body_get_base_node (soap_body, env);
-        if (!body_node)
+        if(body_node)
         {
-            AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, "body_node is NULL");
-            return AXIS2_FAILURE;
+            data_out = axiom_node_get_first_element (body_node, env);
         }
-        data_out = axiom_node_get_first_element (body_node, env);
 
         method = (axutil_property_t *) axis2_msg_ctx_get_property (msg_ctx, env,
                                                                    AXIS2_HTTP_METHOD);
@@ -411,7 +403,6 @@
     {
         /* processing POST and PUT methods */
         axutil_property_t *property = NULL;
-
         /* We put the client into msg_ctx so that we can free it once the processing
          * is done at client side
          */
@@ -481,10 +472,15 @@
         }
         else
         {
+            if (!data_out)
+            {
+                AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+                    "body node payload is NULL");
+                return AXIS2_FAILURE;
+            }
             axiom_node_serialize (data_out, env, sender->om_output);
         }
 
-
         if (doing_mtom)
         {
             axiom_output_flush (sender->om_output, env, &output_stream,
@@ -529,11 +525,17 @@
         request_params = axis2_http_sender_get_param_string (sender,
                                                              env, msg_ctx);
 
-        /* substituting AXIS2_Q_MARK for "?" */
-        path = axutil_strcat (env,
+        if(request_params)
+        {
+            /* substituting AXIS2_Q_MARK for "?" */
+            path = axutil_strcat (env,
                               axutil_url_get_path (url, env),
                               AXIS2_Q_MARK_STR, request_params, NULL);
-
+        }
+        else
+        {
+            path = axutil_url_to_external_form(url, env);
+        }
         if (send_via_get)
         {
             request_line = axis2_http_request_line_create (env, 
@@ -3213,6 +3215,7 @@
                                     axis2_msg_ctx_t * msg_ctx)
 {
     axiom_soap_envelope_t *soap_env = NULL;
+    axiom_soap_body_t *soap_body = NULL;
     axiom_node_t *body_node = NULL;
     axiom_node_t *data_node = NULL;
     axiom_element_t *data_element = NULL;
@@ -3228,9 +3231,16 @@
     {
         return NULL;
     }
+    soap_body = axiom_soap_envelope_get_body(soap_env, env);
     body_node =
-        axiom_soap_body_get_base_node (axiom_soap_envelope_get_body
-                                       (soap_env, env), env);
+        axiom_soap_body_get_base_node(soap_body, env);
+    if(!body_node)
+    {
+        /* This could be the situation where service client does not provide
+         * a xml payload and instead add url parameters to the endpoint url
+         */
+        return NULL;
+    }
     data_node = axiom_node_get_first_child (body_node, env);
     if (!data_node)
     {



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