|
Problem |
Understanding the Virtual Hosts and HTTP Transport channel
settings for Web Services. |
|
Solution |
A Web Service Provider can be accessed through multiple
host:port combinations. For example, say you want to have the web service
accessible through either of the following endpoints:
http://localhost:9080/test/services/HelloWorld
http://localhost:12345/test/services/HelloWorld
Let's say that your application server already has 9080 configured to work
with the endpoint. You now want to add 12345.
In order to set this up, the following must be done:
1) EAR modules are mapped to work with Virtual Hosts. In this example, the
EAR module can be mapped default_host. This default_host already has
"*:9080" as a host alias. Add "*:12345" as a host alias by going in the
Admin Console -> Environment -> Virtual Hosts -> default_host
-> Host Aliases.
2) The Web Container has a layer of abstraction called "HTTP Transports."
Basically, these are like the "inputs" into the Web Container. [This layer
of abstraction can be best seen for ports 9080 and 9090. The Web Container
has *:9080 and *:9090 for the HTTP Transports by default. The admin_host
has the host alias of *:9090, while the default_host has the host alias of
*:9080.] Add "*:12345" to the list.
3) Install the EAR with the Web Service. On Step 3 there is an option to
map a WAR file to a Virtual Host. Ensure that it is set to default_host.
Notes:
1) Two Virtual Hosts cannot have the same alias. By alias, we mean a
"host:port" combination like "localhost:9080" or "*:9080". For example,
admin_host and default_host cannot both have "*:12345." If they do, then
trying to access one will always result in a "Virtual Host or Web
Application Not Found" error message. There will be no error given in the
Admin Console if two virtual hosts have the same alias.
2) If an HTTP Transport is set to a specific host:port, then this must
also exist in the Virtual Host settings. |
|
|
|
|
|
|