ArcGisServices Query Like异常

问题

本机调用 ArcGisServices Query 正常,其它机器调用若包含Like关键字则无法查询结果(其它关键字均正常,in、=)
浏览器测试直接崩溃

http://XXX.XX.XXX.XX/ArcGIS/rest/services/ServicesName/MapServer/5/query

系统环境:ArcGis 10,Flex API 3.7

思路

检查跨域文件

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<site-control permitted-cross-domain-policies="all"/>
<allow-access-from domain="*"/>
</cross-domain-policy>

Like 关键字转码问题

检查URL,尝试Get、Post提交,均异常

检查Log

Method failed.HRESULT = 0x80040207 : This is a FACILITY_ITF error that is specific to the interface that returned this error. See the documentation of the interface that returned this error for information about this HRESULT.

GeoDatabase Error :An invalid SQL statement was used. An invalid SQL statement was used.

查询帮助,得到如下信息:

What constitutes "valid" SQL depends on the backend database for a specific REST endpoint. The backend can be a Personal Geodatabase, File Geodatabase, Shapefile, or SDE Geodatabase (of different databases). Depending on the type and database, the SQL might be slightly different, especially for dates.

对比API

下载JS API 测试,发现最新JS API 查询居然没有问题。咨询官方,可能是ArcGis 10 Flex API bugger,让打sp1补丁试试。
唉,服务器软件太多,补丁有风险。

终章

模糊查询使用Text 替换 Where,规避Like 关键字

text    Description: A literal search text. If the layer has a display field associated with it, the server searches for this text in this field. This parameter is a short hand for a where clause of: 
where <displayField> like '%<text>%'. The text is case sensitive. 
This parameter is ignored if the where parameter is specified.

Example: text=Los
where   Description: A where clause for the query filter. Any legal SQL where clause operating on the fields in the layer is allowed.

Example: where=POP2000 > 350000
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容