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 07:02:02 UTC

svn commit: r359408 - in /webservices/axis2/trunk/c: include/axis2_mep_client.h include/axis2_msg_ctx.h modules/core/clientapi/src/call.c modules/core/clientapi/src/mep_client.c

Author: samisa
Date: Tue Dec 27 22:01:43 2005
New Revision: 359408

URL: http://svn.apache.org/viewcvs?rev=359408&view=rev
Log:
Added more SOAP envelope related logic

Modified:
    webservices/axis2/trunk/c/include/axis2_mep_client.h
    webservices/axis2/trunk/c/include/axis2_msg_ctx.h
    webservices/axis2/trunk/c/modules/core/clientapi/src/call.c
    webservices/axis2/trunk/c/modules/core/clientapi/src/mep_client.c

Modified: webservices/axis2/trunk/c/include/axis2_mep_client.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_mep_client.h?rev=359408&r1=359407&r2=359408&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_mep_client.h (original)
+++ webservices/axis2/trunk/c/include/axis2_mep_client.h Tue Dec 27 22:01:43 2005
@@ -28,6 +28,7 @@
 #include <axis2_error.h>
 #include <axis2_op.h>
 #include <axis2_om_node.h>
+#include <axis2_soap_envelope.h>
 
 #ifdef __cplusplus
 extern "C"
@@ -86,8 +87,8 @@
      * @return
      * @
      */
-    /* TODO axis2_soap_envelope_t* (AXIS2_CALL *create_default_soap_envelope)(struct axis2_mep_client *mep_client, 
-        axis2_env_t **env);*/
+    axis2_soap_envelope_t* (AXIS2_CALL *create_default_soap_envelope)(struct axis2_mep_client *mep_client, 
+        axis2_env_t **env);
     /**
      * Engage a given Module to the current invocation. But to call this method the
      * Module *MUST* be enable (picked up by the deployment and known to Axis2) else

Modified: webservices/axis2/trunk/c/include/axis2_msg_ctx.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_msg_ctx.h?rev=359408&r1=359407&r2=359408&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_msg_ctx.h (original)
+++ webservices/axis2/trunk/c/include/axis2_msg_ctx.h Tue Dec 27 22:01:43 2005
@@ -607,7 +607,7 @@
 #define AXIS2_MSG_CTX_SET_FAULT_TO(msg_ctx, env, reference) ((msg_ctx)->ops->set_fault_to(msg_ctx, env, reference))
 #define AXIS2_MSG_CTX_SET_FROM(msg_ctx, env, reference) ((msg_ctx)->ops->set_from(msg_ctx, env, reference))
 #define AXIS2_MSG_CTX_SET_IN_FAULT_FLOW(msg_ctx, env, in_fault_flow) ((msg_ctx)->ops->get_in_fault_flow(msg_ctx, env, in_fault_flow))
-#define AXIS2_MSG_CTX_SET_ENVELOPE(msg_ctx, env, soap_envelope) ((msg_ctx)->ops->set_envelope(msg_ctx, env, soap_envelope))
+#define AXIS2_MSG_CTX_SET_SOAP_ENVELOPE(msg_ctx, env, soap_envelope) ((msg_ctx)->ops->set_envelope(msg_ctx, env, soap_envelope))
 #define AXIS2_MSG_CTX_SET_MESSAGE_ID(msg_ctx, env, message_id) ((msg_ctx)->ops->set_message_id(msg_ctx, env, message_id))
 #define AXIS2_MSG_CTX_SET_PROCESS_FAULT(msg_ctx, env, process_fault) ((msg_ctx)->ops->set_process_fault(msg_ctx, env, process_fault))
 #define AXIS2_MSG_CTX_SET_RELATES_TO(msg_ctx, env, reference) ((msg_ctx)->ops->set_relates_to(msg_ctx, env, reference))

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=359408&r1=359407&r2=359408&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 22:01:43 2005
@@ -322,7 +322,7 @@
                     axis2_msg_ctx_create(env, AXIS2_SVC_CTX_GET_CONF_CTX(svc_ctx, env), NULL, NULL);
             if (!response_msg_ctx)
                 return NULL;
-            AXIS2_MSG_CTX_SET_ENVELOPE(response_msg_ctx, env, AXIS2_CALLBACK_GET_ENVELOPE(callback, env));
+            AXIS2_MSG_CTX_SET_SOAP_ENVELOPE(response_msg_ctx, env, AXIS2_CALLBACK_GET_ENVELOPE(callback, env));
             return response_msg_ctx;
         } 
         else 
@@ -859,7 +859,7 @@
         msg_ctx = axis2_msg_ctx_create(env, conf_ctx, NULL, NULL);
         if (msg_ctx)
         {
-            AXIS2_MSG_CTX_SET_ENVELOPE(msg_ctx, env, envelope);
+            AXIS2_MSG_CTX_SET_SOAP_ENVELOPE(msg_ctx, env, envelope);
             call_impl->last_res_msg_ctx = axis2_call_invoke_blocking(call, env, op, msg_ctx);
             return AXIS2_MSG_CTX_GET_SOAP_ENVELOPE(call_impl->last_res_msg_ctx, env);
         }
@@ -983,7 +983,7 @@
         msg_ctx = axis2_msg_ctx_create(env, conf_ctx, NULL, NULL);
         if (msg_ctx)
         {
-            AXIS2_MSG_CTX_SET_ENVELOPE(msg_ctx, env, envelope);
+            AXIS2_MSG_CTX_SET_SOAP_ENVELOPE(msg_ctx, env, envelope);
             return axis2_call_invoke_non_blocking(call, env, op, msg_ctx, callback);
         }
 

Modified: webservices/axis2/trunk/c/modules/core/clientapi/src/mep_client.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/clientapi/src/mep_client.c?rev=359408&r1=359407&r2=359408&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/clientapi/src/mep_client.c (original)
+++ webservices/axis2/trunk/c/modules/core/clientapi/src/mep_client.c Tue Dec 27 22:01:43 2005
@@ -18,6 +18,8 @@
 #include <axis2.h>
 #include <axis2_hash.h>
 #include <axis2_engine.h>
+#include <axis2_soap.h>
+#include <axis2_soap_body.h>
 
 typedef struct axis2_mep_client_impl
 {
@@ -45,8 +47,8 @@
     axis2_om_node_t *to_send);
 axis2_transport_out_desc_t* AXIS2_CALL axis2_mep_client_infer_transport(struct axis2_mep_client *mep_client, axis2_env_t **env, 
             axis2_endpoint_ref_t *epr);
-/* TODO axis2_soap_envelope_t* AXIS2_CALL axis2_mep_client_create_default_soap_envelope(struct axis2_mep_client *mep_client, 
-    axis2_env_t **env);*/
+axis2_soap_envelope_t* AXIS2_CALL axis2_mep_client_create_default_soap_envelope(struct axis2_mep_client *mep_client, 
+    axis2_env_t **env);
 axis2_status_t AXIS2_CALL axis2_mep_client_engage_module(struct axis2_mep_client *mep_client, axis2_env_t **env, axis2_qname_t *qname);
 axis2_status_t AXIS2_CALL axis2_mep_client_set_soap_version_uri(struct axis2_mep_client *mep_client, axis2_env_t **env, axis2_char_t *soap_version_uri);
 axis2_status_t AXIS2_CALL axis2_mep_client_set_soap_action(struct axis2_mep_client *mep_client, axis2_env_t **env, axis2_char_t *soap_action);
@@ -81,13 +83,13 @@
         mep_client_impl->svc_ctx = svc_ctx;
     }
     
-    /* TODO mep_client_impl->soap_version_uri = AXIS2_STRDUP((*env)->allocator, AXIS2_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI);
+    mep_client_impl->soap_version_uri = AXIS2_STRDUP(AXIS2_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI, env);
     if (!(mep_client_impl->soap_version_uri))
     {
         AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         axis2_mep_client_free(&(mep_client_impl->mep_client), env);
         return NULL;        
-    }    */
+    }
     
     if (mep)
     {
@@ -113,7 +115,7 @@
     mep_client_impl->mep_client.ops->prepare_invocation = axis2_mep_client_prepare_invocation;
     mep_client_impl->mep_client.ops->prepare_soap_envelope = axis2_mep_client_prepare_soap_envelope;
     mep_client_impl->mep_client.ops->infer_transport = axis2_mep_client_infer_transport;
-    /* TODO mep_client_impl->mep_client.ops->create_default_soap_envelope = axis2_mep_client_create_default_soap_envelope;*/
+    mep_client_impl->mep_client.ops->create_default_soap_envelope = axis2_mep_client_create_default_soap_envelope;
     mep_client_impl->mep_client.ops->engage_module = axis2_mep_client_engage_module;
     mep_client_impl->mep_client.ops->set_soap_version_uri = axis2_mep_client_set_soap_version_uri;
     mep_client_impl->mep_client.ops->set_soap_action = axis2_mep_client_set_soap_action;
@@ -188,7 +190,7 @@
 {
     axis2_mep_client_impl_t *mep_client_impl = NULL;
     axis2_msg_ctx_t *msg_ctx = NULL;
-    /* TODO axis2_soap_envelope_t *envelope = NULL;*/
+    axis2_soap_envelope_t *envelope = NULL;
     
     AXIS2_FUNC_PARAM_CHECK(mep_client, env, NULL);
     
@@ -200,24 +202,28 @@
         return NULL;
     }
     
-    /* TODO envelope = axis2_soap_envelope_create(env);
+    envelope = axis2_soap_envelope_create(env, NULL);
     if (!envelope)
     {
         return NULL;
-    }*/
+    }
     
     if (to_send) 
     {
-        /* TODO axis2_soap_body_t *soap_body = NULL;
+        axis2_soap_body_t *soap_body = NULL;
         soap_body = AXIS2_SOAP_ENVELOPE_GET_BODY(envelope, env);
         if (soap_body)
         {
-            AXIS2_SOAP_BODY_ADD_CHILD(soap_body, env, to_send);
+            axis2_om_node_t *node = NULL;
+            node = AXIS2_SOAP_BODY_GET_BASE(soap_body, env);
+            if (node)
+            {
+                AXIS2_OM_NODE_ADD_CHILD(node, env, to_send);
+            }
         }       
-        */
     }
     
-    /* TODO AXIS2_MSG_CTX_SET_SOAP_ENVELOPE(msg_ctx, env, envelope);*/
+    AXIS2_MSG_CTX_SET_SOAP_ENVELOPE(msg_ctx, env, envelope);
    
     return msg_ctx;
 }
@@ -269,28 +275,34 @@
     return NULL;
 }
 
-/* TODO axis2_soap_envelope_t* AXIS2_CALL axis2_mep_client_create_default_soap_envelope(struct axis2_mep_client *mep_client, 
+axis2_soap_envelope_t* AXIS2_CALL axis2_mep_client_create_default_soap_envelope(struct axis2_mep_client *mep_client, 
     axis2_env_t **env)  
 {
-    axis2_soap_factory fac = NULL;
+    axis2_soap_envelope_t *envelope = NULL;
+    axis2_mep_client_impl_t *mep_client_impl = NULL;
     
     AXIS2_FUNC_PARAM_CHECK(mep_client, env, NULL);
+    mep_client_impl = AXIS2_INTF_TO_IMPL(mep_client);
     
-    if (AXIS2_STRCMP(SOAP12_SOAP_ENVELOPE_NAMESPACE_URI, soap_version_uri) == 0) 
-    {
-        /*fac = OMAbstractFactory.getSOAP12Factory();*/
-    /*} 
-    else if (AXIS2_STRCMP(SOAP11_SOAP_ENVELOPE_NAMESPACE_URI, soap_version_uri) == 0) 
-    {
-        /*fac = OMAbstractFactory.getSOAP11Factory();*/
-    /*} else 
+    if (AXIS2_STRCMP(AXIS2_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI, mep_client_impl->soap_version_uri) == 0) 
     {
-        AXIS2_ERROR_SET( (*env)->error, AXIS2_ERROR_INVALID_SOAP_VERSION, AXIS2_FAILURE);
-        return NULL;
+        envelope = axis2_soap_envelope_create(env, NULL);
+        if (envelope)
+        {
+            AXIS2_SOAP_ENVELOPE_SET_SOAP_VERSION(envelope, env, AXIS2_SOAP12);
+        }
     }
     
-    return AXIS2_SOAP_FACTORY_GET_DEFAULT_ENVELOPE(fac, env);
-}*/
+    if (AXIS2_STRCMP(AXIS2_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI, mep_client_impl->soap_version_uri) == 0) 
+    {
+        envelope = axis2_soap_envelope_create(env, NULL);
+        if (envelope)
+        {
+            AXIS2_SOAP_ENVELOPE_SET_SOAP_VERSION(envelope, env, AXIS2_SOAP11);
+        }
+    }
+    return envelope;
+}
 
 axis2_status_t AXIS2_CALL axis2_mep_client_engage_module(struct axis2_mep_client *mep_client, axis2_env_t **env, axis2_qname_t *qname)  
 {
@@ -313,7 +325,7 @@
                 /*if it is already engeged do not engege it again*/
                 if (!(AXIS2_CONF_IS_ENGAGED(conf, env, qname))) 
                 {
-                    /* TODO return AXIS2_CONF_ENGAGE_MODULE(conf, env, qname);*/
+                    return AXIS2_CONF_ENGAGE_MODULE(conf, env, qname);
                 }
             }
         }