522 Patterns: Extended Enterprise SOA and Web Services
WSADMIN options is any supported wsadmin options. For more details about
wsadmin options use -? or -h.
An interpreter shell is created for interactive use. To leave an interactive scripting
session, use the exit command.
D.1.4 WSAdmin Automation Platform examples
Start WSAdmin Automation Platform by entering jwap or wapStart commands in
a command line window or shell prompt. Example D-10 shows how to start
WSAdmin Automation Platform using
jwap -profileName AppServer1 -user ADNAG
-password TheQueen
on Windows. The -profileName is a wsadmin option that
indicates which WebSphere Application Server profile you will use. When
WSAdmin Automation Platform is started you receive the wap> prompt.
Example: D-10 Starting WAP from a command line
C:\wap> jwap -profileName AppServer1 -user ADNAG -password TheQueen
WAP: Starting WAP for WebSphere Application Server.
WASX7209I: Connected to process "dmgr" on node DAGCellManager01 using SOAP
connector; The type of process is: DeploymentManager
WASX7026W: String "WebSphere:type=Server,*" corresponds to 3 different MBeans;
returning first one.
WASX7026W: String "WebSphere:type=Server,*" corresponds to 3 different MBeans;
returning first one.
Default scopes values :
-----------------------
Cell is set to : DAGCell01
Node is set to : DAGCellManager01
Server is set to : dmgr
Warning :
---------
Use the commands "setCell" , "setNode" and "setServer"
to set the name of the default scope that will be used for
all subsequent WAP commands. You may place a call to these
functions at the beginning of every block of commands that
are for a specific scope.
Note: For the complete WSAdmin Automation Platform utility functions syntax,
refer to WSAdmin Automation Platform documentation. The documentation
can be found at <WAP_SOURCE>/docs/wap.html.
WSAdmin Automation Platform examples can be found under
<WAP_SOURCE>/samples directory.
Appendix D. WSAdmin Automation Platform 523
Need help? Type help.
WASX7411W: Ignoring the following provided option: [-wap_path, c:/wap,
-verbose]
WAPisReadyToGo
wap>
Setting default scope values
You can specify the default scopes values for the WSAdmin Automation Platform
commands by using the command setCell, setNode and setServer. In the
example above the cell scope is set to DAGCell01, the node is set to
DAGCellManager01 and the server is set to dmgr.
To change the default node scope type setNode <nodeName>. For example:
setNode ITSOGoodNode
To change the default server scope, type setServer <serverName> For example:
setServer server1
To get the default scopes values use getCell, getNode and getServer
commands.
Creating a JDBC provider
To create a DB2 JDBC provider type the following command:
createJDBCProvider DB2Jdbc_1 -dbtype db2xa -cell [getCell]
To get help on how to use JDBCProvider utility functions type help
JDBCProvider. Example D-11 shows the output of the help command.
Example: D-11 Help JDBCProvider output
wap> help JDBCProvider
JDBCPROVIDER FUNCTIONS:
createJDBCProvider [-node <nodename> | -cell <cellname> | -server
<servername>]
-dbtype <dbvendor>
[-classpath <classpath>]
[-impclass <implementationclass>]
[-attr {{attr1 value} {attr2 value}} ...]
[-<YouNameIt> <value>]
<jdbcprovider_name>
modifyJDBCProvider -dbtype <dbvendor>
[-node <nodename> | -cell <cellname> | -server <servername>]
[-classpath <classpath>]
524 Patterns: Extended Enterprise SOA and Web Services
[-impclass <implementationclass>]
[-attr {{attr1 value} {attr2 value}} ...]
[-<YouNameIt> <value>]
<jdbcprovider_name>
removeJDBCProvider [-node <nodename> | -cell <cellname> | -server <servername>]
<jdbcprovider_name>
Creating a data source
To create a data source for the JDBCProvider DB2Jdbc_1 type the following
command:
createDataSource DB2DS -jdbcprovider DB2Jdbc_1 -scope cell -dbtype db2
-jndi jdbc/DB2DS -cmp on -componentAuthAlias compAA -componentUser
SrIbrahim -componentPassword DonaMarly -containerAuthAlias contAA
-containerUser MaiteMarianeDawudDahrel -containerPassword goodkids
-maxConnections 150 -databaseName DoItDB
This command creates the data source JAAS authentication data alias, CMP
connector and custom properties automatically.
Saving or reseting the configuration
To save the configuration changes, type save. To reset the configuration, type
reset.
Testing a data source connection
To test a data source connection, type the testDataSource command:
testDataSource -scope cell DB2DS -jdbcprovider DB2Jdbc_1 -user andrea
-password goodgirl
More examples
Example D-12, Example D-13, Example D-14, and Example D-15 on page 525
show more uses of the WSAdmin Automation Platform.
Example: D-12 Modifying application server transaction timeout
modifytransactionservice -pot ApplicationServer -totalTranLifetimeTimeout 300
Example: D-13 Setting WebSphere variables
setVar -name DB2_JDBC_DRIVER_PATH -value "/DB2Driver" -scope node
Example: D-14 Modifying log file size
set serverList [$AdminConfig list StreamRedirect]
Appendix D. WSAdmin Automation Platform 525
foreach sl "$serverList" {
modifyconfigobject -cot StreamRedirect -con $sl -maxNumberOfBackupFiles 10
-rolloverSize 100
}
Example: D-15 Installing and starting an application
installApplication -appname MarillionMarbles -earfile
c:/tmp/MarillionMarbles.ear -node [getNode] -server [getServer] -deployejb
-deployejb.dbtype DB2UDB_V81 -BackendIdSelection "{{GreenCardEJB
GreenCardEJB.jar,META-INF/ejb-jar.xml DB2UDBNT_V8_1}}" -verbose
WSAdmin Automation Platform graphical user interface
To start WSAdmin Automation Platform in graphical mode, type jwap -gui. The
graphical mode is only available on jwap command. Figure D-1 shows the
graphical interface.
Figure D-1 WAP Graphical User Interface

Get Patterns: Extended Enterprise SOA and Web Services now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.