Configuring service

Feedback


All services of SuperMap iServer are configured through the configuration file. For details, see: iServer configuration file instruction. The domain services are custom service, so the configuration information of the provider and component needs to be added in iserver-services.xml.

This section implemented a service provider and modified the service component, so here we need to modify the configuration file in Creating a service component.

Configuring Component

Modify the Temperature component node as follows:

<!-- Temperature component -->

<component name="Temperature" class="com.supermap.sample.temperature.Temperature" providers="TemperatureProviderset" interfaceNames="rest">

    <config class="com.supermap.sample.temperature.TemperatureParam">

        <mapName>China</mapName>

    </config>

</component>

Note: Here the configuration information of the service interface has not been implemented, so we temporarily use the REST interface.

Configuring ProviderSet

Configure a new providerSet node as follows:

<!-- Temperature providerSet -->

<providerSet name="TemperatureProviderset">

    <provider-reference name="ugcMapProvider-China400"

    <provider-reference name="temperatureProvider" enabled="true"></provider-reference>

</providerSet>

Configuring Provider

Configure temperatureProvider. ugcMapProvider-China400 has been configured as a sample service by default in SuperMap iServer.

<!-- Temperature Provider-->

<provider name="temperatureProvider" class="com.supermap.sample.temperature.TemperatureProvider">

    <config class="com.supermap.sample.temperature.FileSetting">

        <filePath>../Temperature.txt</filePath>

    </config>

</provider>

According to the above configuration, the Temperature.txt file should be placed in %SuperMap iServer_HOME% folder.