Geoprocessing with CherryPy web framework

Discussion created by nmassaro on Jul 9, 2012
Latest reply on Jul 13, 2012 by nmassaro
I???m trying to return data to a web page from a simple processioning procedure. I keep getting the following error ???self._gp.SearchCursor(*gp_fixargs(args))) RuntimeError: ERROR 999999: Error executing function.??? The processioning function works fine standalone but fails when ran with through CherryPy.
I think it???s a pathing issue but haven???t had any luck solving it.[ATTACH=CONFIG]15889[/ATTACH]

Any help would be greatly appreciated.

Code follows as well as being attached with table.

import cherrypy
import arcpy

class StartPage:

  def index(self):
    # This is the starting web page for the HOA selection application
    return '''
      <p><a href="http://TheServerName:8080/get_database" target="_parent">database pull</a></p>
      <p><a href="http://TheServerName:8080/get_text" target="_parent">text pull</a></p>'''
  index.exposed = True

  def get_database(self):
    info = data_extract()
    return info
  get_database.exposed = True

  def get_text(self):
    return """Great! this worked<p><p><a href="http://TheServerName:8080/" target="_parent">back</a></p>

  get_text.exposed = True

def data_extract():
  Notification_Table = "C:/web.dbf"
  rows = arcpy.SearchCursor(Notification_Table)
  row = rows.next()
  return_string = ""
  while row:
    name = row.getValue("NAME")
    return_string = return_string + 'name: %s\n' % name
    row = rows.next()
  return return_string

import os.path
hoaconf = os.path.join(os.path.dirname(__file__), 'hoa.conf')

if __name__ == '__main__':
    cherrypy.quickstart(StartPage(), config=hoaconf)
    cherrypy.tree.mount(StartPage(), config=hoaconf)