Service Runtime Parameters: How do i change them for deploym

Posted by nweddle on 31-Oct-2007 16:02

I have a custom ESB Service that calls a web service. I could not use the Sonic Web Service client because there is a bug in it that it cannot consume the WSDL I am calling.

Anyway, I pass in a URL as a runtime parameter. How do I change the runtime parameter for a given envoronment? Currently, my custom service is pointing at a development environment, and I want to point it to a testing environment now.

All Replies

Posted by dmillman on 08-Nov-2007 08:43

Nathan,


There are a couple of patterns for this. The standard approach is that when you move a service from one deployment to another using the import and export tools there is a mapping file that can be used, see the admin's guide. However I am not 100% sure if this works on runtime parameters.

Alternatively, you can implement a DS global parameters setting, where you store a file in the Directory Service that contains a set of environment variables, similar to a environment variables. Now your runtime parameter refers the environment variable name, rather than the actual URL.

David

Posted by nweddle on 08-Nov-2007 10:04

Great, thanks for the ideas David!

Nathan

Posted by nweddle on 09-Nov-2007 12:23

David,

Is there documentation on setting up a global parameter is the DS?

Thanks,

Nathan

Posted by dmillman on 12-Nov-2007 12:36

THere is no formal documentation but here are some ideas.


You will need to store a file in the DS somewhere that contains the values, I would use either a properties file, or an XML file that allows name value pairs to be stored.

For initial testing I would place the file in a workshop project location, this way it is editable within IW. Then you will need to extract the file and read the information within the service,

The standard code is

URL url = new URL("sonicfs:///a/b/filename.xml");

BufferedReader rdr = new BufferedReader(new InputStreamReader(url.openStream()));

// Normal code to read in from a Buffered Reader.

The service can now extract the information from the contents of the file.


Hope this helps


David

This thread is closed