Configuring service components through XML file

Feedback


The service component is used to organize and encapsulate the functions of different service providers into the relative coarse-grained modules, such as the map component, data component, etc. It also supports to organize one or multiple service components into service component set. The service component is configured in the<component> node , and the service component set is configured in the<componentSet> node.

Both the service component and service component set can be combined with a service interface to provide a service instance. Assuming a REST service interface named rest has been configured (See: Configuration for Service Interface Layer), in which the map-world component is bound to the "rest" interface, then the URL for the service instance provided by the map-world component in combination with the rest interface is as follows:

http://<server>:<port>/iserver/services/map-world/rest

http://<server>:<port>/iserver/services/components-rest/rest

The first URI represents the root directory of REST services included in map-world service component; the second URI represents the root directory of the REST services included in service component set, through the latter URI, all the REST services included in map-world, data-world, 3D-sample, and transportationanalyst-sample components can be accessed.

Where, the service interfaces bound to different service components are also not completely the same. Now, the corresponding situation in SuperMap iServer is shown in Table1._Service components and service interfaces comparison table.

Table1. Service components and service interfaces comparison table

Service Component Service Interface Predefined Service Interface
Map Service Component
(MapImpl)
REST Interface (RestServlet)
ArcGIS REST Interface (AGSRestServlet)
Baidu REST Interface (BaiduRestServlet)
Google REST Interface (GoogleRestServlet)
WMS Interface (WMSServlet)
WMTS Interface (WMTSServlet)
rest, arcgisrest1, baidurest1, googlerest1
wms111, wms130
wmts100, wmts-china
Data Service Component
(DataImpl)
REST Interface (RestServlet)
ArcGIS REST Interface (AGSRestServlet)
WFS Interface (WFSSServlet)
WCS Interface (WCSServlet)
rest , arcgisrest1
wfs100, wfs200
wcs111, wcs112
Spatial Analysis Service Component
(SpatialAnalystImpl)
REST/JSR Interface (JaxrsServletForJersey)
WPS Interface (WPSServlet)
restjsr
wps100
Transportation Analyis Service Component
(TransportationAnalystImpl)
REST Interface (RestServlet)
ArcGIS REST Interface (AGSRestServlet)
rest, arcgisrest1
Traffic Transfer Analysis Service Component
(TrafficTransferAnalystImpl)
REST/JSR Interface (JaxrsServletForJersey) restjsr
3D Service Component
(RealspaceImpl)
REST Interface (RestServlet) rest
3D Network Analysis Service Component
(NetworkAnalyst3DImpl)
REST/JSR Interface (JaxrsServletForJersey) restjsr
Spatial Processing Service Component
(GeoprocessorComponent)
GP Interface (GeoprocessorServlet) gpserver
Plotting Service Component
(PlotImpl)
RESTInterface (RestServlet) rest
Address Matching Service Component
(AddressMatchImpl)
RESTInterface (RestServlet)

restjsr

Note 1:Only iServer Advanced Editon and iEdge provide this interface.

Basic structure of service component configuration

The structure of the <component> and <componentSet> in the configuration file is as follows:

<application>
                ...
                <componentSets>
                        ...
                        <componentSet>
                              ...
                        <componentSet/>
                </componentSets>
                <components>
                        ...
                        <component>
                             ...
                        <component/>
                </components>
</application>

Map component configuration

The example below shows how to configure a map service component:

<component name="map-china400" class="com.supermap.services.components.impl.MapImpl"
     interfaceNames="rest,wms111,wms130,wmts100,wmts-china" providers="ugcMapProvider-China400">
        <config class="com.supermap.services.components.MapConfig">
        <useCache>true</useCache> 
        <tileCacheConfig class="com.supermap.services.tilesource.SMTilesTileSourceInfo"> 
            <outputPath>E:/iserver/smiserver_700_10809_3995_win32_chs_zip/webapps/iserver/output/sqlite</outputPath> 
        </tileCacheConfig>  
        <utfGridCacheConfig class="com.supermap.services.tilesource.UTFGridTileSourceInfo"> 
            <type>UTFGrid</type>  
            <outputPath>E:/iserver/smiserver_700_10809_3995_win32_chs_zip/webapps/iserver/output/sqlite</outputPath> 
        </utfGridCacheConfig>  
        <vectorTileCacheConfig class="com.supermap.services.tilesource.SVTilesTileSourceInfo"> 
            <type>SVTiles</type>  
            <outputPath>E:/iserver/smiserver_700_10809_3995_win32_chs_zip/webapps/iserver/output/sqlite</outputPath> 
        </vectorTileCacheConfig>  
        <expired>0</expired> 
        <cacheReadOnly>false</cacheReadOnly> 
        </config>
</component>

Where, the class attribute of the <component> node identifies the implementation class of the map component; the providers attribute is the service provider (collection) used by the map component (see: Configuring the Service Provider Layer); the interfaceNames attribute identifies the service interface to which the service component is bound, and if there are multiple interfaces, they should be separated by "," (See: Configuring the Service Interface Layer). The <config> node is the configuration item that implemented by the map component, and it corresponds to the MapConfig. The following parameters are optional:

Data service component configuration

The example below shows how to configure a data service component:

<component name="data-world" class="com.supermap.services.components.impl.DataImpl"
           interfaceNames="rest,wfs100,wfs200,wcs111,wcs112" providers="ugcDataProvider-World"> 
      <config class="com.supermap.services.components.DataConfig">
            <editable>true</editable>
      </config> 
</component>

Where, the class attribute of the <component> node identifies the implementation class of DataImpl; the <config> node is the configuration item that corresponds to this Data component, namely, the DataConfig. Main parameters:

Service component sets cofiguration

<componentSet> node can assemble one or more service components to a service component set. Here is an example about a <componentSet> node:

<componentSet name="components-rest">
        <component-reference  name="map-world"></component-reference>
        <component-reference  name="3D-sample"></component-reference>
        <component-reference  name="data-world"></component-reference>
        <component-reference  name="transportationanalyst-sample"></component-reference>
</componentSet>

Custom service component configuration

The custom component type can be configured in the system configuration file (iserver-system.xml) as shown in the following example.

 

<component-type  alias="SuperMap Custom Service Component" configClass="com.supermap.services.components.SMConfig">
   com.supermap.services.components.impl.SMImpl
</component-type> 

Where, com.supermap.services.components.impl.SMImol is the implementation class of the custom service component type, and com.supermap.services.components.SMConfig is the configuration class of the custom service component type.

The structure of the <component-type> node in the configuration file is shown as follows:

<server>
     <management>
              …
         <component-types>
                  …
               <component-type>
                      …
               </component-type> 
 
         </component-types>
      </management>
</server>