Creating a C/C++ Service
Before you can create a C/C++ service, make sure the following conditions are true:
The
Integration Server on which you want the C/C++ service to reside is running and connected to
Designer.
If you want to use Unicode characters in the C/C++ service, you need to change the text file encoding preference. To do so, in the Workspace preferences, select
Other under
Text file encoding and select or type a new encoding.
To create a C/C++ service
1. In the Package Navigator view of Designer, select File > New > C Service.
2. In the New C Service dialog box, select the folder in which you want to save the service.
3. In the Element name field, type the name for the C/C++ service.
4. If you have a template you want to use to initialize a default set of properties for the service, select it from the Choose template list. If you want to apply the default properties to the service, select Default from the Choose template list. Click Next.
5. Select the platform that describes the machine on which your Integration Server is running (Designer needs to know this in order to build the right make file). Click Next.
6. Select the specification that defines the inputs and outputs for this service.
7. Click Finish. Designer refreshes the Package Navigator view and displays the new service in the C/C++ service editor.
8. Specify service properties using the Properties view.
To... | See... |
Specify the service run-time parameters | |
Configure the service to retry automatically if the service fails because of an ISRuntimeException | |
Track when the service is started and completed and whether the service succeeded or failed | |
Assign a universal name to the service | |
Assign an output template to the service | |
9. Optionally, generate starter code for the service based on the declared input and output parameters.
Designer adds initial code to the C/C++ service. For all C/C++ services,
Designer adds the package definition, class definition, primary method definition, and a minimum set of imports. If the service is the second or subsequent C/C++ service created in the same IS folder,
Designer also adds any shared code defined in other C/C++ services in the IS folder, additional imports, extends, and implements.For more information, see
Generating C/C++ Code from Service Input and
Output Parameters.
10. Add and modify the code on the Source tab. You can specify declarations, methods, etc. to the initial code that Designer generates.
You can use the webMethods Integration Server Java API in your service. For more information, see webMethods Integration Server Java API Reference.
11. Optionally, specify usage notes or comments in the Comments tab.
12. Select File > Save.
Designer compiles the C/C++ service on Integration Server and displays the compilation error messages from the server. Designer also writes the error messages to the Designer log file making them visible within the Error Log view.
When you create a C/C++ service, Designer generates a source code file and a make file and places these files in the following directory:
Integration Server_directory \instances\instance_name\packages\packageName\code\source
The names of the files will match the service name you specified in Designer. The source code file will be named <servicename>.c and the make file will be <servicename>.mak.
Designer also compiles the C/C++ service locally in the Service Development Project. Additionally, if the workspace preference
Build Automatically is selected,
Designer rebuilds other classes in the Service Development Project at the same time.
Designer adds compilation errors from the local compilation to the Problems view. If Problems view is not already open, you can open it by selecting
Window > Show View > Problems. To view the line of code that caused the error, double click on the error in the Problems view and
Designer shifts focus to the C/C++ service editor, with the cursor positioned at the line of code that caused the error. For more information, see
Compiling the C/C++ Source Code.
Note: | If your C/C++ service requires additional classes to compile, you must add them, either as individual class files or in jar files, to both the Service Development Project and to Integration Server. If you have set up IS package dependencies for a C/C++ service and if the service requires classes or jar files in these IS packages to compile, you must manually add the classes or jar files to Service Development Project. For more information, see Adding Classes to the Service Development
Project. For more information about adding classes to Integration Server and how Integration Server stores package information, see webMethods Integration Server Administrator’s Guide. |
Related Topics