Create the Service Endpoint Interface, and then use the Web service wizard to create the files required for the Web service application.
Creating a Service Endpoint Interface
Create an interface in Java for a service to be made publicly available as a Web service.
From [New] wizard, select [Interface] and create the Service Endpoint Interface.
The service endpoint interface must satisfy the following conditions:
It extends java.rmi.Remote.
Any defined method for it declares java.rmi.RemoteException in the throws clause.
Note
When defining a method, comply with the range of data types that can be used. For details on the data types that can be used, refer to the "Interstage Application Server J2EE User's Guide".
Generating the files required for a Web service
You can use the Service Endpoint Interface to create files required for creating a Web service. From [New] wizard, select [Web Service] > [IJServer] > [Web Service (JAX-RPC)] and use the wizard to create the files. See below for the wizard settings.
[Service endpoint related information] page
Option | Description | |
---|---|---|
Source folder | Specify the destination folder for the implementation template class to be created. | |
Service end point interface name | Specify the fully qualified name of the service endpoint interface to be made open for the Web service. The specified service endpoint interface must satisfy the following conditions:
| |
Implemented template class | Specify information on the implementation template class. | |
Package | Specify the package for the implementation templates to be created. | |
Implemented template class name | Specify a name for the implementation template class to be created. | |
Not overwrite | To prevent overwriting of an existing implementation template class, select this option. |
[WSDL file related information] page
Option | Description |
---|---|
WSDL file name | Indicates a name for the created WSDL file, using a path relative to ContextRoot. |
style attribute/use attribute | Specifies a combination of the style attribute and use attribute for writing to the WSDL file. One of the following combinations can be specified:
To satisfy the requirements in WS-I Basic Profile 1.0, specify DOCUMENT/LITERAL or RPC/LITERAL. |
Location information | Specifies the endpoint URL used to access the Web service. |
Attached file | Specifies how to create a WSDL to develop an application that handles attached files in a Web service. One of the following two methods can be selected:
To create a WSDL file conforming to WS-I Attachments Profile 1.0 by using the attached files, specify [WSDL file is created conforming to WS-I Attachments Profile 1.0] by using the javax.activation.DataHandler class with a service end-point interface. If the following classes used in the attached files are used when [WSDL file is created conforming to WS-I Attachments Profile 1.0] is specified, a creation error occurs:
If a class other than the javax.activation.DataHandler class is used, conversion from binary data to a Java object prevents the original file data from being completely retained. Therefore, the recommended class for use is the javax.activation.DataHandler class. |
Note
Before you can use the Web Service wizard, the Interstage Application Server function or Interstage Application Server client package must be installed.
Since the Web Service(JAX-RPC) wizard examines a class file (.class) to acquire required information, the service endpoint interface must be compiled before activation of the wizard.
Point
In the initial workbench state, options are configured such that a build is automatically performed when a file is saved. If no compile error occurs in the process of saving the service endpoint interface, there is no problem.
If you choose the service endpoint interface in Project Explorer when starting the Web service wizard, the wizard service endpoint interface name and other input items are set as initial values.
The table below lists files created by the Web Service wizard.
Created file | File name | Description |
---|---|---|
Web service endpoint | <Service-endpoint-interface-name>SOAPBindingImpl.java | Defines the service endpoint interface implementation class. A Web service implementation is defined in this class. The file is created in the source folder and identified from the package and name specified with the wizard. |
WSDL file | <Service-endpoint-interface-name>.wsdl | Contains a Web service interface definition. The file is created at the level immediately below ContextRoot/WEB-INF/wsdl. |
deployment descriptor | webservices.xml | Contains Web service deployment information. The file is created at a level below ContextRoot/WEB-INF. (If an existing file has the same name, this information is added to the existing file.) |
web.xml | Contains WAR file deployment information. The file is created at a level below ContextRoot/WEB-INF. (If an existing file has the same name, this information is added to the existing file.) | |
Other file | <WSDL-file-name>_mapping.xml | Automatically generated file required for running a Web service. The file is created at a level below ContextRoot/WEB-INF. |
Point
For the rules used during file creation regarding conversion from the Java type to an XML type for WSDL, refer to the "Interstage Application Server J2EE User's Guide".
Editing WSDL files
Use a WSDL editor to edit WSDL files. For details on WSDL editors, refer to "WSDL Editor".
Validating the propriety of a WSDL file
The following validator is provided as a WSDL propriety validation tool:
WSDL validator
To execute this validator during build, select the [Validation] builder, and then enable execution of the validator in the [Validation] properties. In the general settings, execution of this validator is enabled.
You can use the above validator for validation even when no build is in progress, by selecting [Validate] from the context menu with the target resource selected.
Editing Deployment Descriptors
To edit the deployment descriptors below, use an XML editor (for details on XML editors, refer to "Editing XML Files"):
webservices.xml
web.xml (if providing a Web service as a Web application)
ejb.xml (if providing a Web service as an EJB application)
Implementing a Web service application
Implement your Web service application. Write the Web service implementation code in the Web service endpoint file created by the wizard.
Normally, you need not edit the other created files. If you need to edit any of these files, make sure you have a good understanding of the file. For details on each file, refer to the "Interstage Application Server J2EE User's Guide".
Point
If the service endpoint interface uses a Holder class, parameters are treated as INOUT parameters. To treat parameters as OUT parameters, edit the WSDL file.