cancel
Showing results for 
Search instead for 
Did you mean: 

JAX-WS client asynchronous programming.

Former Member
0 Kudos

In am using NWDS of NWCE EHP1.

Through the wizard in NWDS I would like to generate the async SEI.

To this purpose, I created a binding declaration file where I inserted the <jaxws:enableAsyncMapping> binding to enable asynchronous mapping. I tried to attach that element either to <wsdl:definitions> or to <wsdl:portType>, but I

couldn't get the async SEI anyway.

Before going any further, I have a basic question:

Is the client async programming not-supported or am I missing something?

Thanks in advance.

Livio

Accepted Solutions (0)

Answers (1)

Answers (1)

siarhei_pisarenka3
Active Contributor
0 Kudos

Hi Livio

I'm not getting what you mean by 'client async programming'. If you need to invoke WS asynchronously you can use the following code.

Standard JAX-WS interface:

public interface Dispatch<T> {
...
Response<T> invokeAsync(T msg);
...
}

Example:

Dispatch<Source> sourceDispatch = service.createDispatch(portQName, Source.class, Service.Mode.PAYLOAD);
Response<StreamSource> response =  sourceDispatch.invokeAsync(new StreamSource(new StringReader(request)));

BR, Sergei

Former Member
0 Kudos

Hi Sergei,

I have been out for a long time and I have seen your post only today. Thanks for your suggestion.

Let me explain more precisely what I am trying to do.

The asynchronous API can be used either dynamically, through a Dispatch object, or statically, through a proxy.

I want to use it statically, through a proxy.

The wizard that generates the proxy, by default, generates only the synchronous interface.

I would like it to generate also the asynch interface.

This should result in 3 methods for each operation:

1. synchronous

2. asynchronous polling

3. asynchronous callback

I get only the first method; the last two are missing.

BR, Livio.