Hi all,
I am now following the SearchWidget from arcgis-samples-flex-3.6-src to my web service and just change th xml file to my own service.
When I ran the application, it find the layer and no error message BUT the RPC Fault "failed to execute query" error as follows
The modified xml file is:
<?xml version="1.0" ?>
<configuration label="Spatial Search">
<layers>
<layer>
<name>ROADLINE</name>
<url>http://localhost:6080/arcgis/rest/services/GeoTagging_for_web/MapServer/0</url>
<expression>DrainName like '[value]'</expression>
<textsearchlabel>Search road by name</textsearchlabel>
<titlefield>PD_NAME</titlefield>
<linkfield></linkfield>
<fields all="false">
<field name="OBJECTID"/>
<field name="RoadName" alias="Road Name"/>
</fields>
</layer>
<layer>
<name>Segment</name>
<url>http://localhost:6080/arcgis/rest/services/GeoTagging_for_web/MapServer/1</url>
<expression>Segment_ID = '[value]'</expression>
<textsearchlabel>Search by Segment ID</textsearchlabel>
<titlefield>Segment_ID</titlefield>
<linkfield></linkfield>
<fields all="false">
<field name="Segment_ID" alias="Segment ID"/>
</fields>
</layer>
</layers>
<zoomscale>10000</zoomscale>
</configuration>
Any hint on what may cause the problem? thanks!
Solved! Go to Solution.
Wu Yang,
The issue I see in your configuration is that you have:
<titlefield>PD_NAME</titlefield>
And this field likely does not exist in your layer.
Next you have:
<expression>DrainName like '[value]'</expression>
But DrainName field is not listed in your fields:
<fields all="false"> <field name="OBJECTID"/> <field name="RoadName" alias="Road Name"/> </fields>
Another big thing to know is that Flex is a CaSe sensitive language so you have to have the EXACT CaSe of your fields in the config.
Wu Yang,
The issue I see in your configuration is that you have:
<titlefield>PD_NAME</titlefield>
And this field likely does not exist in your layer.
Next you have:
<expression>DrainName like '[value]'</expression>
But DrainName field is not listed in your fields:
<fields all="false"> <field name="OBJECTID"/> <field name="RoadName" alias="Road Name"/> </fields>
Another big thing to know is that Flex is a CaSe sensitive language so you have to have the EXACT CaSe of your fields in the config.
Yes Robert,
I have corrected the configuration, it works. Thanks a lot!
UPDATE: a stange thing is all the results displayed at the same place cause the results looks messy.