简体   繁体   中英

Create webservice from wsdl

Is there a way to generate corresponding web service (server) from existing wsdl file in java (specially by using Intellij IDEA)?

It seems a very simple question, but I can't find any solution.

I would be surprised if it exists. The wsdl describes the interface of the service, ie what are the available methods, what parameters do they require, what do they return, thrown exceptions, ...

Getting an implementation from an interface requires thinking :

  • knowing exactly what the methods are supposed to do
  • choosing a way, among many other possible ways, to achieve it

As far as I know wsimport allows you to create a proxy on the client side, which is not what you're asking for.

Use JAX-WS wsimport which is a commandline tool

The wsimport tool generates JAX-WS portable artifacts, such as:

  • Service Endpoint Interface (SEI)
  • Service
  • Exception class mapped from wsdl:fault (if any)
  • Async Reponse Bean derived from response wsdl:message (if any)
  • JAXB generated value types (mapped java classes from schema types)

http://docs.oracle.com/javase/7/docs/technotes/tools/share/wsimport.html

The method you are using is called Top-Down or Contract first this might help you googling for future problems.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM