Example: Configuring HTTP transport using wsadmin
This example configures the Web container HTTP transport.
- Identify the appserver and assign it to the server variable.
Using Jacl:
set server [$AdminConfig getid /Cell:mycell/Node:mynode/Server:server1/]
Using Jython:
server = AdminConfig.getid('/Cell:mycell/Node:mynode/Server:server1/') print serve
Example output:
server1(cells/mycell/nodes/mynode/servers/server1:server.xml#Server_1)
- Identify the Web container belonging to the server and assign it to the wc variable.
Using Jacl:
set wc [$AdminConfig list WebContainer $server]
Using Jython:
wc = AdminConfig.list('WebContainer', server) print wc
Example output:
(cells/mycell/nodes/mynode/servers/server1:server.xml#WebContainer_1)
- List all the transports belonging to the Web container and assign it to the transports variable.
Using Jacl:
set transportsAttr [$AdminConfig showAttribute $wc transports] set transports [lindex $transportsAttr 0]
Using Jython:
transportsAttr = AdminConfig.showAttribute(wc, 'transports') # eliminate the beginning "[" and the end "]" transports = transportsAttr[1:len(transportsAttr)-1]
These commands return the transport objects from the transports attribute in a list format.
Example
output:
(cells/mycell/nodes/mynode/servers/server1:server.xml#HTTPTransport_1) (cells/mycell/nodes/mynode/servers/server1:server.xml#HTTPTransport_2)
- Identify the transport to be modified and assign it to the transport variable.
Using Jacl:
set transport [lindex $transports 0]
Using Jython:
transport = transports.split(" ")[0]
Example
output:
(cells/mycell/nodes/mynode/servers/server1:server.xml#HTTPTransport_1)
- Modify the address attribute to change the host and port.
Using Jacl:
$AdminConfig modify $transport {{address {{host {myHost}} {port 9081}}}}
Using Jython:
AdminConfig.modify(transport, [['address', [['host', 'myHost'], ['port', 9081]]]])
- Save the changes with the following command:
Using Jacl:
$AdminConfig save
Using Jython:
AdminConfig.save()