首页 / 浏览问题 / 云GIS / 问题详情
调用空间分析服务计算定点里程失败
6EXP 2019年03月08日
使用产品:iserver 9d 910 操作系统 Server2016

请求RouteCalculateMeasureService失败,发现是在构造RouteCalculateMeasureParameters时,sourceRoute把完整几何上传,而查询的路径有90多公里长,浏览器发起超过500多个get请求,iserver日志报ehcache错误而停止计算。

2 个回答

您好,您这个问题是出现了跨域的问题。
5,668EXP 2019年03月08日

没有跨域问题,抓包发现服务都请求出去了。

调用的空间分析的服务是下面链接,

http://iclient.supermap.io/libs/iclient8c/apidoc/files/SuperMap/REST/SpatialAnalyst/RouteCalculateMeasureService-js.html

其中需要构造一个 RouteCalculateMeasureParameters 对象,它的有个属性“sourceRoute”,就是查询的Route要素的所有几何数据,我的一条Route长90多公里,有2000多个点构成。

前端使用了RouteCalculateMeasureService.processAsync()方法,抓包就发现浏览器发起无数个请求,在上传route的空间数据,一段时间后iserver也没有返回结果,计算就失败了。

补充下,查看iserver后台日志,是如下内容。

The configured limit of 1,000 object references was reached while attempting to calculate the size of the object graph. Severe performance degradation could occur if the sizing operation continues. This can be avoided by setting the CacheManger or Cache elements maxDepthExceededBehavior to "abort" or adding stop points with @IgnoreSizeOf annotations. If performance degradation is NOT an issue at the configured limit, raise the limit value using the CacheManager or Cache elements maxDepth attribute. For more information, see the Ehcache configuration documentation.

截图如下

6EXP 2019年03月11日
您好,正常的请求应该是post请求,只有在跨域的时候才会用get请求模拟post请求,数据量太大请求数过多。先找到一个同域的环境做post请求iserver能否得到正确的结果,测试一下。

然后您把您用的什么客户端,还有代码都贴一下
...