Wednesday, September 26, 2012

Serving static files using DataPower

I was customizing Login and Request Permission forms for implementing OAuth with DataPower when I encountered a road-block where I need to host my CSS, JPEG, and other Web Resource files. The first solution that came to mind is to use an HTTP Server, but, since the current architecture of our client does not have an HTTP Server in the DMZ along with DataPower, I needed to find a way to host the files in DataPower.

A few Google searches later and I found this blog post from HermannSW where it says: define a local HTTP service listening on 127.0.0.1:8888 with base directory "logtemp:///". I figured that this could probably apply to my current situation.

First thing I did was to define a local:/// sub-directory to contain all my files:


Then, I created an HTTP Service with base directory pointed at "local:///WEB-CONTENT".

**Remember to assign the correct Local IP Address (or Alias) and Port Number to fit your configuration.

After defining the HTTP Service, I can now access the files via http://local_ip_address:port_number/full_path/file_name. I then defined my custom Login and Request Permission forms to use the files hosted in the HTTP Service.

3 comments:

sabrina said...

Hi! I want you to know that even if I don't get these things, for me you are the best IT guy there is the world! :)

Noel Avlas said...

Thank you! :D

kandepumanoj said...

i have an exact scenario that needs to host a html static page, can you please help me how to display back