[RPC Fault faultString="" faultCode="400" faultDetail="Invalid URL"]

5140
9
06-02-2010 11:21 AM
TomSedlacek
New Contributor III
Afternoon all..

Thanks in advance for any kernel of help you may have for me.

I am attempting to modify portions of the sample flex viewer to work with my data and services.  I have modified the SearchWidget XML to point to (what I thought) is my data and field to search by parcel number.  One I changed the code as shown and attempt a search, I get:

[RPC Fault faultString="" faultCode="400" faultDetail="Invalid URL"]

Here is my modified code:

<configuration>
<en_CA>
  <layers>
   <layer>
    <name>Taxlots</name>
    <url>http://station-01-09/ArcGISServer/rest/services/M3/MapServer</url>
    <expression>ASSR_SN= '[value]'</expression>
    <textsearchlabel>Search by Parcel ID  [ Example: 118255-780 ]:</textsearchlabel>
    <graphicalsearchlabel>Use one of the graphical search tools to select incidents</graphicalsearchlabel>
    <fields>ASSR_SN</fields>
    <titlefield>ASSR_SN</titlefield>
    <linkfield></linkfield>
   </layer>
  
  </layers>
  <labels>
   <graphicalsearchlabel>Graphical Search</graphicalsearchlabel>
   <textsearchlabel>Text Search</textsearchlabel>
   <resultslabel>Results</resultslabel>
   <layerlabel>Search Layer:</layerlabel>
   <nolayerlabel>No search layer defined.</nolayerlabel>
   <submitlabel>Search</submitlabel>
   <pointlabel>Select by Point</pointlabel>
   <linelabel>Select by Line</linelabel>
   <rectanglelabel>Select by Rectangle</rectanglelabel>
   <polygonlabel>Select by Polygon</polygonlabel>
   <clearlabel>Clear</clearlabel>
   <loadinglabel>Loading...</loadinglabel>
   <selectionlabel>Features Selected:</selectionlabel>
  </labels>
  <zoomscale>10000</zoomscale>
</en_CA>

</configuration>
Tags (2)
0 Kudos
9 Replies
RobertScheitlin__GISP
MVP Emeritus
Tom,

   The URL of a query has to have the number of the layer that is to be queried at the end.

http://station-01-09/ArcGISServer/rest/services/M3/MapServer

needs to be something like

http://station-01-09/ArcGISServer/rest/services/M3/MapServer/2
0 Kudos
TomSedlacek
New Contributor III
That did it Robert. Thank you.  You're really the 'go to' guy here!

Tom
0 Kudos
RachelleDoucet
New Contributor III
I get a similar error when I try searching on Valves, even after adding the layer number at the end of the url. The Search works great for Hydrants and Water Meters, but for Valves I get the following error:

[RPC Fault faultString="Unable to complete operation."
faultCode="400" faultDetail="Unable to complete Query operation."]

Any thoughts?

Here is my SearchWidget.xml code

<?xml version="1.0" ?>
<configuration>
<layers>
<layer>
<name>Valves</name>
<url>http://dev4/ArcGIS/rest/services/WaterNetwork/MapServer/0</url>
<expression>Valve ID like '[value]'</expression>
<textsearchlabel>Search by Valve ID  [ Example: 12590]</textsearchlabel>
<titlefield>Valve ID</titlefield>
<linkfield></linkfield>
<fields all="false">
<field name="GISADMIN.WATERNODE.HANSENID"alias="Valve ID" visible="true"/>
<field name="ADDRQUAL" alias="Qualifier" visible="true" />
<field name="VANGLE" alias="Angle" visible="true" />
<field name="UNITTYPE" alias="Valve Type" visible="true" />
<field name="VALVESTAT" alias="Valve Status" visible="true" />
<field name="VALVESZ" alias="Valve Size" visible="true" />
<field name="NOTURNS" alias="Turns" visible="true" />
<field name="DIR" alias="Turn Direction" visible="true" />
<field name="INSTDATE" alias="Installed" visible="true" />
</fields>
</layer>

<layer>
<name>Hydrants</name>
<url>http://dev4/ArcGIS/rest/services/WaterNetwork/MapServer/2</url>
<expression>HANSENID like '[value]'</expression>
<textsearchlabel>Search by Hydrant ID  [ Example: 01043]</textsearchlabel>
<titlefield>HYDRANT ID</titlefield>
<linkfield></linkfield>
<fields all="false">
<field name="GISADMIN.WATERNODE.HANSENID" alias="Hydrant ID" visible="true"/>
<field name="ADDRQUAL" alias="Qualifier" visible="true" />
<field name="BARRELSIZE" alias="Barrel Size" visible="true" />
<field name="UNITTYPE" alias="Hydrant Type" visible="true" />
<field name="COLOR" alias="Paint Color" visible="true" />
<field name="FEEDERTYPE" alias="Feeder Type" visible="true" />
<field name="FEEDERLEN" alias="Feeder Length" visible="true" />
<field name="FEEDERDIAM" alias="Feeder Diameter" visible="true" />
<field name="INSTDATE" alias="Installed" visible="true" />
<field name="WONO" alias="Installed" visible="true" />
</fields>
</layer>



<layer>
<name>Water Meters</name>
<url>http://dev4/ArcGIS/rest/services/WaterNetwork/MapServer/1</url>
<expression>METERID like '[value]'</expression>
<textsearchlabel>Search by Meter ID  [ Example: 01043]</textsearchlabel>
<titlefield>Meter ID</titlefield>
<linkfield></linkfield>
<fields all="true">
<field name="GISADMIN.WATERMETERS.METERID" alias="Meter ID" visible="true"/>
<field name="ADDRQUAL" alias="Qualifier:" visible="true" />
<field name="UNITTYPE" alias="Meter Type" visible="true"/>
<field name="METERCOMP" alias="Component" visible="true"/>
<field name="METERSZ" alias="Meter Size" visible="true"/>
<field name="NODIALS" alias="Number of Dials" visible="true"/>
<field name="MODELNO" alias="Model #" visible="true"/>
<field name="SEALNO" alias="Serial #" visible="true"/>
<field name="ERTTYPE" alias="ERT Type" visible="true"/>
</fields>
</layer>



</layers>
<zoomscale>10000</zoomscale>
</configuration>

<!--
See Search widget documentation at
http://links.esri.com/searchwidget
-->
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Rachelle,

   Are you sure the expression should not be :

<expression>VALVEID like '[value]'</expression>

is "Valve ID" the alias for the field?
0 Kudos
RachelleDoucet
New Contributor III
I've changed my code for the Valves search to this:

<expression>HANSENID like '[value]'</expression>

HANSENID is the Alias name. As you can see below, it is the same Alias name as in the Hydrants layer which works fine.

I thought maybe it had to do with the valves having a Definition Query set in the .mxd. But I get the same error when I remove it. I'm stumped!

<?xml version="1.0" ?>
<configuration>
<layers>
<layer>
<name>Valves</name>
<url>http://dev4/ArcGIS/rest/services/WaterNetwork/MapServer/0</url>
<expression>HANSENID like '[value]'</expression>
<textsearchlabel>Search by Valve ID  [ Example: 12590]</textsearchlabel>
<titlefield>Valve ID</titlefield>
<linkfield></linkfield>
<fields all="false">
<field name="GISADMIN.WATERNODE.HANSENID" alias="Valve ID" visible="true"/>
<field name="ADDRQUAL" alias="Qualifier" visible="true" />
<field name="VANGLE" alias="Angle" visible="true" />
<field name="UNITTYPE" alias="Valve Type" visible="true" />
<field name="VALVESTAT" alias="Valve Status" visible="true" />
<field name="VALVESZ" alias="Valve Size" visible="true" />
<field name="NOTURNS" alias="Turns" visible="true" />
<field name="DIR" alias="Turn Direction" visible="true" />
<field name="INSTDATE" alias="Installed" visible="true" />
</fields>
</layer>
 
 
<layer>
<name>Hydrants</name>
<url>http://dev4/ArcGIS/rest/services/WaterNetwork/MapServer/2</url>
<expression>HANSENID like '[value]'</expression>
<textsearchlabel>Search by Hydrant ID  [ Example: 01043]</textsearchlabel>
<titlefield>Hydrant ID</titlefield>
<linkfield></linkfield>
<fields all="false">
<field name="GISADMIN.WATERNODE.HANSENID" alias="Hydrant ID" visible="true"/>
<field name="ADDRQUAL" alias="Qualifier" visible="true" />
<field name="BARRELSIZE" alias="Barrel Size" visible="true" />
<field name="UNITTYPE" alias="Hydrant Type" visible="true" />
<field name="COLOR" alias="Paint Color" visible="true" />
<field name="FEEDERTYPE" alias="Feeder Type" visible="true" />
<field name="FEEDERLEN" alias="Feeder Length" visible="true" />
<field name="FEEDERDIAM" alias="Feeder Diameter" visible="true" />
<field name="INSTDATE" alias="Installed" visible="true" />
<field name="WONO" alias="Installed" visible="true" />
</fields>
</layer>

    </layers>
    <zoomscale>10000</zoomscale>
</configuration>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Rachelle,

   Try this:

<expression>GISADMIN.WATERNODE.HANSENID like '[value]%'</expression>
0 Kudos
RachelleDoucet
New Contributor III
Still get the same error. I'm going to try creating a new map service using a new mxd with just the valves in it to test.
0 Kudos
RachelleDoucet
New Contributor III
I was never able to figure why my original code wasn't working.

But I ended up removing the block of code that was referencing the VALVES service. I then copied and pasted the code from the HYDRANTS that was working and simply replaced the map service name and URL for VALVES. Now it works!
0 Kudos
BradFindlay
New Contributor III
We ran into a similar problem with our Flex Viewer, returning a similar error code. It turns out our problem was the map used to create the map service was modified to include a join on the layer being searched on, and then the service was republished. Because of this change, the fields configured in the Search Widget need to be reconfigured to indicate which table was being searched on, such as seen in the example below.

Instead of our old configuration: <field name="PARCELS.APN" alias="Parcel Number" />
With the join we needed this:     <field name="PROD_SDE.DBO.PARCELS.APN" alias="Parcel Number" />

Once I made this change the search tool worked perfectly again.


Brad Findlay
GIS Analyst
City of Rancho Cordova
0 Kudos