Use the New Service wizard to create a new Java service.
To create a Java service:
Verify that you have completed the setup for the Java service.
In the Service Development perspective, Select File|New|Service from the menu bar. For other ways to access the New wizard, see Wizards.
The New Service wizard opens.
Select Java Service from the Service Selection Page, and click Next.
Select the project and parent folder in which to create the service, and assign the file a unique and descriptive name. Optionally:
Click Add Java Nature to Project to enable compilation of Java files in the project.
Click Add Service Invocation JARs to Project to configure the project class path with the entries required to call other services from your Java service.
Click Next.
From the Service Overview page, the Service Type Information pane completes automatically. In the Service Information pane, complete the following:
Service Information pane
Field | Description |
---|---|
Name | Edit the file name. The wizard automatically enters the same name as the service file in your project. For easy reference in the future, keep the names consistent. NoteSybase WorkSpace does not support the use of the # character in a service file name. |
Category | Enter a new category, or select an existing category from the drop-down list. NoteIf you create multiple services, you can group services into meaningful categories. Doing so can simplify later tasks, such as finding related services in the Service Explorer. |
Description | Provide an internal description, such as an explanation of how and where you can use the service. You can also add notes for other developers who may implement this service. |
Decide how to create the Java service and select one of the options from the following table.
Implementation Type options
Field | Description |
---|---|
From New Source File (.java) | Creates the service from scratch. The New Service wizard creates a new Java source file using the class and package name that you specify. You can define the service interface and create the Java implementation after the wizard completes. |
From New Source File Generated From WSDL Interface (.wsdl) | Creates a new Java source file with method prototypes matching the service operations in the specified WSDL file. Use this option if you have an existing interface defined in WSDL and want to implement it as a Java service. NoteSee WSDL Documents for information on restrictions for externally sourced WSDL files. |
From Existing Source File (.java) | Create the service from an existing Java source file that defines a public class or interface. Use this option if you have existing source code that closely matches the operations that you want to expose in the service interface. |
From Class File (.class) | Creates the service from a compiled Java class or interface. You can select public methods in the class to become service operations; however, you cannot add or edit operations to the service interface. Use this option if you do not have access to the Java source code or if you want to use the class as-is. |
Depending on the implementation type you chose in the previous wizard page, specify the information described in the following table.
Specify the source file, class file, WSDL file, or new Java class name
Wizard page title | Action required |
---|---|
Java Class | When creating a new source file, specify the project source folder, the package name, class name, and other details for the class to be created. For additional information on the fields in this page, place the focus in the Wizard page and press F1. |
Choose Source File | Type the path to the Java source file, or browse to select the file. |
Choose Class File | Type the path to the Java class file, or browse to select the file. |
Specify WSDL File | Specify the WSDL file that defines the service interface. You can choose:
|
Specify any JAR files or file system directories that must be added to the class path to load dependent classes. If you are defining a service from an existing Java class or source file, add any items that are required in the runtime or compile-time class path. For details on using this page, see classpath folder or library dependencies.
If you are creating the service from a class, WSDL, or source file, choose the operations to expose in the service interface. The wizard displays the available Java methods or WSDL operations. Select those that you want to expose in the new Java service.
Review the information on the Summary page, which displays a summary of the settings for the new service. To edit a value, click Back.
Click Finish to complete the service. The service file appears in the Navigator and the Java Service editor opens.
Creating a Java Service for Date and Time Comparisons
Send your feedback on this help topic to Sybase Tech Pubs: pubs@sybase.com