<services_uri>/{id}[.<format>]
serviceCheckStatus、serviceOffline、serviceShareSetting、serviceStatus
service 资源是指定的服务或服务集合,支持检索,更新和删除服务,支持 iso19139媒体类型。
支持的方法:
支持的表述格式:rjson、json、html、xml。
对如下 URI 执行 HTTP 请求,以 rjson 输出格式为例加以说明,其中,supermapiportal 是服务器名。
http://supermapiportal:8090/iportal/web/services/{id}.rjson
获取指定的服务或服务集合信息。
对 service 资源执行 GET 请求,获取指定的服务或服务集合信息,由以下字段组成:
字段 | 类型 | 说明 |
addedMapNames | Set<String> | 服务下的地图名称列表(注册服务时可选择使用字段)。 |
addedSceneNames | Set<String> | 服务下的场景名称列表(注册服务时可选择使用字段)。 |
authorizeSetting | List<IportalAuthorizeEntity> | 授权信息。 |
checkStatus | CheckStatus | 审核状态。 |
createTime | Long | 服务的注册时间。 |
description | String | 服务的描述信息。 |
enable | Boolean | 服务是否启用。 |
id | Integer | 注册服务的标识。 |
isBatch | Boolean | 是否是批量注册的。 |
isDataItemService | Boolean | 是否是用户上传数据发布的服务注册进来的。 |
linkPage | String | 服务的链接地址。 |
mapInfos | List<MapInfo> | 服务中包含的地图列表。 |
metadata |
Metadata |
服务的元数据信息。 |
nickname | String | 用户的昵称。 |
offline | Boolean | 服务是否离线。 |
proxiedUrl | String | 启用服务代理后的地址。 |
resTitle | String | 服务名称。 |
scenes | List<ServiceSceneInfo> | 服务中包含的三维场景列表。 |
serviceRootUrlId | Integer | 该注册服务对应的服务根地址的标识。 |
tags | List<String> | 服务的标签。 |
thumbnail | String | 服务的缩略图路径。 |
type | SourceType | 服务的类型。 |
updateTime | Long | 更新日期。 |
userName | String | 用户标识。 |
verifyReason | String | 审核意见。 |
version | String | 服务的版本,如 WMS 服务的1.3.0。 |
visitCount | Integer | 服务的访问次数,只有启用服务代理功能后,该参数才生效。 |
对 service 资源:http://localhost:8090/iportal/web/services/1.rjson 执行 GET 请求,返回的 rjson 格式的资源表述如下:
{
"addedMapNames": null,
"addedSceneNames": null,
"authorizeSetting": [
{
"aliasName": "admin",
"entityId": null,
"entityName": "admin",
"entityType": "USER",
"permissionType": "DELETE"
}
],
"checkStatus": "SUCCESSFUL",
"createTime": 1473737605014,
"description": "",
"enable": true,
"id": 1,
"isBatch": false,
"isDataItemService": false,
"linkPage": "http://192.168.120.40:8091/iserver/services/map-changchun/rest",
"mapInfos": [
{
"id": null,
"mapThumbnail": "http://192.168.120.40:8091/iserver/services/map-changchun/rest/maps/长春市区图/entireImage.png",
"mapTitle": "长春市区图",
"mapUrl": "http://192.168.120.40:8091/iserver/services/map-changchun/rest/maps/长春市区图",
"serviceId": 1
},
{
"id": null,
"mapThumbnail": "http://192.168.120.40:8091/iserver/services/map-changchun/rest/maps/长春市区图_Local/entireImage.png",
"mapTitle": "长春市区图_Local",
"mapUrl": "http://192.168.120.40:8091/iserver/services/map-changchun/rest/maps/长春市区图_Local",
"serviceId": 1
}
],
"metadata": {
"contInfo": null,
"createdBy": null,
"dataIdInfo": {
"dataIdent": {
"aggrInfo": null,
"dataChar": null,
"dataExt": {
"exDesc": "",
"geoEle": {
"geoBndBox": {
"eastBL": 0,
"northBL": 0,
"southBL": 0,
"westBL": 0
}
}
},
"dataLang": null,
"dataScale": null,
"dsFormat": null,
"graphOver": null,
"idAbs": "",
"idCitation": {
"resEd": null,
"resRefDate": null,
"resTitle": "changchun"
},
"idPoC": null,
"idPurp": null,
"idStatus": null,
"keyword": null,
"refTheme": null,
"resConst": null,
"resSubType": null,
"resType": null,
"spatRpType": null,
"tpCat": null
},
"serIdent": null
},
"distInfo": {
"distFormat": null,
"distributor": null,
"onLineSrc": {
"linkage": "http://192.168.120.40:8091/iserver/services/map-changchun/rest",
"orDesc": null,
"orFunct": null
}
},
"dqInfo": null,
"mdChar": null,
"mdContact": {
"role": null,
"rpCntInfo": {
"cntAddress": {
"EMailAdd": "",
"adminArea": null,
"city": null,
"country": null,
"delPoint": "",
"postCode": null
},
"cntOnLineRes": null,
"faxNum": "",
"voiceNum": ""
},
"rpIndName": "",
"rpOrgName": "",
"rpPosName": null
},
"mdDateSt": null,
"mdFileID": null,
"mdLang": null,
"mdStanName": null,
"mdStanVer": null,
"refSysInfo": {
"mdCoRefSys": {
"datum": null,
"ellipsoid": null,
"longCntMer": 0,
"projection": "WGS84",
"zone": 0,
"zoneMethod": null
},
"refSysID": ""
},
"spatRepInfo": null
},
"metadataString": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<smmd:Metadata xmlns:smmd=\"http://data.sbsm.gov.cn/smmd/2007\">\n <smmd:mdContact>\n <smmd:rpIndName></smmd:rpIndName>\n <smmd:rpOrgName></smmd:rpOrgName>\n <smmd:rpCntInfo>\n <smmd:cntAddress>\n <smmd:delPoint></smmd:delPoint>\n <smmd:eMailAdd></smmd:eMailAdd>\n </smmd:cntAddress>\n <smmd:voiceNum></smmd:voiceNum>\n <smmd:faxNum></smmd:faxNum>\n </smmd:rpCntInfo>\n </smmd:mdContact>\n <smmd:dataIdInfo>\n <smmd:DataIdent>\n <smmd:idCitation>\n <smmd:resTitle>changchun</smmd:resTitle>\n </smmd:idCitation>\n <smmd:idAbs></smmd:idAbs>\n <smmd:dataExt>\n <smmd:geoEle>\n <smmd:GeoBndBox>\n <smmd:westBL>0.0</smmd:westBL>\n <smmd:eastBL>0.0</smmd:eastBL>\n <smmd:southBL>0.0</smmd:southBL>\n <smmd:northBL>0.0</smmd:northBL>\n </smmd:GeoBndBox>\n </smmd:geoEle>\n <smmd:exDesc></smmd:exDesc>\n </smmd:dataExt>\n </smmd:DataIdent>\n </smmd:dataIdInfo>\n <smmd:refSysInfo>\n <smmd:MdCoRefSys>\n <smmd:projection>WGS84</smmd:projection>\n <smmd:longCntMer>0.0</smmd:longCntMer>\n <smmd:zone>0</smmd:zone>\n </smmd:MdCoRefSys>\n <smmd:refSysID></smmd:refSysID>\n </smmd:refSysInfo>\n <smmd:distInfo>\n <smmd:onLineSrc>\n <smmd:linkage>http://192.168.120.40:8091/iserver/services/map-changchun/rest</smmd:linkage>\n </smmd:onLineSrc>\n </smmd:distInfo>\n</smmd:Metadata>\n",
"nickname": "admin",
"offline": false,
"proxiedUrl": null,
"resTitle": "changchun",
"scenes": [],
"serviceRootUrlId": null,
"tags": [
"changchun"
],
"thumbnail": null,
"type": "MAP",
"updateTime": 1473737637815,
"userName": "admin",
"verifyReason": null,
"version": null,
"visitCount": 0
}
更新指定的服务或服务集合。只有服务注册者和门户管理员有权限对服务进行更新。
发送请求时,需要在请求体中包含如下参数:
字段 | 类型 | 说明 |
authorizeSetting | List<IportalAuthorizeEntity> | 授权信息。服务的权限类型包括:DELETE(查看/编辑/删除)、READ(查看)、READWRITE(查看/编辑)。 |
tags | List<String> | 服务的标签。 |
metadata |
Metadata |
服务的元数据信息。 |
thumbnail | String | 服务的缩略图路径。 |
返回的资源表述结构如下:
字段 | 类型 | 说明 |
succeed | boolean | 更新服务是否成功。 |
error | Httperror | 出错信息,如果更新服务成功,则没有本字段。 |
修改服务的名称,对 service 资源:http://localhost:8090/iportal/web/services/1.json 执行 PUT 请求,发送请求体如下:
{
"tags": [
"changchun"
],
"authorizeSetting": [],
"metadata": {
"mdContact": {
"rpIndName": "",
"rpOrgName": "",
"rpCntInfo": {
"cntAddress": {
"delPoint": "",
"eMailAdd": ""
},
"voiceNum": "",
"faxNum": ""
}
},
"refSysInfo": {
"mdCoRefSys": {
"projection": "WGS84"
},
"refSysID": ""
},
"dataIdInfo": {
"dataIdent": {
"idCitation": {
"resTitle": "changchun1"
},
"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-changchun/rest"
}
}
},
"thumbnail": null
}
则返回的 rjson 格式的表述如下:
{ "succeed": true}
删除指定的服务或服务集合。
对 service 资源:http://localhost:8090/iportal/web/services/3.rjson 执行 DELETE 请求,返回的 rjson 格式的表述如下:
{ "succeed": true}
返回跟 GET 请求一样的 HTTP 响应头,但是没有响应实体。可以在不必传输整个响应内容的情况下,获取包含在响应消息头中的元数据信息。元数据信息包括媒体类型,字符编码,压缩编码,实体内容长度等。
HEAD 请求可以用来判断 service 资源是否存在,或者客户端是否有权限访问 service 资源。通过对加.<format>的 URI 执行 HEAD 请求,还可以快速判断 service 资源是否支持<format>格式的表述。