On Thu, Mar 12, 2009 at 1:34 AM, Sagara Gunathunga <
[email protected]> wrote:
> Hi ,
> As you said the problem is client terminate without waiting for
> response ,one possible solution is set a Thread with reasonable time
> out to hold the process without terminate.
>
> Callback callback = new Callback() {
>
> public void onComplete(AsyncResult result) {
>
> //do something
>
> }
>
>
>
> ------------------------------------------
> //wait till client get the response
>
> while (!callback.isComplete()) {
>
> Thread.sleep(1000);
>
> index++;
>
> if (index > 20) {
>
> throw new AxisFault("Time out");
>
> }
>
> }
>
>
>
> Thanks,
>
>
> Thanks, Partha. It looks there's a leaking abstraction here, though.
Shouldn't the Axis2 engine ensure all threads behave correctly, thus let a
callback object focus on business logic? At least the WSDL2Java can generate
proper code to manage threads(awkward, but at least hides enough details
from users).