You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Andrea Smyth <an...@iona.com> on 2006/11/27 12:21:40 UTC

JAX-WS async calls not async?

With an implementor that sleeps 3 seconds in String greetMe(String name) 
I was expecting the following system test to pass:

public void testAsync() {
        GreeterService service = new GreeterService();
        Greeter greeter = service.getGreeterPort();
       
        long before = System.currentTimeMillis();
       
        Response<GreetMeResponse> r1 = greeter.greetMeAsync("one");
        Response<GreetMeResponse> r2 = greeter.greetMeAsync("two");
       
        long after = System.currentTimeMillis();
       
        assertTrue("Duration of calls exceeded 6000 ms", after - before 
< 6000);
       
        // first time round, responses should not be available yet
        assertFalse("Response already available.", r1.isDone());
        assertFalse("Response already available.", r2.isDone());
       
        // after three seconds responses should be available
        long waited = 0;
        while (waited < 5000) {
            try {
                Thread.sleep(500);
            } catch (InterruptedException ex) {
               // ignore
            }
            if (r1.isDone() && r2.isDone()) {
                break;
            }
            waited += 500;
        }
        assertTrue("Response is  not available.", r1.isDone());
        assertTrue("Response is  not available.", r2.isDone());
    }

However the test fails as the second invocation is apparently only made 
after the first one has returned a response, i.e. it fails with
junit.framework.AssertionFailedError: Duration of calls exceeded 6000 ms.
Am I overlooking something or has the async invocation model not been 
implemented yet?
There are system tests in place, but these seem to not verify that at 
some point after the initial (async) invocation, the response is NOT yet 
available - they only test that it will eventually become available.

Andrea.



Re: JAX-WS async calls not async?

Posted by Freeman Fang <fr...@iona.com>.
Hi Andrea,

My last commit get asyn invocation work and add your test case into 
system test.

But this change cause your new added testTwowayMessageLoss of 
SequenceTest fail on my machine, I comment it out temporarily since I 
have no idea about ws-rm, would you please take a look at this test?

Thanks very much
Freeman

Andrea Smyth wrote:

> With an implementor that sleeps 3 seconds in String greetMe(String 
> name) I was expecting the following system test to pass:
>
> public void testAsync() {
>        GreeterService service = new GreeterService();
>        Greeter greeter = service.getGreeterPort();
>              long before = System.currentTimeMillis();
>              Response<GreetMeResponse> r1 = greeter.greetMeAsync("one");
>        Response<GreetMeResponse> r2 = greeter.greetMeAsync("two");
>              long after = System.currentTimeMillis();
>              assertTrue("Duration of calls exceeded 6000 ms", after - 
> before < 6000);
>              // first time round, responses should not be available yet
>        assertFalse("Response already available.", r1.isDone());
>        assertFalse("Response already available.", r2.isDone());
>              // after three seconds responses should be available
>        long waited = 0;
>        while (waited < 5000) {
>            try {
>                Thread.sleep(500);
>            } catch (InterruptedException ex) {
>               // ignore
>            }
>            if (r1.isDone() && r2.isDone()) {
>                break;
>            }
>            waited += 500;
>        }
>        assertTrue("Response is  not available.", r1.isDone());
>        assertTrue("Response is  not available.", r2.isDone());
>    }
>
> However the test fails as the second invocation is apparently only 
> made after the first one has returned a response, i.e. it fails with
> junit.framework.AssertionFailedError: Duration of calls exceeded 6000 ms.
> Am I overlooking something or has the async invocation model not been 
> implemented yet?
> There are system tests in place, but these seem to not verify that at 
> some point after the initial (async) invocation, the response is NOT 
> yet available - they only test that it will eventually become available.
>
> Andrea.
>
>


-- 
Freeman Fang
Software Engineer

IONA Asia Pacific Software Development Center
No.2 Floor A Unit Information Center
Zhongguancun Software Park Haidian District,
Beijing, P.R.China

Tel.: +86-10-82825151 -  ex. 551
Fax: +86-10-8282-5210
freeman.fang@iona.com
-------------------------------------------------
Making Software Work Together TM




Xml header is missing in soap message

Posted by Jim Ma <ji...@iona.com>.
Hi all,

I noticed there is no xml header "<?xml version='1.0' encoding=''?>" in our
soap message .   Is this intended ?

I think It is ok in http transport  because we can get the encoding style
from http header . If it is  jms or ftp transport , we should explicitly

define the encoding style .

Thoughts?


Regards

Jim



Re: JAX-WS async calls not async?

Posted by Dan Diephouse <da...@envoisolutions.com>.
Sounds like a bug to me. We definitely need to work out the kinks in our
async handling on both the server and client side yet...

- Dan

On 11/27/06, Andrea Smyth <an...@iona.com> wrote:
>
> With an implementor that sleeps 3 seconds in String greetMe(String name)
> I was expecting the following system test to pass:
>
> public void testAsync() {
>         GreeterService service = new GreeterService();
>         Greeter greeter = service.getGreeterPort();
>
>         long before = System.currentTimeMillis();
>
>         Response<GreetMeResponse> r1 = greeter.greetMeAsync("one");
>         Response<GreetMeResponse> r2 = greeter.greetMeAsync("two");
>
>         long after = System.currentTimeMillis();
>
>         assertTrue("Duration of calls exceeded 6000 ms", after - before
> < 6000);
>
>         // first time round, responses should not be available yet
>         assertFalse("Response already available.", r1.isDone());
>         assertFalse("Response already available.", r2.isDone());
>
>         // after three seconds responses should be available
>         long waited = 0;
>         while (waited < 5000) {
>             try {
>                 Thread.sleep(500);
>             } catch (InterruptedException ex) {
>                // ignore
>             }
>             if (r1.isDone() && r2.isDone()) {
>                 break;
>             }
>             waited += 500;
>         }
>         assertTrue("Response is  not available.", r1.isDone());
>         assertTrue("Response is  not available.", r2.isDone());
>     }
>
> However the test fails as the second invocation is apparently only made
> after the first one has returned a response, i.e. it fails with
> junit.framework.AssertionFailedError: Duration of calls exceeded 6000 ms.
> Am I overlooking something or has the async invocation model not been
> implemented yet?
> There are system tests in place, but these seem to not verify that at
> some point after the initial (async) invocation, the response is NOT yet
> available - they only test that it will eventually become available.
>
> Andrea.
>
>
>


-- 
Dan Diephouse
Envoi Solutions
http://envoisolutions.com | http://netzooid.com/blog