简体   繁体   中英

How to create a complete java soap web service (jax-rpc) project (not just client code) a wsdl file?

I have a legacy system that uses soap java web service that "queries" mainframe to retrieve data. The problem is that the war file in production doesn't have a corresponding project(don't know how that happened). Using the wsdl, is there a way to re-create the java classes that would give me code that will allow me to see how the mainframe is queried or modify the code? I don't want the client code but the actual implementation code.

I tried using SoapUI Generate Code option but the jax-rpc artifact requires wscompile, which isn't shipped in the jdk anymore.

You could for example use NetBeans to help you generate some classes:

  • Create a new (Maven) Java Web Project
  • right click on the main project node
  • "New"
  • "other"
  • "Web Services"
  • select "Web Service from WSDL" on the right
  • choose a "web serice name"
  • define the packages for your web service classes
  • and browse for a WSDL file (or enter the URL of the current service)

It will generate all classes you need to understand and answer to web service calls. When you used maven earlier, it will configure it to generate the sources everytime you build. So altering the classes manually is not recommended.

This is just the easy way - you can also configure the maven pom yourself to generate the classes using JAX

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