
Consuming Web Services
Note: wsimport was removed in JDK 11. It is now available through the jaxws-ri project: see https://eclipse-ee4j.github.io/metro-jax-ws/
Description
To write a BBj program that consumes a Web service, follow the steps listed below:
-
Build or obtain the necessary Java classes for consuming the web service. Often, Web Service providers provide a document called a WSDL. If this is the case:
-
Obtain the file or URL for the WSDL.
-
For Java 9 and below use the wsimport tool, located in the JDK's bin directory, to create the Java classes for consuming the web service. For detailed information on using wsimport, see https://docs.oracle.com/javase/9/tools/wsimport.htm.
-
For Java 11 and later download jaxws-rt and use the wsimport tool located in the bin directory to create the Java classes for consuming the webservice. Downloads for jaxws-rt can be found at https://eclipse-ee4j.github.io/metro-jax-ws/. For detailed information on using jaxws-rt wsimport, see https://eclipse-ee4j.github.io/metro-jax-ws/4.0.0/docs/ch04.html#tools-wsimport
-
-
Include the Java class files or JARs in your BBj classpath, either by modifying the BBj's classpath or creating an SSCP.
-
Use embedded Java to invoke the methods of the generated Java Objects, as described in the "Consuming the Web Service" section of the Advantage article From Legacy to Enterprise With BBj Web Services.
Before trying to consume a Web service from within a BBj program, first
ensure that the machine running BBjServices has the proper configuration
for consuming Web services.
A BBj program cannot consume Web services without the proper configuration,
just as a BBj program cannot make network calls without a server machine
network connection.
Example
1. CCOS demo from the BASIS Launchdock detailed in From Legacy to Enterprise With BBj Web Services
2. Jump on the BUS – BASIS Update Service!