Hello!

Is it possible to call a SOAP over JMS based webservice in async mode?


I'm generating the webservices with CXF codegen with an async binding XML +
"-asyncMethods". The invocation is implemented with callback style and
there is no error, but the AsyncHandler's handleResponse() method didn't
invoked.

Any idea?

Maven plugin (maven 3.1.1 + CXF 3.0.5):
<plugin>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-codegen-plugin</artifactId>
                <version>${cxf.version}</version>
                <executions>
                    <execution>
                        <id>wsimport-generate-code</id>
                        <phase>generate-sources</phase>
                        <configuration>

<sourceRoot>${project.build.directory}/generated-sources/jaxb</sourceRoot>
                            <wsdlOptions>
                                <wsdlOption>

<wsdl>${project.basedir}/src/main/resources/wsdl/service.wsdl</wsdl>
                                    <bindingFiles>

<bindingFile>${basedir}/src/main/resources/jaxws/async-binding.xml</bindingFile>
                                    </bindingFiles>
                                    <extraargs>

<extraarg>-autoNameResolution</extraarg>
                                        <extraarg>-verbose</extraarg>

<extraarg>-asyncMethods=PortName#methodName</extraarg>
                                    </extraargs>
                                </wsdlOption>
                            </wsdlOptions>
                        </configuration>
                        <goals>
                            <goal>wsdl2java</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

CODE:
...
Future<?> response = client.methodAsync(HeaderData, in, new
AsyncHandler<ResponseType>() {

                @Override
                public void handleResponse(Response<ResponseType> res)
{
                    LOGGER.info("answer");
                    try {
                        handleAsyncResponse(headerData, res.get());
                    } catch (InterruptedException | ExecutionException ex) {
                        LOGGER.error("InterruptedException |
ExecutionException", ex);
                    }
                }
            });
...

Thanks in advance!


Greetings:
Peter

Reply via email to