Creating a new Service definition

OFBiz is made aware of a Service by the presence of a Service definition within a Service definition file. Each OFBiz Service has a Service definition that configures the Service with a name, location information, Service implementation engine type, and other optional parameters.

How to do it...

To create a new Service definition, follow these steps:

  1. Find an existing Service definition file or create a new one.
  2. Add one or more service element XML declarations. For example:
    <service name="someName" engine="one_of_the_available_engines"
    location="component_or_CLASSPATH_location"
    <!-- Add any INPUT/OUTPUT attribute elements here -->
    <!-- Add a PERMISSION-SERVICE element -->
    <!-- For Simple Services, add any AUTO-ATTRIBUTE elements -->
    </service>
    
  3. Make sure the new Service definition element has a closing</services> tag.
  4. Save and close the file.
  5. Restart OFBiz.

How it works...

Using Service definitions, OFBiz removes Service location and implementation details from the Service and "injects" these values at runtime. This enables the Service developer to concentrate on implementing business logic and the Service consumer to call the Service without regard for location or implementation details.

When a Service is called, OFBiz automatically locates the Service on the CLASSPATH by consulting the Service's Service definition, manages all defined context parameters and passes control to the appropriate Service implementation engine.

See also

All supported Service definition configurations are documented in the Service definition file XML schema located at:

~framework/service/dtd/services.xsd

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.174.23