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:
- <accessControlAllowOrigin>: Used to configure which services can cross-domain access the REST service, can be filled with one domain name. When the value is “*”, it means all services can cross-domain access the current REST service.
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:
- <version>: WMS service version. Currently, supports 1.1.1 and 1.3.0.
- <crs>: The specified coordinate system of WMS interface, valid when <version> is 1.3.0. Optional.
- <srs>: The specified coordinate system of WMS interface, valid when <version> is 1.1.1. Optional.
- <cacheEnabled>: Whether to use cache. Optional.
- <sld>: SLD (Styled-Layer Descriptor) information contained in WMS service. Currently supports the point, line, region and text layers of WMS 1.1.1.
- <serviceDescription>: WMS service description information. Optional.
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:
- <maxFeatures>: Used to set the default number of queried records returned from the server, default value is 2000. If it is set to 0 or -1, it will return all records. Optional.
- <namespaceConfig>: WFS namespace configuration. For example, set the root URI of namespace, initialize feature type list and so on. Optional.
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:
- <customEntireBounds>: Used to specify the entire map extent in WMTS service. Some third-party clients, such as OpenLayers 2.10 requires the extent of WMTS service must be consistent with the base map extent when overlaying WMTS services. Optional.
- <identification>: Service description information. Optional.
- <maps>: The names of the maps that are allowed to be published, with "," separating multiple map names. Optional.
- <provider>: Service provider. Optional.
- <tileMatrixSets>: All scale sets supported by WMTS service. If the scale set is null or scale is null, Level 0 will display the entire map with one 256x256 pixel image tile; Level 1 will display the entire map with 2*2 image tiles, each tile is 256*256 pixel; Level 3 uses 2*2*2 image tiles, and so on. Optional.
- <verifyMode>: Used to set the WMTS service verification mode for verifying the received request parameters from client side. The default is DEFAULT, representing that iServer is compatible with the standard mode. This mode is compatible with some parameters, such as service, style and so on. If it is set as STANDARD, it uses OGC standard mode. Optional.
"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:
- <version>: WCS service version. Currently, supports 1.1.1 and 1.1.2.
- <identification>: Service description information. Optional.
- <provider>: Service provider information. Optional.
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>