Monday, December 27, 2010

WSADMIN to use an alternate soap.client.props file

Purpose:
Make WSADMIN to use an alternate soap.client.props file.One of the situation where this is very much useful is for HealthCheck scripts.We can pre-populate login and password (encoded) in soap.client.props and can make sure HC script calls wsadmin with that alternate config file (wsadmin -p text_file)

Implementation:
1.)Make a copy of soap.client.props.

cp /usr/IBM/WebSphere/profiles/t1dmgr/properties/soap.client.props
/properties/hc/soap.client.HC.props

Pre-populate the following properties with values:
eg:
com.ibm.SOAP.loginUserid='wasadmin'
com.ibm.SOAP.loginPassword='password'


2.)To encode 'com.ibm.SOAP.loginPassword' in soap.client.HC.props,run the command PropFilePasswordEncoder.sh
$ PropFilePasswordEncoder.sh /properties/hc/soap.client.HC.props com.ibm.SOAP.loginPassword
Create a backup file of the original properties file which contains unencoded passwords? (y/n)
y
NOTE: Backup file /properties/hc/soap.client.HC.props.bak contains unencoded passwords

3.)Create a java properties file(text_file) and specify the location soap.client.HC.props in the property as below
com.ibm.SOAP.ConfigURL=/properties/hc/soap.client.HC.props

4.)Execute wsadmin with option -p:
wsadmin.sh -p text_file
It will connect to wsadmin shell using the encrypted password from the alternative PROPS file from /properties/hc/soap.client.HC.props

1 comment:

  1. Can't thank you enough.

    I was not aware of this possibility.
    Otherwise, I would have to create a modified copy of setupCmdLine.sh to point to differenet soap.client.props.

    ReplyDelete