7

This questions may be silly but I haven't found a way to get a WSDL 2.0 generated by a JAX-WS RI Web service.

I've been using the latest jax-ws version and if I create a very simple WS (such as the example below), the generated WSDL will be version 1.1.

    @WebService
    public interface RandomNumberGenerator {

        Integer getRandomNumber();

    }

    @WebService(endpointInterface="RandomNumberGenerator")
    public class RandomNumberGeneratorImpl {

       public Integer getRandomNumber() {
            return (int) (Math.random() * 1000);
       }    
    }

Does anyone know how I explicitly tell JAX-WS to generate a WSDL 2.0? Considering 2.0 is the W3C recommendation since 2007, I'm pretty confident JAX-WS does offer a way to generate it.

Thanks.

1 Answer 1

7

I'm pretty confident JAX-WS does offer a way to generate it.

I'm afraid, it does not. To quote from the JAX-WS 2.0 specification, page 2, section Goals:

WSDL 2.0: The W3C is expected to progress WSDL 2.0[11] to Recommendation during the lifetime of this JSR. JAX-WS 2.0 will add support for WSDL 2.0 whilst requiring continued support for WSDL 1.1. Note: The expert group for the JSR decided against this goal for this release . We will look at adding support in a future revision of the JAX-WS specification.

This means that there will be no WSDL 2.0 support in JAX-WS 2.0 which is why the reference implementation does not provide it. Afaik, there is not much advance in this area at the moment.

If you want WSDL 2.0 along JAX-WS, you will have to use another stack, such as Axis2.

2
  • 1
    Has this changed by now ? Is it now possible ? How is it in case of glassfish 4?
    – bastiat
    Nov 17, 2015 at 12:12
  • 2
    There has been no update to JAX-WS (nor is one planned for Java 9, afaik), so this has not changed. I am also not aware of WSDL-related updates in glassfish 4. To be honest, I would be very surprised if WSDL 2.0 would ever be supported.
    – joergl
    Nov 17, 2015 at 13:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.