Monday, December 07, 2009

How to set-up a common Ant project for using the Oracle FMW 11g B2B Ant tasks

Inspired by this great blog posting about how to use the FMW Ant tasks to deploy a SOA composite, I started to use that example to set up my own Ant project for B2B management purposes.

In this blog-posting, I will give an example project that is capable of importing and exporting CPAs to and from Oracle FMW 11g B2B.

Setup the build project
In JDeveloper, create an empty project and name it fmw-build for example. Create the following *.properties
  • env.properties
  • dev.jndi.properties
  • dev.cpacpp.properties
Also, import the ant-b2b-util.xml and the ant-soa-common.xml files that are located in JDEV_HOME\bin folder.

The b2bmanagement.properties files contains all the enviroment specific properties and I used the following contents:


deployment.plan.environment=dev

#dev deployment server weblogic
dev.serverURL=http://localhost:8001
dev.overwrite=true
dev.user=weblogic
dev.password=welcome1
dev.forceDefault=true


# global
wn.bea.home=/home/tomhofte/oracle/fmw11gr2
oracle_home=${wn.bea.home}/Oracle_SOA1
java.passed.home=/home/tomhofte/java/jdk1.6.0_17
wl_home=${wn.bea.home}/wlserver_10.3

libs=/home/tomhofte/libs
path.to.antcontrib.lib=${libs}/ant-contrib/ant-contrib-1.0b3.jar


dev.JAVA_HOME=/home/tomhofte/java/jdk1.6.0_17
#Empty home is enough to let it work
dev.ANT_HOME=


The dev.jndi.properties file contains the jndi properties of my local development environment. I used the following contents:


java.naming.provider.url=t3://localhost:8001
java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
java.naming.security.principal=weblogic
java.naming.security.credentials=welcome1


The dev.cpacpp.properties contains the cpa/cpp import/export properties for my local development environment. Please have a look here for more information about this part. Please note that for importing exporting a CPA you first have to export the design repository and specify the resulting zip file as the input for the CPA/CPP export utility. The contents I used are:


# CPP/A Output files
oracle.tip.b2b.ebms.OutputFolder=b2b-tmp/output/

# Oracle B2B Metadata File in case of CPA Export
oracle.tip.b2b.ebms.Document=b2b-tmp/output/Paris.zip

# ebXML CPA File incase of CPA Import
#oracle.tip.b2b.ebms.Document=/tmp/input/cpa-example-2_0.xml


# Host Name
oracle.tip.b2b.ebms.Host=Berlin
# Host endPoint Details
oracle.tip.b2b.ebms.HostEndPoint=http://localhost:8001/b2b/transportServlet
# Host Certificate Alias
oracle.tip.b2b.ebms.HostCertificateAlias=Berlin
# Trading Partner Certificate Alias
oracle.tip.b2b.ebms.TPCertificateAlias=Paris
# BPSS Export
oracle.tip.b2b.ebms.BPSSExport=false

#Log config
oracle.tip.b2b.ebms.LogFolder=b2b-tmp/output/log/
# DEBUG|INFO|ERROR
oracle.tip.b2b.ebms.LogLevel=DEBUG
# text|xml
oracle.tip.b2b.ebms.LogType=text


Now that all required property files are in place, I use an Ant wrapper script to call the tasks in the ant-b2b-util.xml file and provide the necessary properties. Just as is done in this posting. Here are the contents of my b2b-management.xml file:

(Note: for layout purposes I had to use explicit XML end tags..:()






























Note: In the ant-b2b-util.xml I had to replace the oracle.home property with a oracle_home named property to be able to use my own oracle home property. At least, this is the case when I execute the script from JDeveloper 11g. Apparently, the oracle.home property file is predefined by JDeveloper, because I get an "Override ignored" message.. I think it won't matter when you execute the script from the command line..

More info about the usage of the tasks defined in the ant-b2b-util.xml can be found here:

http://download.oracle.com/docs/cd/E15523_01/integration.1111/e10229/scrpt_imp_exp_dep.htm#CEGBDIDB

2 comments:

Ricky said...

A few years ago a pair of young advertising executives (Dave and Alex) rated 200 B2B print ads: only 5% were rated as excellent; one-fifth as mediocre and the large majority (79%) as poor. Dave is still around and is currently paired with someone called Eddy (of the Dave and Eddy show) but the evidence shows that B2B advertising has matured substantially in just a few short years.

sap software training said...

I don’t have much knowledge about this topic. I am a beginner so this is new for me. I find the code quite difficult and seem it will take time to learn all this but I want to say that all your information is very useful and please post if there is any easy way to do the same.