1

This is my first time creating Asynchronous Web Service clients. I have my wsdl file but I'm confused where to put:

<enableAsyncMapping>true</enableAsyncMapping>

Based on research, this is how to add it:

<bindings
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    wsdlLocation="AddNumbers.wsdl"
    xmlns="http://java.sun.com/xml/ns/jaxws">
    <bindings node="wsdl:definitions">
        <package name="examples.webservices.async"/>
        <enableAsyncMapping>true</enableAsyncMapping>
    </bindings>
</bindings>

Should this be in a separate file or something? I read about the bindings file but still confused how to use it.

or can it be placed in the same WSDL file itself?

I am using the wsimport command to generate the client classes

1 Answers1

0

I know it is old, but I needed it and google sent me here. It might help someone else in the future.

Using suggestions in one of the answers of this related question on wsimport, I created a custom xml file async.xml like this:

<jaxws:bindings xmlns:jaxws="http://java.sun.com/xml/ns/jaxws">
   <jaxws:enableAsyncMapping>true</jaxws:enableAsyncMapping>
</jaxws:bindings>

And used wsdl2java with the following options (-b async.xml):

wsdl2java -client -d ClientDir -b async.xml myservice.wsdl

And I got the same (and more) version of the stubs returning Future<?>:

public Future<?> authorize

Cheers

Sergio
  • 89
  • 1
  • 6