Legacy platform

Building web services on WebSphere®

You can expose APIs and synchronous SDF services through web services. Web services require some configuration prior to running the buildear script to create the application EAR and web services WAR file. The configuration takes place in either the namedwebservices.xml file or webservicebeans.xml file.

There are two types of web services that can be created:

  • EJB: The EJB web service accepts two string inputs and returns one string output. No information about the content of the strings is included in the WSDL for this web service; the caller must open the Javadoc for the API to get the information about how to structure the content. This makes it very difficult to dynamically generate calls to the XAPI web services without an additional source of information beyond the WSDL. This type of web service is created using EJB beans, and is created by default with the application EAR.
    Note: Liberty does not support EJB web services.
  • JAX-WS: The WSDL of the JAX-WS web service includes information about the input expected by the server, the output, and exceptions, which makes it easier to dynamically generate calls to the web services. JAX-WS web services are created using JAXB beans. The advantage of using JAXB beans is that they are fully self-describing and alleviate the need to have access to Javadoc for the API. To facilitate securing JAX-WS based web services, they are created with handlers. You can use the default server and client handlers that are delivered with or create your own, custom handlers.

You can choose to build the application with one or both types of web services.

Note: You can also choose to suppress the web services build by using the -Dnowebservice=true option on the buildear command.
Note: If using EJB based web services or using JAX-WS based web services without handlers and API security is enabled, ensure that you expose the Login API. If using custom handlers, this decision will depend upon how your handlers are written. For more information about web services security, see the topics on Secure Deployment.