REST API in SuperMap iServer can quickly publish GIS services, which can be realized by POST request of workspaces resources, currently only supports UGC workspace data.
The REST access method needs verification information like containing Cookie in the header of the HTTP request. The protected REST resource can also be accessed based on Token, in which Cookie can be gotten when login while SuperMap Token can be get with the token resource.
Sample: With the workspaces resources, you can quickly publish the workspace, and create the REST map service, REST data service and WMS111 service, and carry token=9AUyV9QOpTARW-Zj1yybXZM2718buccAX0i6yPTLbQ6OO5BlhP7QE71Dz0RylqkdH33rU3-ZYxslYR-ay0XnXA.. .
Send the POST request to the workspaces resource:
http://localhost:8090/iserver/manager/workspaces.rjson?returnContent=true&token=9AUyV9QOpTARW-Zj1yybXZM2718buccAX0i6yPTLbQ6OO5BlhP7QE71Dz0RylqkdH33rU3-ZYxslYR-ay0XnXA..
Publish World.sxwu as data service, map service and WMS1.1.1 service and introduce the rjson request body as illustrated below:
{
"servicesTypes": ["RESTMAP", "RESTDATA", "WMS111"],
"workspaceConnectionInfo": "../samples/data/World/World.sxwu"
}
Where
- servicesTypes: Sets the service type in accordance with interface. You can set multiple services, and the server will return the created services one by one like ["RESTDATA", "RESTMAP", "WMS111", "WFS100"]. For more information, please see ServiceType.
- workspaceConnectionInfo: Sets the path of the file workspace or connection information of the database workspace. The path of the file workspace can be absolute or relative, such as "/ samples / data / World / World.sxwu.." Or "D: \ \ samples \ \ data \ \ World \ \ World.sxwu", if you set the password, then they should be passed in together like "password = test". For the database workspace, please refer to Table 1 Descriptions of database connection parameters. Sample (connection information of database datasource):
"workspaceConnectionInfo":"server=orcl203;username=test;password=test;type=ORACLE;database=;name=testWorkSpace;driver=null"
After sending the above POST request, the server returns a created list of services as follows:
[{
"serviceAddress": "http://localhost:8090/iserver/services/map-world2/rest",
"serviceType": "RESTMAP"
},
{
"serviceAddress": "http://localhost:8090/iserver/services/data-world2/rest",
"serviceType": "RESTDATA"
},
{
"serviceAddress": "http://localhost:8090/iserver/services/map-world2/wms111",
"serviceType": "WMS111"
}]
Namely addresses of the three quickly created service instances, in which if the service component name is repeated, then it will automatically increase the number suffix like map-world2.