Deploying web services to multiple environments.

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

Rhodri
Ebase User
Posts: 9
Joined: Thu Jun 17, 2010 2:10 pm
Location: Gwynedd
Contact:

Deploying web services to multiple environments.

#1

Postby Rhodri » Fri Nov 26, 2010 9:08 am

We have just completed a development project using an ebase UI that talks to a .NET web service application.

We now need to deploy our project to the test environment.

One issue we have is that the Target URL of each web service resource will still point to the development .NET environment after deployment to another environment - because this is where we told it to point during development.

When deploying to another environment, we need our web services resources to point to the corrensponding .NET environment (in this case the test environment). I assume that this is a very common scenario and there is a simple solution!!!

Obviously, duplicating the web service resources (then using an 'if' statement to call the appropriate resource) is not acceptable, nor is manually changing the Target URL after deployment.

Any guidance on this issue would be appreciated.

Thanks in advance
0 x

AJDulk
Ebase User
Posts: 94
Joined: Fri Sep 14, 2007 12:18 pm
Location: The Netherlands
Contact:

Re: Deploying web services to multiple environments

#2

Postby AJDulk » Fri Nov 26, 2010 1:29 pm

What we are doing is using the variables in the WEB-INF/web.xml file.
You define it using the following code:

Code: Select all

  <env>
    <env>WEBSERVICE_HOSTNAME</env>
    <env>dev.example.com</env>
    <env>java.lang.String</env>
  </env>
You can then use it in your forms as $ENV_WEBSERVICE_HOSTNAME and in a resource with the && prefix as in the following code:

Code: Select all

http&#58;//&&$ENV_WEBSERVICE_HOSTNAME/PublicPaymentService/PublicPaymentRS
Another option would be to save the value in a database (or other readable resource), read it in at the form and pass it to the resource (in a web or xml resource you do this by creating a unbound string field in the resource). Use &&FIELD_NAME to substitute it in the adapter then.
0 x

ehmd
Ebase User
Posts: 53
Joined: Thu Sep 13, 2007 9:02 am
Contact:

#3

Postby ehmd » Fri Nov 26, 2010 2:17 pm

I'm also using the Environment variable option as well, as I have a M$ dot net application with over 50 available web service calls :roll:

I've also encrypted the URL ( plus other variables) using the eBase encrypt function and placed these in Environment variables as well, just for added security :wink:
0 x

AJDulk
Ebase User
Posts: 94
Joined: Fri Sep 14, 2007 12:18 pm
Location: The Netherlands
Contact:

Re: Deploying web services to multiple environments

#4

Postby AJDulk » Fri Nov 26, 2010 3:15 pm

ehmd wrote: I've also encrypted the URL ( plus other variables) using the Ebase encrypt function and placed these in Environment variables as well, just for added security :wink:
Interesting idea for when you wish to keep the variables for use in Ebase only. Personally I do not have a use for it since Ebase is in its own container and therefor the variables are not shared with other applications.
0 x

Rhodri
Ebase User
Posts: 9
Joined: Thu Jun 17, 2010 2:10 pm
Location: Gwynedd
Contact:

#5

Postby Rhodri » Tue Nov 30, 2010 4:45 pm

Hi, thanks very much for your replies.

I followed your guidance and used the environment variables. We now have a fairly tidy setup for deployment accross development, test and production environments.
0 x


Who is online

Users browsing this forum: No registered users and 121 guests