Trading Networks 10.3 | Administering and Monitoring B2B Transactions | Service Development Help | Building Java Services in Your Own IDE | How Java Services are Organized on Integration Server
 
How Java Services are Organized on Integration Server
A Java service is a public static method of a Java class file on Integration Server. Java services use the following naming scheme:
*The service name represents the Java method name.
*The Integration Server folder name represents the fully qualified Java class name.
All Java services that reside in the same Integration Server folder are methods of the same class.
Services that reside in nested folders are implemented in a class that is scoped within a Java package. The Java package name corresponds to the nested folder names that contain the Java service folder. For example, a service named recording.accounts:createAccount is made up of a Java method called createAccount in a Java class called accounts within the recording Java package.
When building a Java service in your own IDE, it is helpful to understand how Java services are stored in Integration Server. Integration Server stores information about services within its packages directory, specifically in the namespace (ns) and code directories of a package.
The Namespace Directory
Each package on Integration Server has a namespace directory, called “ns.” The following is an example of the namespace directory for a package called “purch”:
Integration Server_directory \instances\instance_name\packages\purch\ns
The ns directory contains information about the services and folders in the package. For a service, the ns directory contains information about properties of the service (for example, statelessness) and the input and output parameters of the service (if they have been defined).
When you build a Java service in your own IDE, you must use the jcode utility to generate the service and folder information for the namespace directory, including the node.ndf file so that the Java service becomes a part of the Integration Server namespace. Additionally, Designer obtains the service information from the ns directory. After running the jcode utility to populate the namespace for a service, you can view and/or edit the service in Designer. For more information, see Using the jcode Utility and Using jcode frag/fragall to Split Java Source for Designer .
Important:
Although you might want to examine the contents of the Integration Server namespace directories, do not manually modify this information. Only modify this information using the appropriate Software AG tools and/or utilities. Inappropriate changes, especially to the ns directory of the WmRoot package, can disable Integration Server.
The Code Directory
The source and compiled code for a Java service is stored in the code directory of a package.
*Each package on the server has a code\source subdirectory that holds the Java source code for that package, if it is available. The following shows the path to the code\source subdirectory for the purch package:
Integration Server_directory \instances\instance_name\packages\purch\code\source
When you build a Java service in your own IDE, save its source file in the code\source directory (subject to the normal Java constraints based on package declarations). You must name the files and intermediate directories according to the name of the service you are installing.
The following shows the location of the source for the recording.accounts:createAccount service:
Integration Server_directory \instances\instance_name\packages\purch\code\source\recording\accounts.java
The source code for the createAccount service is a method in accounts.java.
*The code\classes subdirectory contains the compiled code for a Java service (that is, the class file). The following shows the directory path to the classes in the purch package:
Integration Server_directory \instances\instance_name\packages\purch\code\classes
When you build a Java service in your own IDE, you need to add the Java class file to the code\classes subdirectory. You can do so by using the jcode utility to compile the Java source. For more information, see Using the jcode Utility and Using jcode frag/fragall to Split Java Source for Designer .
The following shows the location of the class file for the recording.accounts:createAccount service:
Integration Server_directory \instances\instance_name\packages\purch\code\classes\recording\accounts.class
The createAccount service is a method of the accounts class.