Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Corona HowTo Web Service
Eclipse Home | Wiki Home | How To... |
Corona's server-side environment supports the deployment of an OSGi service as web service endpoints. When an OSGi service is registered, a special web service deployer service will check if the newly registered service should also be deployed as a set of web service endpoints.
To enable an OSGi service to be deployed as web service endpoints, the service must have the following properties defined:
- web.service.name
- The name of the web service endpoints
- web.service.context
- The context to be associated with the web services
- interface.class
- The name of the interface class that defines the endpoints to be exposed as web services
Steps
- Create the interface that defines the web service endpoints
- Create the class implements the web service endpoint interface
- Register the OSGi service
- via Declarative Services
- via Code
Example
The following is an OSGi Declarative Services deployment descriptor used to register the OSGi service for Corona's ProjectContainerManager. Notice the use of service properties to specify the additional parameters required to deploy the OSGi service as web service endpoints.
<component name="corona.container.project.manager" immediate="true">
<implementation
class="org.eclipse.corona.container.project.manager.service.ProjectContainerManager"
/>
<service>
<provide
interface="org.eclipse.corona.container.project.manager.IProjectContainerManager"
/>
</service>
<property name="container.type" type="String" value="ProjectContainer" />
<property name="service.type" type="String" value="local" />
<property name="web.service.name" type="String" value="ProjectContainerManager"
/>
<property name="web.service.context" type="String" value="ProjectContextContainer"
/>
<property name="interface.class" type="String" value="org.eclipse.corona.container.project.manager.IProjectContainerManager"
/>
<reference name="SoaWebService" cardinality="1..1" policy="dynamic"
interface="org.eclipse.corona.soa.webservice.IWebServiceDeployer" />
</component>