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 sa...@apache.org on 2005/12/28 06:24:12 UTC

svn commit: r359399 - in /webservices/axis2/trunk/c: include/axis2_callback.h include/axis2_soap_envelope.h modules/core/clientapi/src/call.c modules/core/clientapi/src/callback.c modules/core/transport/axis2_transport_listener.h

Author: samisa
Date: Tue Dec 27 21:24:00 2005
New Revision: 359399

URL: http://svn.apache.org/viewcvs?rev=359399&view=rev
Log:
More fixes related to SOAP envelope

Modified:
    webservices/axis2/trunk/c/include/axis2_callback.h
    webservices/axis2/trunk/c/include/axis2_soap_envelope.h
    webservices/axis2/trunk/c/modules/core/clientapi/src/call.c
    webservices/axis2/trunk/c/modules/core/clientapi/src/callback.c
    webservices/axis2/trunk/c/modules/core/transport/axis2_transport_listener.h

Modified: webservices/axis2/trunk/c/include/axis2_callback.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_callback.h?rev=359399&r1=359398&r2=359399&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_callback.h (original)
+++ webservices/axis2/trunk/c/include/axis2_callback.h Tue Dec 27 21:24:00 2005
@@ -26,6 +26,7 @@
 #include <axis2_defines.h>
 #include <axis2_env.h>
 #include <axis2_async_result.h>
+#include <axis2_soap_envelope.h>
 
 #ifdef __cplusplus
 extern "C"
@@ -88,10 +89,10 @@
     axis2_status_t (AXIS2_CALL *set_complete)(struct axis2_callback *callback, 
         axis2_env_t **env, 
         axis2_bool_t complete);
-    /* TODO axis2_soap_envelope_t* (AXIS2_CALL *get_envelope)(struct axis2_callback *callback, 
+    axis2_soap_envelope_t* (AXIS2_CALL *get_envelope)(struct axis2_callback *callback, 
         axis2_env_t **env);
     axis2_status_t (AXIS2_CALL *set_envelope)(struct axis2_callback *callback, 
-        axis2_env_t **env, axis2_soap_envelope_t *envelope);*/
+        axis2_env_t **env, axis2_soap_envelope_t *envelope);
     int (AXIS2_CALL *get_error)(struct axis2_callback *callback, 
         axis2_env_t **env);
     axis2_status_t (AXIS2_CALL *set_error)(struct axis2_callback *callback, 

Modified: webservices/axis2/trunk/c/include/axis2_soap_envelope.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_soap_envelope.h?rev=359399&r1=359398&r2=359399&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_soap_envelope.h (original)
+++ webservices/axis2/trunk/c/include/axis2_soap_envelope.h Tue Dec 27 21:24:00 2005
@@ -134,7 +134,7 @@
 
 #define AXIS2_SOAP_ENVELOPE_GET_HEADDER(envelope, env) ((envelope)->ops->get_header(envelope, env))
 #define AXIS2_SOAP_ENVELOPE_ADD_HEADER(envelope, env, namespace_uri, name) ((envelope)->ops->add_header(envelope, env, namespace_uri, name))
-#define AXIS2_SOAP_ENVELOPE_GET_BOBY(envelope, env) ((envelope)->ops->get_body(envelope, env))
+#define AXIS2_SOAP_ENVELOPE_GET_BODY(envelope, env) ((envelope)->ops->get_body(envelope, env))
 #define AXIS2_SOAP_ENVELOPE_SERIALIZE(envelope, env, om_output, cache) ((envelope)->ops->serialize(envelope, env, om_output, cache))
 #define AXIS2_SOAP_ENVELOPE_FREE(envelope, env) ((envelope)->ops->free(envelope, env))
 #define AXIS2_SOAP_ENVELOPE_GET_BASE(envelope, env) ((envelope)->ops->get_base(envelope, env))

Modified: webservices/axis2/trunk/c/modules/core/clientapi/src/call.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/clientapi/src/call.c?rev=359399&r1=359398&r2=359399&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/clientapi/src/call.c (original)
+++ webservices/axis2/trunk/c/modules/core/clientapi/src/call.c Tue Dec 27 21:24:00 2005
@@ -22,6 +22,7 @@
 #include <listener_manager.h>
 #include <callback_recv.h>
 #include <axis2_engine.h>
+#include <axis2_soap_body.h>
 
 typedef struct axis2_call_impl
 {
@@ -315,7 +316,7 @@
             }
         }
         /* process the result of the invocation */
-        /* TODO if (AXIS2_CALLBACK_GET_ENVELOPE(callback, env))
+        if (AXIS2_CALLBACK_GET_ENVELOPE(callback, env))
         {
             axis2_msg_ctx_t *response_msg_ctx =
                     axis2_msg_ctx_create(env, AXIS2_SVC_CTX_GET_CONF_CTX(svc_ctx, env), NULL, NULL);
@@ -328,10 +329,10 @@
         {
             if (AXIS2_CALLBACK_GET_ERROR(callback, env) != AXIS2_ERROR_NONE)
             {
-                AXIS2_ERROR_SET(*(env)->error, AXIS2_CALLBACK_GET_ERROR(callback, env), AXIS2_FAILURE);
+                AXIS2_ERROR_SET((*env)->error, AXIS2_CALLBACK_GET_ERROR(callback, env), AXIS2_FAILURE);
                 return NULL;
             }
-        }*/
+        }
     } 
     else 
     {        
@@ -357,22 +358,25 @@
             return NULL;
         
         /*check for a fault and return the result */
-        /* TODO response_envelope = AXIS2_MSG_CTX_GET_ENVELOPE(response, env);
+        response_envelope = AXIS2_MSG_CTX_GET_SOAP_ENVELOPE(response, env);
         if (response_envelope)
         {
-            axis2_soap_body_t *soap_body = AXIS2_SOAP_ENVELOPE_GET_BOBY(response_envelope, env);
+            axis2_soap_body_t *soap_body = AXIS2_SOAP_ENVELOPE_GET_BODY(response_envelope, env);
             if (soap_body)
             {
-                if (AXIS2_SOAP_BODY_HAS_FAULT(soap_body, env))
+                if (AXIS2_SOAP_BODY_GET_HAS_FAULT(soap_body, env))
                 {
                     axis2_soap_fault_t *soap_fault = AXIS2_SOAP_BODY_GET_FAULT(soap_body, env);
-                    /* TODO set the fault in env error *//*
+                    AXIS2_SOAP_FAULT_GET_EXCEPTION(soap_fault, env);
+                    /* TODO set the fault in env error */
                 }
             }            
-        }*/
+        }
         
         return response;
     }
+    
+    return NULL;
 }
 
 /**
@@ -781,10 +785,17 @@
             if (call_impl->last_res_msg_ctx)
             {
                 axis2_soap_body_t *soap_body = NULL;
-                /*axis2_soap_envelope_t *res_envelope = AXIS2_MSG_CTX_GET_ENVELOPE(call_impl->last_res_msg_ctx, env);
-                soap_body = AXIS2_SOAP_ENVELOPE_GET_BOBY(res_envelope, env);
+                axis2_soap_envelope_t *res_envelope = AXIS2_MSG_CTX_GET_SOAP_ENVELOPE(call_impl->last_res_msg_ctx, env);
+                soap_body = AXIS2_SOAP_ENVELOPE_GET_BODY(res_envelope, env);
                 if (soap_body)
-                    return AXIS2_SOAP_BODY_GET_FIRST_ELEMENT(soap_body, env);*/
+                {
+                    axis2_om_node_t *soap_node = NULL;
+                    soap_node = AXIS2_SOAP_BODY_GET_BASE(soap_body, env);
+                    if (soap_node)
+                    {
+                        return AXIS2_OM_NODE_GET_FIRST_CHILD(soap_node, env);
+                    }
+                }
             }
         }
         
@@ -837,7 +848,7 @@
         if (!op)
             return NULL;
         
-        if (!envelope || !(AXIS2_SOAP_ENVELOPE_GET_BOBY(envelope, env)))
+        if (!envelope || !(AXIS2_SOAP_ENVELOPE_GET_BODY(envelope, env)))
         {
             AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_SOAP_ENVELOPE_OR_SOAP_BODY_NULL, AXIS2_FAILURE);
             return NULL;
@@ -850,7 +861,7 @@
         {
             AXIS2_MSG_CTX_SET_ENVELOPE(msg_ctx, env, envelope);
             call_impl->last_res_msg_ctx = axis2_call_invoke_blocking(call, env, op, msg_ctx);
-            /* TODO return AXIS2_MSG_CTX_GET_ENVELOPE(call_impl->last_res_msg_ctx, env);*/
+            return AXIS2_MSG_CTX_GET_SOAP_ENVELOPE(call_impl->last_res_msg_ctx, env);
         }
 
     }
@@ -961,7 +972,7 @@
         if (!op)
             return AXIS2_FAILURE;
         
-        if (!envelope || !(AXIS2_SOAP_ENVELOPE_GET_BOBY(envelope, env)))
+        if (!envelope || !(AXIS2_SOAP_ENVELOPE_GET_BODY(envelope, env)))
         {
             AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_SOAP_ENVELOPE_OR_SOAP_BODY_NULL, AXIS2_FAILURE);
             return AXIS2_FAILURE;

Modified: webservices/axis2/trunk/c/modules/core/clientapi/src/callback.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/clientapi/src/callback.c?rev=359399&r1=359398&r2=359399&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/clientapi/src/callback.c (original)
+++ webservices/axis2/trunk/c/modules/core/clientapi/src/callback.c Tue Dec 27 21:24:00 2005
@@ -25,7 +25,7 @@
     /** callback complete? */
     axis2_bool_t complete;
     /** envelope corresponding to the result */
-    /* TODO axis2_soap_envelope_t *envelope; */
+    axis2_soap_envelope_t *envelope;
     /** error code */
     int error;
 } axis2_callback_impl_t;
@@ -37,10 +37,10 @@
 axis2_status_t AXIS2_CALL axis2_callback_report_error(struct axis2_callback *callback, axis2_env_t **env, int exception);
 axis2_bool_t AXIS2_CALL axis2_callback_get_complete(struct axis2_callback *callback, axis2_env_t **env);
 axis2_status_t AXIS2_CALL axis2_callback_set_complete(struct axis2_callback *callback, axis2_env_t **env, axis2_bool_t complete) ;
-/* TODO axis2_soap_envelope_t* AXIS2_CALL axis2_callback_get_envelope(struct axis2_callback *callback, 
+axis2_soap_envelope_t* AXIS2_CALL axis2_callback_get_envelope(struct axis2_callback *callback, 
         axis2_env_t **env);
 axis2_status_t AXIS2_CALL axis2_callback_set_envelope(struct axis2_callback *callback, 
-        axis2_env_t **env, axis2_soap_envelope_t *envelope);*/
+        axis2_env_t **env, axis2_soap_envelope_t *envelope);
 int AXIS2_CALL axis2_callback_get_error(struct axis2_callback *callback, 
         axis2_env_t **env);
 axis2_status_t AXIS2_CALL axis2_callback_set_error(struct axis2_callback *callback, 
@@ -113,7 +113,7 @@
     return AXIS2_SUCCESS;
 }
 
-/* TODO axis2_soap_envelope_t* AXIS2_CALL axis2_callback_get_envelope(struct axis2_callback *callback, 
+axis2_soap_envelope_t* AXIS2_CALL axis2_callback_get_envelope(struct axis2_callback *callback, 
         axis2_env_t **env)
 {
     AXIS2_FUNC_PARAM_CHECK(callback, env, AXIS2_FAILURE);
@@ -126,7 +126,7 @@
     AXIS2_FUNC_PARAM_CHECK(callback, env, AXIS2_FAILURE);
     AXIS2_INTF_TO_IMPL(callback)->envelope = envelope;
     return AXIS2_SUCCESS;
-}*/
+}
 
 int AXIS2_CALL axis2_callback_get_error(struct axis2_callback *callback, 
         axis2_env_t **env)

Modified: webservices/axis2/trunk/c/modules/core/transport/axis2_transport_listener.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/axis2_transport_listener.h?rev=359399&r1=359398&r2=359399&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/axis2_transport_listener.h (original)
+++ webservices/axis2/trunk/c/modules/core/transport/axis2_transport_listener.h Tue Dec 27 21:24:00 2005
@@ -27,7 +27,7 @@
 #include <axis2_defines.h>
 #include <axis2_env.h>
 #include <axis2_allocator.h>
-/*#include <axis2_endpoint_ref.h>*/
+#include <axis2_endpoint_ref.h>
 #include <axis2_ctx.h>
 
 #include <axis2_wsdl.h>
@@ -66,7 +66,7 @@
 	axis2_status_t (AXIS2_CALL *stop)(
                     axis2_transport_listener_t *transport_listener,
 			        axis2_env_t **env);
-	axis2_status_t (AXIS2_CALL *reply_to_epr)(
+	axis2_endpoint_ref_t* (AXIS2_CALL *reply_to_epr)(
                     axis2_transport_listener_t *transport_listener,
 			        axis2_env_t **env,
                     axis2_char_t *svc_name);