geoprocess runs in model builder, but not in flex api

3076
1
Jump to solution
07-15-2015 09:19 PM
eddiequinlan
Occasional Contributor

I have a geoprocess which runs fine in arc map/model builder and in REST.  However when I use the geoprocess map service the process fails.  I know why it fails but don't know how to correct it.

I have published many services before, but never with this issue.

In my model I'm using the 'make feature layer tool' with a default SQL parameter.  The default SQL (or any other input at the tool level) works fine in arc map.  I then share the results as a geoprocess service.  The service works fine in REST.  When I try to use the service in my flex web app the job fails.  I've figured out that if I change my code in flex for the SQL parameter input to expression = "", the service works correctly.... except now I get all data.  If I manually hard code a valid SQL as a parameter input for 'submitJob', it fails.  I can use the same basic code for other geoprocess services and get the expected results.  Something is happening with the parameter input.  It seems to override the model builder default if its set to "  ", but not if I try to provide the SQL.... going crazy.

Any ideas,

Eddie

0 Kudos
1 Solution

Accepted Solutions
eddiequinlan
Occasional Contributor

I found the answer and hope this helps anyone.......

1.      My original model builder had no joins in the process.  From that the model was published as a geoprocess to the server.  The flex application using the geoprocess passed parameters to it without "QUOTES" around the column names.  This process has always worked without any issues.

2.     Based on the above results, I used the same methodology in my model builder but added a JOINS.  However, passing the parameters to the geoprocess service without "QUOTES" will not work.  Come to find out, this is consistent with the ESRI documentation stating that shapefiles and geodatabase queries need the columns quoted.

Maybe someone knows the answer as to why the geoprocess will work in situation number 1, but not in number 2.  However, for future reference anyone running queries to a geoprocess; make sure you "QOUTE" your column names.

Eddie Q

View solution in original post

0 Kudos
1 Reply
eddiequinlan
Occasional Contributor

I found the answer and hope this helps anyone.......

1.      My original model builder had no joins in the process.  From that the model was published as a geoprocess to the server.  The flex application using the geoprocess passed parameters to it without "QUOTES" around the column names.  This process has always worked without any issues.

2.     Based on the above results, I used the same methodology in my model builder but added a JOINS.  However, passing the parameters to the geoprocess service without "QUOTES" will not work.  Come to find out, this is consistent with the ESRI documentation stating that shapefiles and geodatabase queries need the columns quoted.

Maybe someone knows the answer as to why the geoprocess will work in situation number 1, but not in number 2.  However, for future reference anyone running queries to a geoprocess; make sure you "QOUTE" your column names.

Eddie Q

0 Kudos