Configuring service interfaces through XML file

Feedback


Service interfaces have configured network services published by following different service specifications on service interface layer, such as REST service, WMS service, WFS service, WMTS service, WCS service, WPS service and user-defined type service. You can modify the existing interfaces by modifying the service interface configuration file iserver-services-interfaces.xml (See:  iServer Configuration File). The service interfaces are configured in the <interface> node. For more information about parameters of interfaces, see Configuring service interfaces through iServer Manager.

 

Structure of interface configuration file

The name property of <interface> identifies the service interface. It is required, through which the specific type of service can be accessed. For more details, see: Settings of service URI.

The structure of the <interface> node is as follows:

<application>
                ...
                <interfaces>
                        ...
                        <interface>
                             ...
                        <interface/>
                </interfaces>
</application>

Different service interfaces are distinguished by defining different classes. Configuration information is defined with a configuring class. See Table 1 Implementation and configuration of service interfaces for details.

Table 1. Implementation and configuration of service interfaces

Basic type Version Implementation Classes of Service Interfaces Configuration Classes of Service Interfaces
REST
REST/JSR
ArcGIS REST1
Baidu REST1
Google REST1
OSMRestServlet1
TMSRestServlet1
-- com.supermap.services.rest.RestServlet
com.supermap.services.rest.JaxrsServletForJersey
com.supermap.services.rest.AGSRestServlet
com.supermap.services.rest.BaiduRestServlet
com.supermap.services.rest.GoogleRestServlet
com.supermap.services.rest.OSMRestServlet
com.supermap.services.rest.TMSRestServlet
 
 
com.supermap.services.rest.RestConfig
com.supermap.services.rest.JaxrsConfigForJersey
com.supermap.services.rest.AGSRestConfig
WMS 1.1.1
1.3.0
com.supermap.services.wms.WMSServlet com.supermap.services.wms.WMSConfig
WFS 1.0.0
2.0.0
com.supermap.services.wfs.WFSServlet com.supermap.services.wfs.WFSConfig
WCS 1.1.1
1.1.2
com.supermap.services.wcs.WCSServlet com.supermap.services.wcs.WCSConfig
WMTS 1.0.0 com.supermap.services.wmts.WMTSServlet com.supermap.services.wmts.WMTSConfig
WPS 1.0.0 com.supermap.services.wps.WPSServlet com.supermap.services.wps.WPSConfig

Note 1: Only iServer Advanced Edition and iEdge offer this interface.

Configuring a REST interface

SuperMap iServer provides two REST interfaces based on Restlet and Jersey, which correspond to two interface implementation classes: RestServlet and JaxrsServletForJersey respectively.

The example below shows how to configure a Restlet based REST interface:

<interface class="com.supermap.services.rest.RestServlet" name="rest"> 
        <config class="com.supermap.services.rest.RestConfig"> 
                <accessControlAllowOrigin></accessControlAllowOrigin> 
        </config> 
</interface> 

Where, the class attribute of the <interface> node identifies the interface type, which corresponds to the implementation class:  RestServlet; the <config> node is the configuration item that corresponds to the REST service interface, namely, the RestConfig. Main parameters:

The example below shows how to configure a Jersey based REST interface:

<interface class="com.supermap.services.rest.JaxrsServletForJersey" name="restjsr"> 
        <config class="com.supermap.services.rest.JaxrsConfigForJersey"> 
                <accessControlAllowOrigin></accessControlAllowOrigin> 
        </config> 
</interface> 

Where, the class attribute of the <interface> node identifies the interface type, which corresponds to the implementation class: JaxrsServletForJersey; the <config> node is the configuration item that corresponds to the REST service interface, namely, JaxrsConfigForJersey.

The example below shows how to configure a ArcGIS REST interface:

<interface class="com.supermap.services.rest.AGSRestServlet" name="arcgisrest"> 
      <config class="com.supermap.services.rest.AGSRestConfig"> 
        <accessControlAllowOrigin></accessControlAllowOrigin">
        <notUseTransparentTile>false</notUseTransparentTile">
      </config> 
    </interface> 

Where, the class attribute of the <interface> node identifies the interface type, which corresponds to the implementation class: AGSRestServlet; the <config> node is the configuration item that corresponds to the ArcGIS REST service interface, namely, AGSRestConfig. Main parameters:

notUseTransparentTile: Used to set whether the background of pictures returned by tile resource is transparent or not. Default is false, meaning transparent.

The example below shows how to configure a Baidu REST interface:

    <interface class="com.supermap.services.rest.BaiduRestServlet" name="baidurest">
      <config class="com.supermap.services.rest.RestConfig">   
        <accessControlAllowOrigin></accessControlAllowOrigin>
      </config> 
    </interface> 

Where, the class attribute of the <interface> node identifies the interface type, which corresponds to the implementation class: BaiduRestServlet; the <config> node is the configuration item that corresponds to the Baidu REST service interface, namely, RestConfig.

The example below shows how to configure a Google REST interface:

<interface class="com.supermap.services.rest.GoogleRestServlet" name="googlerest"> 
      <config class="com.supermap.services.rest.RestConfig">   
        <accessControlAllowOrigin></accessControlAllowOrigin>
      </config> 
    </interface>

Where, the class attribute of the <interface> node identifies the interface type, which corresponds to the implementation class: GoogleRestServlet; the <config> node is the configuration item that corresponds to the Google REST service interface, namely, RestConfig.

The example below shows how to configure a OSM REST interface:

<interface class="com.supermap.services.rest.OSMRestServlet" name="osmrest"> 
      <config class="com.supermap.services.rest.RestConfig">   
        <accessControlAllowOrigin></accessControlAllowOrigin>
      </config> 
    </interface>

Where, the class attribute of the <interface> node identifies the interface type, which corresponds to the implementation class: OSMRestServlet; the <config> node is the configuration item that corresponds to the OSM REST service interface, namely, RestConfig.

The example below shows how to configure a TMS REST interface:

<interface class="com.supermap.services.rest.TMSRestServlet" name="tmsrest"> 
      <config class="com.supermap.services.rest.RestConfig">   
        <accessControlAllowOrigin></accessControlAllowOrigin>
      </config> 
    </interface>

Where, the class attribute of the <interface> node identifies the interface type, which corresponds to the implementation class: TMSRestServlet; the <config> node is the configuration item that corresponds to the TMS REST service interface, namely,RestConfig.

Note 1: If you want to use these interfaces in iServer: ArcGIS, Baidu, Google, OSM, TMS REST, first you need to purchase iServer Advanced Edition; In iEdge, you can use them directly.

 

Configuring a WMS service interface

SuperMap iServer supports WMS 1.1.1, 1.3.0 services. The example below shows how to configure a WMS 1.1.1 service interface:

<interface name="wms111" class="com.supermap.services.wms.WMSServlet"> 
        <config class="com.supermap.services.wms.WMSConfig"> 
                <version>1.1.1</version>
                <sld>
                        <pointStyles/>
                        <lineStyles/>
                        <polygonStyles>
                                <string>./WEB-INF/config/region.sld</string>
                        </polygonStyles>
                        <textStyles/>
        </sld>
        </config> 
</interface> 

Where, the class attribute of the <interface> node identifies the interface type, which corresponds to the implementation class: WMSServlet; the <config> node is the configuration item that corresponds to the WMS service interface, namely, the WMSConfig. Main parameters:

 

Configuring a WFS service interface

SuperMap iServer supports WFS 1.0.0, 2.0.0 services. The example below shows how to configure a WFS 1.0.0 service interface:

<interface class="com.supermap.services.wfs.WFSServlet" name="wfs100"> 
        <config class="com.supermap.services.wfs.WFSConfig"> 
                <namespaceConfig serialization="custom"> 
                        <unserializable-parents/>  
                        <map> 
                                <default> 
                                        <loadFactor>0.75</loadFactor>  
                                        <threshold>12</threshold> 
                                </default>  
                                <int>16</int>  
                                <int>0</int> 
                        </map> 
                </namespaceConfig>  
                <maxFeatures>0</maxFeatures> 
        </config> 
</interface> 

Where, the class attribute of the <interface> node identifies the interface type, which corresponds to the implementation class: WFSServlet; the <config> node is the configuration item that corresponds to the REST service interface, namely, the WFSConfig. Main parameters:

 

Configuring a WMTS service interface

SuperMap iServer supports WMTS 1.0.0 services, and also provides a wmts-china interface instance that compliant with the map classification used in "Platform for geoinformation common services -- Data specification for electronic map" to dock Tianditu map services and other map services for China.

The example below shows how to configure a WMTS 1.0.0 service interface:

<interface class="com.supermap.services.wmts.WMTSServlet" name="wmts100"> 
        <config class="com.supermap.services.wmts.WMTSConfig"> 
                <identification> 
                        <title>Sample WMTS Service</title>  
                        <description>WMTS service published by SuperMap iServer 6R based on sample data</description>  
                        <keywords> 
                                <string>iServer 6R</string>  
                                <string>Sample Data</string> 
                        </keywords>  
                        <fees>none</fees>  
                        <accessConstraints>none</accessConstraints>  
                        <serviceType>OGC WMTS</serviceType>  
                        <serviceTypeVersion>1.0.0</serviceTypeVersion> 
                </identification>  
                <provider> 
                        <providerName>SuperMap Software Co., Ltd.</providerName>  
                        <providerSite>http://www.supermap.com.cn</providerSite>  
                        <serviceContact> 
                                <individualName>Contact name</individualName>  
                                <positionName>Position</positionName>  
                                <phoneNumber>+86-10-59896503</phoneNumber>  
                                <faxNumber>+86-10-59896666</faxNumber>  
                                <deliveryPoint>SuperMap Software, 6/F, Building 107, No. A10, Jiuxianqiao North Road, Chaoyang District, Beijing, 100015, CHINA</deliveryPoint>  
                                <addressCity>Beijing</addressCity>  
                                <addressAdministrativeArea>Beijing</addressAdministrativeArea>  
                                <addressPostalCode>100015</addressPostalCode>  
                                <addressCountry>China</addressCountry>  
                                <addressElectronicMailAddress>support@supermap.com</addressElectronicMailAddress> 
                        </serviceContact> 
                </provider>  
                <tileMatrixSets> 
                        <com.supermap.services.wmts.TileMatrixSet> 
                                <wellKnownScaleSet>Custom</wellKnownScaleSet>  
                                <scales/>  
                                <dpi>90.7142857142857</dpi>  
                                <tileWidth>256</tileWidth>  
                                <tileHeight>256</tileHeight> 
                        </com.supermap.services.wmts.TileMatrixSet>  
                        <com.supermap.services.wmts.TileMatrixSet> 
                                <wellKnownScaleSet>GlobalCRS84Scale</wellKnownScaleSet> 
                        </com.supermap.services.wmts.TileMatrixSet>  
                        <com.supermap.services.wmts.TileMatrixSet> 
                                <wellKnownScaleSet>GoogleMapsCompatible</wellKnownScaleSet> 
                        </com.supermap.services.wmts.TileMatrixSet> 
                </tileMatrixSets> 
        </config> 
</interface> 

Where, the class attribute of the <interface> node identifies the interface type, which corresponds to the implementation class: WMTSServlet; the <config> node is the configuration item that corresponds to the WMTS service interface, namely, the WMTSConfig. Main parameters:

 

"wmts-china" interface configuration information is shown below:

<interface class="com.supermap.services.wmts.WMTSServlet" name="wmts-china"> 
        <config class="com.supermap.services.wmts.WMTSConfig"> 
                <identification/>   
                <provider/>    
                <tileMatrixSets> 
                        <com.supermap.services.wmts.TileMatrixSet> 
                                <wellKnownScaleSet>ChinaPublicServices</wellKnownScaleSet> 
                        </com.supermap.services.wmts.TileMatrixSet> 
                </tileMatrixSets> 
        </config> 
</interface>

where, <wellKnownScaleSet> parameter specifies using the ChinaPublicServices scale set which follows the map classification standard in "Platform for geoinformation common services -- Data specification for electronic map".

Configuring a WCS service interface

SuperMap iServer supports WCS 1.1.1, 1.1.2 services. :The example below shows how to configure a WCS 1.1.1 service interface:

<interface class="com.supermap.services.wcs.WCSServlet" name="wcs111"> 
        <config class="com.supermap.services.wcs.WCSConfig"> 
                <version>1.1.1</version>  
                <identification> 
                        <title>Sample WCS Service</title>  
                        <description>WCS service published by SuperMap iServer 6R based on sample data</description>  
                        <keywords> 
                                <string>iServer 6R</string>  
                                <string>Sample Data</string> 
                        </keywords>  
                        <fees>none</fees>  
                        <accessConstraints>none</accessConstraints>  
                        <serviceType>OGC WCS</serviceType>  
                        <serviceTypeVersion>1.1.1</serviceTypeVersion> 
                </identification>  
                <provider> 
                        <providerName>SuperMap Software Co., Ltd.</providerName>  
                        <providerSite>http://www.supermap.com.cn</providerSite>  
                        <serviceContact> 
                                <individualName>Contact name</individualName>  
                                <positionName>Position</positionName>  
                                <phoneNumber>+86-10-59896503</phoneNumber>  
                                <faxNumber>+86-10-59896666</faxNumber>  
                                <deliveryPoint>SuperMap Software, 6/F, Building 107, No. A10, Jiuxianqiao North Road, Chaoyang District, Beijing, 100015, CHINA</deliveryPoint>  
                                <addressCity>Beijing</addressCity>  
                                <addressAdministrativeArea>Beijing</addressAdministrativeArea>  
                                <addressPostalCode>100015</addressPostalCode>  
                                <addressCountry>China</addressCountry>  
                                <addressElectronicMailAddress>support@supermap.com</addressElectronicMailAddress> 
                        </serviceContact> 
                </provider> 
        </config> 
</interface>

Where, the class attribute of the <interface> node identifies the interface type, which corresponds to the implementation class:  WMTSServlet; the <config> node is the configuration item that corresponds to the WCS service interface, namely, the WCSConfig. Main parameters:

Configuring a custom interface

The custom interface type can be configured in the system configuration file (iserver-system.xml).

<interface-type configClass="com.supermap.services.sm.SMConfig">
   com.supermap.services.sm.SMServlet
</interface-type> 

Where, the com.supermap.services.sm.SMServlet is the implementation class of the custom interface type, and the com.supermap.services.sm.SMConfig is the configuration class of the custom interface type.

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

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