OFBiz "Services" are reusable code snippets implemented as Java methods. What makes using OFBiz Services so compelling? Unlike OFBiz Events or servlets, the Service context is controlled by OFBiz, thus relieving the programmer from having to do such mundane tasks as managing transactions, handling retries, and validating input and output values. Once written, a Service may be invoked as many times and by as many Service consumers as required.
To start writing Services, we must first perform the following:
1. Navigate to the Component's source directory containing the Java class file to be used for the new Service method.
2. Check for any Java class or JAR file dependencies in the
build.xml
file.3. To test your Service, create a web page with a form to call the new Service.
4. Create an entry in the
controller.xml
file to allow access to your Service.5. Navigate to the OFBiz Component where the Java class file containing the source for your Event exists...