services


URI

<portal_uri>/services[.<format>]

Supported methods

GET, POST, DELETE, HEAD

Parent resource

portal

Child resources

service, servicesCheckStatus, servicesShareSettings, servicesStatus, batchRegister

Introduction

services resource is the service collection which current user has permissions to view. By sending POST request, a user could apply for a new single service registration; by sending DELETE request, a user could delete services in batch. By default, the service audit function is disabled, which means the process of registering services to iPortal doesn't need an audit by the administrator. The administrator also can open this function, at which point, only the service approved by the administrator can be registered in the iPortal. For a single service checking, please see PUT Request for serviceCheckStatus resource.

Supported Methods:

Supported output formats: rjson, json, html, xml.

Resource hierarchy

HTTP request methods

Implement the HTTP request on the following URI, where supermapiportal is the server name, with rjson being the output format.

http://supermapiportal:8090/iportal/web/services.rjson

GET request

Get service list which can be visited by current users.

Request parameter

Return the service list of the first page which can be visited by users if the parameter isn't set; Return the service list specified by users if the parameter is set. The request parameter must be included in URI.

Field Type Description
tags String[] Filtered by tags.
userNames String[] Filtered by service register name.
types SourceType[] Filtered by service type.
checkStatus CheckStatus Filtered by checking status.
offline Boolean Filtered by service online or offline.
orderBy ServiceOrderBy Filtered by sort field. Here, ordering by the ServiceOrderBy.VISITCOUNT, which means visit count, is available only when enabing the service proxy function.
orderType OrderType Filtered by ascending or descending.
keywords String[] Filtered by keywords.
currentPage int Filtered by page number.
pageSize int Filtered by page size.
isBatch Boolean Filtered by whether services are registered in batch.
dirIds Integer[] Filtered by category ID.
isNotInDir Boolean Filtered by group or not. Default is false. Return service list where services are not grouped, if it is true; Return all services list if it is false.
Ungroup means a service isn't added into the service list.
filterFields FilterFields[] Fields filtering for keyword queries. Field names need to be capitalized. For example, keywords=["admin"]&filterFields=["NICKNAME"] need to be set to filter according to the keyword characters of the registrar.
authorizedOnly Boolean Filter according to whether the service is authorized to access. Default is false, means the list of all the services will be returned; If it is set to true, only the authorized services will be returned. This parameter is available only under service sharing v2 mode.
createStart Long Query services created at this time value or after this time value. If the value is null or less than 0, the start time for service queries is not limited.
createEnd Long Query services created earlier than or at this time value. If the value is null or less than 0, the end time for service queries is not limited.

Response structure

Implement Get request for the service resource, and return the service list which can be visied by current users. It is composed by following fields:

Field Type Description
content List<ServiceInfo> Contents of the page.
currentPage int Current page number.
pageSize int Page size.
searchParameter SearchParameter Search parameter on current page.
total int Total records
totalPage int Total pages.

Response example

The returned rjson format representation after implementing the GET request on the services resource http://localhost:8090/iportal/web/services.rjson is as follows:

If you want to get the specified service list information, for example, filter according to the registrar's key cahracters, you need to set keywords=["admin"]&filterFields=["NICKNAME"],, that is ,execute GET request on services resource: ttp://localhost:8090/iportal/web/services.rjson?keywords=["admin"]&filterFields=["NICKNAME"], the returned rjson format representation is as follows:

POST request

Apply for registering a new single service. By default, the service audit function is disabled, which means the process of registering services to iPortal doesn't need an audit by the administrator. The administrator also can open this function, at which point, only the service approved by the administrator can be registered in the iPortal. For a single service checking, please see PUT Request for serviceCheckStatus resource.

Request parameter

Following arguments need to be included in the request sent.

Name Type Description

type

SourceType

[Optional]
Service type needs to register.

tags

List<String>

[Optional]
Tag type needs to register.

authorizeSetting

List<IportalAuthorizeEntity>

[Optional]
Sharing settings for services that need to register. The permission types include DELETE, READ, READWRITE.

metadata

Metadata

[Optional]
Metadata information of services that need to register.

addedMapNames

Set<String>

[Optional]
The map name list from the 2D map services. Currently, only SuperMap REST service is supported. For other service types, this parameter must be set to null

addedSceneNames

Set<String>

[Optional]
The scene name list from the 3D services. Currently, only SuperMap REST service is supported. For other service types, this parameter must be set to null

Response structure

The structure of the response resource representation after implementing the POST request on the services resource will be as follows:

Field Type Description
newResourceID String New registered service ID.
newResourceLocation String New registered service URI.
succeed boolean Whether new service is registered successfully or not.

Response example

Execute POST request for services resource http://localhost:8090/iportal/web/services.rjson. The request body is as follows:

{

    "type": "SUPERMAP_REST",

    "tags": [

        "china"

    ],

    "authorizeSetting": [

        {

            "entityType": "USER",

            "entityName": "GUEST",

            "permissionType": "READ"

        }

    ],

    "metadata": {

        "mdContact": {

            "rpIndName": "",

            "rpOrgName": "",

            "rpCntInfo": {

                "cntAddress": {

                    "delPoint": "",

                    "eMailAdd": ""

                },

                "voiceNum": "",

                "faxNum": ""

            }

        },

        "refSysInfo": {

            "mdCoRefSys": {

                "projection": ""

            },

            "refSysID": ""

        },

        "dataIdInfo": {

            "dataIdent": {

                "idCitation": {

                    "resTitle": "china"

                },

                "dataExt": {

                    "geoEle": {

                        "geoBndBox": {

                            "westBL": 0,

                            "eastBL": 0,

                            "southBL": 0,

                            "northBL": 0

                        }

                    },

                    "exDesc": ""

                },

                "idAbs": ""

            }

        },

        "distInfo": {

            "onLineSrc": {

                "linkage": "http://192.168.120.40:8091/iserver/services/map-china400/rest"

            }

        }

    },

    "addedMapNames": [

        "China",

        "China_4326"

    ],

    "addedSceneNames": []

}

The response result in rjson format returned is as follows:

{

    "succeed": true,

    "newResourceID": "2",

    "newResourceLocation": "http://192.168.120.40:8090/iportal/web/services/2"

}

DELETE request

Delete services. It supports deleting services in batch. The ID array of services needs to delete during the passing in URI.

Response structure

The structure of the response resource representation is as follows:

Field Type Description
succeed boolean Whether the service has been successfully deleted.
error Httperror Error information. This field will not be displayed if it is deleted successfully.

Response example

Implement the DELETE request on the services resource http://localhost:8090/iportal/web/services.rjson?ids=[1,2], delete services with ID 1 and 2. Return rjson results:

{ "succeed": true}

HEAD request

Asks for the response identical to the one that would correspond to a GET request, but without the response body. This is useful for retrieving meta-information written in response headers, without having to transport the entire content. The meta-information includes the media-type, content-encoding, transfer-encoding, content-length, etc.

HEAD request can be used to check if the services resource exists, or if the services resource can be accessed by clients. It can also determine if the services resource supports an output format <format> if performed on a URI with .<format> included.

See