Monday, August 19, 2013

Customizing the OSB Service through WLST script

Customizing the OSB Service through WLST script

This post will explain how to Customize the OSB Service through WLST script

The below WLST script will help us to run the OSB customization file.

import sys
from import FileInputStream
from com.bea.wli.config.customization import Customization
from import ALSBImportOperation
from import ALSBConfigurationMBean
from import SessionManagementMBean

def customizeOSBService(customizationFile):
    SessionMBean = None
        connect('weblogic', 'welcome1', 't3://localhost:8000')
        sessionName = String("Customization"+Long(System.currentTimeMillis()).toString())
        SessionMBean = findService("SessionManagement", "")
        OSBConfigurationMBean = findService(String("ALSBConfiguration.").concat(sessionName), "")
        print 'Loading customization File', customizationFile
        iStream = FileInputStream(customizationFile)
        customizationList = Customization.fromXML(iStream)       
        SessionMBean.activateSession(sessionName, "Complete customization using wlst")

        print "Unexpected error:", sys.exc_info()[0]
        if SessionMBean != None:

def main():
        print 'Successfully Completed customization'   

Customization File:

Customization file will help us to modify the environment specific values for a OSB project.
The previous post can be referred for more details on customization file.

Modify the  environment specific values in the customization file.

Running the Script:

Login to the server and copy the wlst script and the Customization file to some location.
Execute the below two commands

CLASSPATH=$CLASSPATH:$OSBHOME/modules/com.bea.common.configfwk_1.5.0.0.jar:$OSBHOME/lib/sb-kernel-api.jar:$OSBHOME/lib/sb-kernel-impl.jar;export CLASSPATH /home/eaiapp/Albin/OSBCustomization.wlst

Before executing the first command change the com.bea.common.configfwk_1.5.0.0.jar file version according to your environment.

After successful execution verify the service from OSB Console

  DOWNLOAD OSBCustomization.wlst


  1. I dont see sb-kernel-api.jar and com.bea.common.configfwk_1.5.0.0.jar in OEPE Please advise what to do in these situation

  2. Hi Albin,
    In OSB 12c, I see the WLS policies are deprecated, we are now upgrading from 11g to 12c for OSB. As of 11g (, WebLogic Security policies were deprecated, and are not supported in 12c (12.1.3). Because WebLogic security policies were available in 11g, deployment of the OWSM Policy Manager and use of the OWSM policies was optional. Since only OWSM policies are supported in 12c, OWSM Policy Manager deployment is mandatory. In my current domain which is on 11g, proxy services are using the WebLogic security policies on wsdl based proxy services, now have to deselect the WebLogic security policies from the proxy service and have to use OWSM policy, Please suggest how it can be done using WLST scripting/customization changes or any other approach in 12c, have to apply the changes on many web service based proxy services.

    Thanks in advance for our remarks.