Select to view content in your preferred language

flex sample searchwidget get RPC Fault "failed to execute query"

2957
2
Jump to solution
12-02-2014 12:07 AM
WuYang
by
Emerging Contributor

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

666666666666666.jpg

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!

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

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.

View solution in original post

2 Replies
RobertScheitlin__GISP
MVP Emeritus

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.

WuYang
by
Emerging Contributor

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.

0 Kudos