axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicholas Hart <nh...@real.com>
Subject [axis2c] client callback question
Date Wed, 20 Dec 2006 19:58:09 GMT
sorry if this is the wrong place to post this, but I've got a question 
regarding on_complete/on_error callbacks in a client.  when my 
on_complete() or on_error() is called, how do I tell which request it is 
in response to?

I'm using a stub created by wsdl2java and the general API of each 
function is:

void axis2_stub_Foo_start(axis2_env* env,
                           FooObj* param,
                           on_complete_callback_func,
                           on_error_callback_func);

I modified one of these functions to take a void* (the "this" for my 
object) and then inside the generated function I call 
AXIS2_CALLBACK_SET_DATA() so that when I receive my callback I can use 
AXIS2_CALLBACK_GET_DATA() to retrieve the pointer to my object that 
"owns" the request.  so then in my callback I do something like...

axis2_status MyOnComplete(...)
{
	MyObj* obj = (MyObj*)AXIS2_CALLBACK_GET_DATA(callback);
	obj->HandleOnComplete();
	return AXIS2_SUCCESS;
}

However, it will be very tedious to add this extra parameter and call to 
to AXIS2_CALLBACK_SET_DATA() for every single generated function.  is 
there an easier way of accomplishing this, or something equivalent? 
Maybe there's some trick to this that I'm not seeing in any of the samples?

any insight would be appreciated, thanks!



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


Mime
View raw message