Wednesday, December 19, 2007

Sun Java System Web Server 6.1 - Proxying

We are currently inquiring about the use of directives as a way to proxy requests from one url to another server. Proxies can be used for different use cases. For one, if you would like to simply redirect requests from a legacy web service to a new web service, you could want to use proxies.

There are three options available to proxy requests. Each provide a partial solution for proxying but none provide a full one. They are listed below in order of complexity.

A) Using the NameTrans 'redirect' directive.

The documentation indicates that this directive can redirect URLs coming into the web server to another web server at a particular path. It is configured in the following way:

Steps:
1) Make a copy of the obj.conf in the same folder and rename the file as desired. This file will contain the NameTrans directive to redirect the requests.
2) Add the following directive to the new copy of the obj.conf before the NameTrans ntrans-j2ee directive, like below:

<Object name="default">
AuthTrans fn="match-browser" browser="*MSIE*" ssl-unclean-shutdown="true"
NameTrans fn=redirect from=/ws/services/ url=http://dev-a.services.bamnetworks.com:52070/ws/services/
NameTrans fn="ntrans-j2ee" name="j2ee"
...

3) Configure a new virtual server class (VSCLASS) in server.xml.
4) Configure the new virutal server class to use the new obj.conf like below:

<VSCLASS id="vsclass2" objectfile="obj2.conf" >

5) Add the web application instance on which requests will be proxied under this virtual server class.

Disadvantages:
1) Redirect Response code: This directive actually will return a response code of 301 Permanently Moved back to the client requesting the server. The client is responsible for automatically redirecting to the new URL. This is however not default behavior of web service clients, but is for web browsers.

Note: We tried to use this solution for redirecting our web service clients but the generated client does not automatically redirect to the new URL given this HTTP response code.

2) Cross-browser issues: This directive does not solve cross-browser issues either. Although the browser will redirect automatically to a web service, it will not be able to accept incoming data from a domain different from the domain of the current page making the HTTP requests.

B) Using the Reverse Proxy Plug-in.

Monday, December 10, 2007

Actionscript Arrays displayed as objects using typeof operator

The typeof operator applied to an Array object does not display as "array". It still displays as "object".

Monday, December 3, 2007

How to Retrieve FlashVars Data in ActionScript 3.0

You would like to retrieve variables from the embed Flash object as in the following example:

root.loaderInfo.parameters

References: How to Retrieve FlashVars Data in ActionScript 3.0