Powered By Blogger

Friday, August 2, 2013

WLST command to deploy multiple SOA composites

In my previous post, we have seen how to deploy single composite using WLST command.

Unfortunately , there is no WLST command which deploys all the composites to the Server at once.
We need to handle this separately. There are various ways to achieve this. You can use either Ant script available from Oracle and needs to be tweaked little bit . We can use shell script with the Same WLST Command repeated multiple times for each composite.

I am going to discuss here about the python way. Yes, I am going to show how we can achieve this using python script.

The following are the steps for the same.

1. First define the soadeploy.properties file
The content of the file is shown below
# The address and port of the SOA server
soa.soa_server = localhost:8001
# The absolute path to the folder containing the JAR files
soa.jar_location = /xyzfolder/app/soa/sar/
# The absolute path to the folder containing the XML files
soa.xml_location = /xyzfolder/app/soa/config/
# The WebLogic username
soa.username = weblogic
# The WebLogic password
soa.password = weblogic1

2.Next write the python script soadeploy.py as shown below

from java.io import FileInputStream

# This python scripts deploys all the composites listed below to a particular SOA server


print '*** Script invocation : Starting ***'

readSOAProperties = FileInputStream("soadeploy.properties")
configProps = Properties()
configProps.load(readSOAProperties)
   
soa_server = configProps.get("soa.soa_server")
jar_location = configProps.get("soa.jar_location")
xml_location = configProps.get("soa.xml_location")
username = configProps.get("soa.username")
password = configProps.get("soa.password")

# list of composites, JARs in left column, XMLs in right column
composites = [
['sca_ABC_rev25.jar',    'ABC_cfgplan.xml'],
['sca_XYZ_rev26.jar',    'XYZ_cfgplan.xml'],
['sca_MNO_rev27.jar',    'MNO_cfgplan.xml']
]

   
for composite in composites:
    print '----------------------------------------------------------------------------------------------------'
    print 'Starting  to deploy: ' + composite[0]
   
    try:
        if composite[1] is None:
            # No config file
            configpath = None
        else:
            # Config file exists
            configpath = xml_location + composite[1]

        sca_deployComposite(soa_server,jar_location + composite[0],true,username,password,true,configpath)

    except:
        print 'Failed to deploy: ' + composite[0]
        pass
   
    print '----------------------------------------------------------------------------------------------------'
       
print 'All composites deployed successfully'
exit()

print '*** Script Invocation : STOPPED ***'




3.  Follow the steps to run the above script

 Run the python script using the wlst executable located in the SOA_HOME/common/bin directory. For example:
$ /soainstallationfolder/app/oracle/mw_home/Oracle_SOA/common/bin/./wlst.sh soadeploy.py

Verify all the composites are deployed to the server



Wednesday, July 31, 2013

WLST commands for deploying SOA composite



WLST commands for deploying SOA composite
1.Go to the following directory
/soainstallationfolder/mw_home_1/Oracle_SOA1/common/bin/
2. Run the following command
./wlst.sh
3. You  would get the following
wls:/offline>
4. Now Given this command to deploy
sca_deployComposite("http://SoaServer:8001","/abcfolder/ /soa/sar/sca_SampleComposite_rev10.jar",true,"weblogic","weblogic1",true,"/xyzfolder/soa/config/SampleComposite_cfgplan.xml")
5. You will see the message

serverURL = http:// SoaServer:8001
sarLocation = /abcfolder/soa/sar/sca_SampleComposite_rev10.jar partition = default
overwrite = 1
user = weblogic
forceDefault = 1
configplan = / xyzfolder/soa/config/SampleComposite_cfgplan.xml
keepInstancesOnRedeploy = 0
timeout = -1
set user and password...
set config plan...
Processing sar=/abcfolder/soa/sar/sca_SampleComposite_rev10.jar partition = default
Adding sar file - /abcfolder/soa/sar/sca_SampleComposite_rev10.jar partition = default
INFO: Creating HTTP connection to host:soaserver, port:8001
INFO: Received HTTP response from the server, response code=200
---->Deploying composite success.

6. Go to the em and check if the composite has been deployed.

Note: For each composite you need to execute this command. In future post I will tell how to execute All the composites in single command

Monday, July 29, 2013

How To Call Secure Siebel Webservice Mustunderstand Policy




 Pre-requisites
-----------------
1. You should know how to invoke Siebel webservice using invoke activity from bpel or by dragging siebel webservice on External references and linking BPEL to this siebel webservice
2. You should setup  wss_username_token_client_policy_mustunderstand policy at SOA Server. This you need to get it from Oracle Support metalink. Search through mustunderstand policy.

 Once the above steps are set then follow these :-

1. Go to composite.xml file , open in design mode

2. Right click on the external reference service(The siebel webservice which is visible in External references)  and select “Configure WS policies”

3. Under the security tab, click add button and select “oracle/ wss_username_token_client_policy_mustunderstand

Please note that this policy needs to be setup separately at server level which you can get it from Oracle Support Metalink. You need to have this account through the organization where you work.