Just a few comments 

Petr is describing two problems I think: the blocking nature of Call.invoke,
and the lack of a cancellation method for halting a Call.invoke. 

As to the blocking problem, there is no documentation on it, but in the
"org.apache.axis.client.async" package, there is an AsyncCall(Call call)
that appears to return immediately from an invoke call. One option for you
in immediate future is to setup an async call, and when the invoke returns
(through a callback by the if I'm guessing correctly on IAsyncCallback), you
can simply not process the result if someone clicked on your cancel button.
A user will need never know that a request did come it which you ignored. 

As to the lack of cancellation, I would guess that Axis is probably
constructed using blocking I/O calls which could be moved to loops that
check if an InputStream.available() > 0 instead of depending on the blocking
of a read(byte [] bytes). In such loops, a check could be made to see if a
cancellation flag has been set. I wish I had time to take a look at the
source. I'm sure what I'm describing isn't trivial, but none-the-less, in
time Axis will probably have such functionality at which point you can
update your app accordingly. 

BTW, I have no actual knowledge of the development schedule of Axis. My
conjecture that cancellation will be implemented sometime soon is based on
my belief that your issue isn't unique, and from my view (from a far
distance from the source code), wouldn't be that challenging to implement.



-----
Jason Judt - Software Engineer
Architecture Technology Corporation
(952) 829 - 5864 x137
[EMAIL PROTECTED]
 

-----Original Message-----
From: James Clinton [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 25, 2005 10:38 AM
To: [EMAIL PROTECTED]
Subject: RE: abort call.invoke (SOAP client call)


You can use Thread.join(long m) to solve your problem like this:

=======

public class Tester {

        InvokerThread invoker;
        static boolean gotResponse = false;

        public Tester() throws Exception {
                invoker = new InvokerThread();
                invoker.start();
                invoker.join(12000);

                if(gotResponse) {
                        System.out.println("got response in time");
                } else {
                        System.out.println("send back customer
response");
                }

        }

        public static void main(String[] args) throws Exception {
                Tester t = new Tester();
                System.exit(0);
        }
}


class InvokerThread extends Thread {

        public void run() {
                Thread thisThread = Thread.currentThread();
                while (true) {
                        try {
                                thisThread.sleep(10000);
                                Tester.gotResponse = true;
                        } catch (InterruptedException e){

                        }
                }
        }
}


----------------------------------------------------------------------------
------------------
Did you know?

Xchanging manage over 450,000 claims a year for the London Insurance Market,
to a combined value of 10 billion pounds.

Xchanging settle over 62 billion pounds of insurance business between over
300 companies in a global customer network.

Visit www.xchanging.com for more details

----------------------------------------------------------------------------
------------------



-----------------------------------------------------
THE INFORMATION IN THIS E-MAIL AND IN ANY ATTACHMENTS IS CONFIDENTIAL

AND MAY BE PRIVILEGED OR OTHERWISE PROTECTED FROM DISCLOSURE. 
IF YOU ARE NOT THE INTENDED RECIPIENT AND HAVE RECEIVED IT IN ERROR YOU ARE
ON NOTICE OF ITS STATUS. 
PLEASE NOTIFY THE SENDER IMMEDIATELY BY RETURN EMAIL AND THEN DELETE THIS
EMAIL AND ANY ATTACHMENT FROM YOUR SYSTEM. 
YOU MUST NOT RETAIN, COPY OR USE THIS E-MAIL OR ANY ATTACHMENT FOR ANY
PURPOSE, NOR DISCLOSE ALL OR ANY PART OF ITS CONTENTS TO ANY OTHER PERSON: 

TO DO SO COULD BE A BREACH OF CONFIDENCE

EMAIL MAY BE SUSCEPTIBLE TO DATA CORRUPTION, INTERCEPTION AND UNAUTHORISED
AMENDMENT, 
AND WE DO NOT ACCEPT LIABILITY FOR ANY SUCH CORRUPTION, INTERCEPTION OR
AMENDMENT OR THE CONSEQUENCES THEREOF. 

WE MAY MONITOR THE CONTENT OF EMAILS SENT AND RECEIVED VIA OUR NETWORK FOR
VIRUSES OR UNAUTHORISED USE AND FOR OTHER LAWFUL BUSINESS PURPOSES. 
WE DO NOT ACCEPT RESPONSIBILITY FOR ANY LOSS OR DAMAGE ARISING FROM A VIRUS
IN ANY EMAIL OR ATTACHMENT.

-----------------------------------------------
[EMAIL PROTECTED]

Reply via email to