Hi Samisa
In mep_client.c you have implemented a counter loop with the hard code
counter value of 5.
Inside the loop you sleep 1 second and look for the response envelope
set as a service context
property(you code follows)
else
{
int count = 0;
while (!response_envelope && count < 5)
{
count++;
sleep(1);
axis2_op_ctx_t *op_ctx = AXIS2_MSG_CTX_GET_OP_CTX(msg_ctx, env);
axis2_svc_ctx_t *svc_ctx = AXIS2_OP_CTX_GET_PARENT(op_ctx, env);
axis2_ctx_t *ctx = AXIS2_SVC_CTX_GET_BASE((const
axis2_svc_ctx_t *)svc_ctx, env);
axis2_property_t *prop = AXIS2_CTX_GET_PROPERTY(ctx, env,
AXIS2_RESPONSE_SOAP_ENVELOPE, AXIS2_FALSE);
if (prop)
response_envelope = AXIS2_PROPERTY_GET_VALUE(prop, env);
if (response_envelope)
AXIS2_MSG_CTX_SET_RESPONSE_SOAP_ENVELOPE (msg_ctx, env,
response_envelope);
}
Instead what I suggest is
else /*if response envelope is NULL */
{
axis2_bool_t wait_indefinite = AXIS2_FALSE;
index = /* get the client set time out */
if(index == -1)
{
wait_indefinite = AXIS2_TRUE;
index =1;
}
while(!response_envelope && index > 0)
{
/*wait till the response arrives*/
AXIS2_USLEEP(10000);
if(!wait_indefinite)
index--;
response_envelope =
axis2_msg_ctx_get_response_envelope(msg_ctx, env);
}
}
In this was client program has more control over wait time. If he wish
by passing -1
he can wait indefinitely until the response arrives. Also this need no
change to the
sandesha2 code like setting response envelope as a service context property.
Also see my inline comments
Modified: webservices/sandesha/trunk/c/src/handlers/sandesha2_out_handler.c
URL:
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/handlers/sandesha2_out_handler.c?view=diff&rev=511885&r1=511884&r2=511885
==============================================================================
--- webservices/sandesha/trunk/c/src/handlers/sandesha2_out_handler.c (original)
+++ webservices/sandesha/trunk/c/src/handlers/sandesha2_out_handler.c Mon Feb
26 08:41:40 2007
@@ -119,6 +119,27 @@
AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_SVC_NULL, AXIS2_FAILURE);
return AXIS2_FAILURE;
}
+ else
+ {
+ axis2_qname_t *mod_qname = axis2_qname_create(env, "sandesha2", NULL,
NULL);
+ axis2_array_list_t *mod_qnames = AXIS2_SVC_GET_ALL_MODULE_QNAMES(svc,
env);
+ int size = axis2_array_list_size(mod_qnames, env);
+ int i = 0;
+ axis2_bool_t found = AXIS2_FALSE;
+ for (i = 0; i < size; i++)
+ {
+ axis2_qname_t *qname = NULL;
+ qname = AXIS2_ARRAY_LIST_GET(mod_qnames, env, i);
+ if (qname)
+ {
+ found = axis2_qname_equals(mod_qname, env, qname);
+ if (found)
+ break;
+ }
+ }
+ if (!found)
+ return AXIS2_SUCCESS;
+ }
Why the above lines are needed ?
Modified: webservices/sandesha/trunk/c/src/workers/sender.c
URL:
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/workers/sender.c?view=diff&rev=511885&r1=511884&r2=511885
==============================================================================
--- webservices/sandesha/trunk/c/src/workers/sender.c (original)
+++ webservices/sandesha/trunk/c/src/workers/sender.c Mon Feb 26 08:41:40 2007
@@ -243,6 +243,7 @@
axis2_env_t *env = NULL;
sandesha2_storage_mgr_t *storage_mgr = NULL;
sandesha2_seq_property_mgr_t *seq_prop_mgr = NULL;
+ int count = 0;
args = (sandesha2_sender_args_t*)data;
env = axis2_init_thread_env(args->env);
@@ -272,6 +273,9 @@
if(!sender_bean)
{
sandesha2_transaction_commit(transaction, env);
+ count++;
+ if (count > 5)
+ break;
This should be better done by using maxRetransCount and
InactivityTimeout properties set in
services policy or in module.xml. Currently I'm looking into this and it
seems to work.
Modified: webservices/sandesha/trunk/c/src/workers/sender_worker.c
URL:
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/workers/sender_worker.c?view=diff&rev=511885&r1=511884&r2=511885
==============================================================================
--- webservices/sandesha/trunk/c/src/workers/sender_worker.c (original)
+++ webservices/sandesha/trunk/c/src/workers/sender_worker.c Mon Feb 26
08:41:40 2007
@@ -24,7 +24,6 @@
#include <sandesha2_seq_property_mgr.h>
#include <sandesha2_msg_ctx.h>
#include <sandesha2_seq.h>
-#include <sandesha2_client_constants.h>
#include <axis2_addr.h>
#include <axis2_engine.h>
#include <stdlib.h>
@@ -599,12 +598,10 @@
AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI;
res_envelope = axis2_msg_ctx_get_response_soap_envelope(msg_ctx, env);
- if(!res_envelope)
- {
+ /*if(!res_envelope)
res_envelope = axis2_http_transport_utils_create_soap_msg(env, msg_ctx,
soap_ns_uri);
- axis2_msg_ctx_set_response_soap_envelope(msg_ctx, env, res_envelope);
- }
+ */
If you comment this out rm_ping_1_0 does not work properly. i.e
terminate message is not sent
- property = axis2_msg_ctx_get_property(msg_ctx, env,
- SANDESHA2_CLIENT_SEQ_KEY, AXIS2_FALSE);
- if(property)
- new_property = axis2_property_clone(property, env);
- if(new_property)
- axis2_msg_ctx_set_property(res_msg_ctx, env,
- SANDESHA2_CLIENT_SEQ_KEY, new_property, AXIS2_FALSE);
Why did you remove these lines of code. I need this to implement
the number two item described in my previos mail headed
"[wsf-c-dev] Getting response for sandesha2 RM 1.0 two way single
channel".
Does that code affect in anyway to your implementation?
Damitha
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]