using variable for Geocode Service Url
I'm trying to replace hardcoded URL references in my workflow with variables so that we don't have to edit the workflow every time a server URL changes - I'd rather read these values in from web.config or as workflow properties.
For some tasks such as the Buffer Task, you can use a string variable for the URL but I've found that for the Geocode Task, it will not allow you to use a variable for the URL. Even though I have all the input fields for the geocode task set up correctly, if I try to use a variable for the URL it throws an error about not being able to use relative URL's for the activity. I understand that the actual URL is required when configuring the parameters of the task (ie. it needs to generate input boxes for all the geocode inputs) but once I've got the service set up, I'd like to be able to replace the hardcoded string with a variable. All our geocoding services have the same inputs but we may use different servers and/or geocoders depending on the application.
Is there a way to use a runtime variable passed in from either web.config or the workflow properties to the Geocode Task? Are there other tasks that have the same behaviour as the Geocode Task (ie. require a hardcoded URL in order to generate the necessary input boxes)?
-
Hi Peter,
I also have the same probelm, please keep us posted if you have a solution.
0 -
Try to add a GeocodeServiceUrl key to your web.config file. O pen up your REST web.config file located in C:\Program Files (x86)\Latitude Geographics\Geocortex Essentials\Default\REST Elements\REST. At the top of this config file will be an <appsettings> node which contains <add> nodes. Add a key:<add key="GeocodeServiceUrl" value="http://yoururl" />
To retrieve these in workflow call System.Configuration.ConfigurationManager.AppSettings("GeocodeServiceUrl").
0 -
Nico,
I tried your suggestion but the workflow still throws an error about not being able to use a relative URL.
/customer/servlet/servlet.FileDownload?file=00P6000000elu8hEAA
0 -
I have found that the ProjectSingleGeometryTask is the same way - have to hardcode the URL. This is a poor design choice, as hardcoding should be avoided wherever possible in programming, ESPECIALLY things like workflows which need to be multipurpose. Especially in situations where you are developing in a test environment and moving to a production environment. It's a pain to find all these and change them. Geocortex, please provide a workaround for this problem. 0 -
My understanding was that ProjectSingleGeometryTask does take an expression/variable as input. Geocode is special because the workflow needs to discover the capabilties of the endpoint at design time. 0
Please sign in to leave a comment.
Comments
5 comments