Thursday, March 29, 2012

SOA - How to clean the MDS

Sometime, you created some xsd files and deployed to MDS. Then you found you don't need them any more, How should I do now? The answer is we can use script to delete/remove them.

1. SOA WLST
run {SOA_HOME}\common\bin\wlst.cmd
1.1. Online
    wls:/offline> connect('weblogic', 'welcome1', 'localhost:7001')
    wls:/base_domain/serverConfig>deleteMetadata(application='soa-infra', server='AdminServer', docs='/apps/wsdl/**')

NOTE: soa-infra is the application defined by SOA deployment process
            AdminServer is the server name that applications are deployed
            /apps/wsdl/** is the folder/docs name
            deleteMetadata is Metadata Services (MDS) Custom WLST Commands

1.2. Offline
     wls:/offline> sca_removeSharedData('http://localhost:7001', 'wsdl', 'weblogic', 'welcome1')
               
NOTE: wsdl is a sub folder of the 'apps" in MDS repository
             sca_removeSharedData is SOA Suite Custom WLST Commands


2. Weblogic WLST
D:\beasoa\wlserver_10.3\common\bin\wlst.cmd . //Don't use this one


From the experience I got, the online mode works much better. Why I thought that as the offline mode could not delete the composite I deployed. Maybe I made some mistake, but the online mode really work.