We first need to define a service. Our first service will be named learningFirstService
.
In the folder ${component:learning}
, create a new folder called servicedef
. In that folder, create a new file called services.xml
and enter into it this:
<?xml version="1.0" encoding="UTF-8" ?> <services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "http://www.ofbiz.org/dtds/services.xsd"> <description>Learning Component Services</description> <service name="learningFirstService" engine="java" location="org.ofbiz.learning.learning.LearningServices" invoke="learningFirstService"> <description>Our First Service</description> <attribute name="firstName" type="String" mode="IN" optional="true"/> <attribute name="lastName" type="String" mode="IN" optional="true"/> </service> </services>
In the file ${component:learning}\ofbiz-component.xml
, add after the last <entity-resource>...