Saturday 3 November 2018

Oracle Service Bus Deployment and Remove the Deployed OSB Components


The deployment process is:

1.     Open the Oracle Service Bus (OSB) (http://osb-as-vip.soa-{deployment-environment}.bcc.qld.gov.au:7001/sbconsole) and login using an admin account
2.     On the left navigation bar, Change Center, click Create to create a new session
3.     On the left navigation bar, click System Administration
4.     On the left navigation bar, click Import Resources
5.     Click Browse
6.     Select the deployment archive (.jar) file (dart-application-sbconfig-01.01.00.jar)
7.     Click Next
8.     Click Import
9.     On the left navigation bar, click Execute Customization File
10.  Click Browse
11.  Select the deployment customisation file ({deployment-environment}-dart-application-osb-customization-01.01.00.xml)
11.1        If the following files are not attached to a relevant ITSM7 task, extract them from the Development PVCS project (\\pvcs-prd\pvcs\Development) in the location /Application/Component/Service/dart-application/deployment

dart-application-sbconfig-01.01.00.jar
{deployment-environment}-dart-application-osb-customization-01.01.00.xml

Ensure the revisions labelled with the version label 01.00.00 are the revisions that are extracted.
11.2        A separate deployment customisation file will exist for each target environment. The customisation file for each environment will contain the appropriate settings for that environment.
Environment
Customisation File
DEV
dev-dart-application-osb-customization-01.01.00.xml
TST
tst-dart-application-osb-customization-01.01.00.xml
UAT
uat-dart-application-osb-customization-01.01.00.xml
PRD
prd-dart-application-osb-customization-01.01.00.xml

12.  Click Next
13.  To ensure that only the newly loaded items are altered, select the check box Only Items Changed In Current Session.
14.  Click Execute
15.  On the left navigation bar, Change Center, click Activate to create a new session
16.  Enter the description of: Deployment of DART Application Component Service OSB component revision 01.01.00.
17.  Click Submit



Process to Remove the Deployed OSB Components

1.     Open the Oracle Service Bus (OSB) (http://osb-as-vip.soa-{deployment-environment}.bcc.qld.gov.au:7001/sbconsole) and login using an admin account
2.     On the left navigation bar, Change Center, click View Changes.
3.     Identify the update to be rolled back using the description and execution time to assist.
4.     In the Options column, click the Click to undo this task icon.
5.     The update will now have a task status of Undone.

SOA Composite Deployment and Remove the Deployed Composite


The deployment process is:

1.     Open the Oracle Enterprise Manager (EM) (http://soa-as-vip.soa-{deployment-environment}.com:7002/em) and login using an admin account
2.     On the left navigation bar, click WebLogic Domain > soa_domain.
3.     Right click soa_cluster.
4.     Select SOA Deployment > Deploy
5.     Select the Service archive (SAR) file (sca_dart-application-composite_rev01.01.00.jar)
6.     Select the Configuration Plan file (({deployment-environment}-dart-application-composite_cfgplan-01.01.00.xml)
6.1  If the following files are not attached to a relevant ITSM7 task, extract them from the Development PVCS project (\\pvcs-prd\pvcs\Development) in the location /Application/Component/Service/dart-application/deployment

sca_dart-application-composite_rev01.01.00.jar
({deployment-environment}-dart-application-composite_cfgplan-01.01.00.xml

Ensure the revisions labelled with the version label 01.01.00 are the revisions that are extracted.
6.2  A separate deployment customisation file will exist for each target environment. The customisation file for each environment will contain the appropriate settings for that environment.
Environment
Customisation File
DEV
dev-dart-application-composite_cfgplan-01.01.00.xml
TST
tst-dart-application-composite_cfgplan-01.01.00.xml
UAT
uat-dart-application-composite_cfgplan-01.01.00.xml
PRD
prd-dart-application-composite_cfgplan-01.01.00.xml

7.     Select Next
8.     Select the WebLogic cluster (Farm_soa_domain/soa_domain/soa_cluster) to deploy the composite
9.     Select Next
10.  Confirm that the application will deploy as default revision
11.  Select Deploy
12.  Check the displayed message for any errors.


         Process to Remove the Deployed Composite

1.     Open the Oracle Enterprise Manager (EM) (http://soa-as-vip.soa-{deployment-environment}.com:7002/em) and login using an admin account
2.     On the left navigation bar, click WebLogic Domain > soa_domain.
3.     Right click soa_cluster.
1.     Select SOA Deployment > Undeploy
4.     Select the radio box to the left of the composite to be rolled back.
5.     Click the Next button.
6.     Click the Undeploy button.
7.     Check the displayed message for any errors.

SOA Database Adapter Configuration

1. In the left navigation bar, click Deployments.
2. Click the DbAdapter application (click the name, not the checkbox)
3. Click the Configuration tab, and then click the Outbound Connection Pools tab.
4. Click New
5. Select the radio button for javax.resource.cci.ConnectionFactory and click Next
6. Enter the JNDI Name: eis/db/dart_application_csvc/dart_application_csvc
7. Click Finish
8. Click the Configuration tab, then click the Outbound Connection Pools tab,
and expand the connection factory and click the connection pool eis/db/dart_application_csvc/dart_application_csvc (click on the name, not the checkbox)
9. Select the box to the far right of dataSourceName. An edit box will appear
10. Type in the data source name jdbc/dart_application_csvc/dart_application_csvc.
11. Press the ENTER key to apply the value.
12. Select Save.
13. Click Deployments in the left navigation bar.
14. Select the checkbox next to DbAdapter.
15. Click Update.
16. Select Redeploy this application and confirm the deployment plan location.
17. Click Finish
18. Confirm that the connection pool is added by accessing  DbAdapter >Configuration > Outbound Connection Pools and expanding the connection factory details.
19. Confirm the value of the xADataSource property.

SOA Datasource Configuration


1. Open the Web Logic Server (WLS) console (http://soa-as-vip.soa-{deployment-environment}.com:7002/console) and login using an admin account
2. On the left navigation bar, click Services > JDBC > Data Sources.
3. In the data source table, click New.
4. Enter the data source information
5.1 Name: jdbc/dart_application_csvc/dart_application_csvc
5.2 JNDI Name: jdbc/dart_application_csvc/dart_application_csvc
5.3 Database Type: Oracle
5.4 Check the Database driver is the  correct driver: Oracle’s Driver (Thin) for Instance connections
6. Click Next
7. Untick the Supports Global Transactions checkbox.
8. Click Next
9. Enter the database information based on the database configuration details table in 4.1.
10.1 Database Name: Relevant environment database SID (Column SID in the table)
10.2 Host name: Relevant environment database host name (Column Host in the table)
10.3 Port: Relevant environment database port number (Column Port in the table)
10.4 Database user name: DART_APP_CSVC
10.5 Database user password: Consult DBA for details
11. Click Next
12. Check the entered details and then click Test Configuration. Confirm success message at top of page.
13. Click Next
15. Select the target cluster (soa_cluster) where the SOA component is running.
15. Click Finish

Thursday 18 October 2018

Starting Oracle HTTP Server Instances from the Command Line

Starting Oracle HTTP Server Instances from the Command Line
You can start up Oracle HTTP Server instances from the command line via a script.

Ensure that Node Manager is running.
Enter the following command:
Linux or UNIX: $DOMAIN_HOME/bin/startComponent.sh componentName

Windows: %DOMAIN_HOME%\bin\startComponent.cmd componentName

For example:

$DOMAIN_HOME/bin/startComponent.sh ohs1
The startComponent script contacts Node Manager and runs the nmStart() command.

When prompted, enter your Node Manager password. The system responds with these messages:
Successfully started server componentName...
Successfully disconnected from Node Manager...

Exiting WebLogic Scripting Tool.
Note:

If you encounter any odd system messages upon startup, you can ignore them.

Storing Your Node Manager Password
You can avoid having to enter your Node Manager password every time you launch the server with startComponent command by starting it with the storeUserConfig option for the first time. Do the following:

At the prompt, enter the following command:
$DOMAIN_HOME/bin/startComponent.sh componentName storeUserConfig
The system will prompt for your Node Manager password.

Enter your password.
The system responds with this message:

Creating the key file can reduce the security of your system if it is not kept
in a secured location after it is created. Creating new key...
The username and password that were used for this WebLogic NodeManager
connection are stored in $HOME/.wlst/nm-cfg-myDomainName.props and 
$HOME /.wlst/nm-key-myDomainName.props.
Starting Oracle HTTP Server Instances on a Privileged Port (UNIX Only)
WARNING:

When this procedure is completed, any Oracle HTTP Server processes running from this Oracle Home will be able to bind to privileged ports.

On a UNIX system, TCP ports in a reserved range (typically less than 1024) can only be bound by processes with root privilege. Oracle HTTP Server always runs as a non-root user; that is, the user who installed Oracle Fusion Middleware. On UNIX, special configuration is required to allow Oracle HTTP Server to bind to privileged ports.

To enable Oracle HTTP Server to listen on a port in the reserved range (for example, the default port 80 or port 443) use the following one-time setup on each Oracle HTTP Server machine:

Update the ORACLE_HOME/ohs/bin/launch file by performing the following steps as the super user (if you do not have access to super user privileges, have your system administrator perform these steps):

Change ownership of the file to root:

chown root $ORACLE_HOME/ohs/bin/launch
Change the permissions on the file as follows:

chmod 4750 $ORACLE_HOME/ohs/bin/launch

The steps that require root permissions are now complete.

Modify the port settings for Oracle HTTP Server as described in Managing Ports.

Configure the User and Group directive in httpd.conf.

The configured user ID for User should be the same user ID that created the instance. The configured group ID for Group must be the same group ID used to create the instance. See Oracle HTTP Server Configuration Files. To configure Oracle HTTP Server to run as a different user id see Starting Oracle HTTP Server Instances as a Different User (UNIX Only).

Wednesday 26 September 2018

Inserting data from file into DB using Oracle SOA Database Adapter


In my previous blog I have explained about how to do configuration settings for Database adapter on Weblogic console and how to create a database adapter.
In this blog I am discussing about reading data from a xml file and inserting that data into database. So here I will be explaining
a. How to create a File adapter to pick a xml file from a particular location
b. How to create a Database adapter to insert data.
c. How to transform data from file to table.
I will start with creating a Application.
Open JDeveloper, Go to file select New, from that select Applications – from Items select SOA application and in next window give directory path where you want create this Application.
Click on next, in next window provide project name, click next.
Now from Composite template select “Empty composite”, click finish.
1. Now from Component palette drag File Adapter and place it left “Exposed service” side.
DBInsert
2. Click Next.
DBInsert1
3. Give a proper name for File adapter. Ex: “ReadFileCustomerDetail”. Click Next
DBInsert2
4. Click check box Define from operation and schema. Click Next.
DBInsert3
5. Here I want read file data so I am selecting check box Read file. Click next.
DBInsert4
6. In next step provide location from where file needs to be read.
There are two ways one is Physical and Logical path.
Physical path : If you select this option then whenever you want change your location you should come here and change it.
Logical path : If you select this option then you provide a logical name and every time whenever want to change file path then just change it in Configuration plan file. And also this value can also be changed at run time on Enterprise management console so need to change it through Jdeveloper.
Here I am selecting Physical path option and providing local file location.
In this window we also select other options like
a. Process file recursively.
b. Archive processed file : File will be archived and placed in provided location after successful read.
c. Delete files after successful retrieval : Once file is retrieved from location then that file will be deleted.
Click Next.
DBInsert5
7. Here provide file format which you want read from provided location. Ex : *.xml, CustomerData*.xml.
We can provide file format which needs to be excluded.
Also if file contains multiple records and want to read single or multiple records at a time, that also can be selected here. I want to read one record at a time so I have provided one here.
Click Next.
DBInsert6
8. In next step file age and file polling frequency should be provided. Click Next.
DBInsert7
9. In next step format of file which needs to be read should be provided. Click on search. It will open other window.
DBInsert8
10. In next step click red marked box.
DBInsert9
11. Once click, it will open Import Schema File. Click search button and go to location where file format .xsd file besides. Import that file into project by following next steps.
DBInsert10
DBInsert11
12. Select CustomerDataRequests. Click OK.
DBInsert12
13. Now in URL part CustomerDetail.xsd will appear. Click Next.
DBInsert13
14. Click Finish.
DBInsert14
After this a File adapter will be created in Exposed Services part.
15. Now I will create a BPEL process. While creating a BPEL process I am defining it later so I am selecting Define service later in Template and provide name for BPEL. Click OK.
DBInsert15
16. Now drag a Database Adapter from Component palette into External Services part.
DBInsert16
17. Give name to Service and Click Next.
18. In next step create a new Database Connection. Click on plus sign, it will open one more window. Here provide
a. Connection Name
b. Username
c. Pawword
d. Host Name
e. SID or Service name
f. Port number
Before clicking OK, click Test Connection and check connection was Success or Failure. If connection was Success then click OK.
DBInsert18
19. Next step provide JNDI name which is created on Weblogic console. Click Next.
DBInsert19
20. In next step will see multiple database operation.
Here I have selected insert only. Click next.
DBInsert20
20. Here we should import a table in which we would like to insert Customer data. Click on Import Tables.
DBInsert21
21. Select a Schema in which table is created and click on Query. Once we click on Query it will open list of tables under that schema.
DBInsert22
22. Move that required table from left to right by clicking on arrow provided. Click OK.
DBInsert23
23. Now will see selected table. Click Next.
DBInsert24
24. In next window select a sequence which is created to generate Primary Key. Click on search, it will return list of sequences from that select required sequence. Click Next.
DBInsert25
25. Click Finish. It will create a Database adapter.
26. Now we will have File adapter, BPEL Service and Database adapter.
Now connect File adapter, BPEL and database adapter.
DBInsert26
After connecting all three we will see complete service like below.
DBInsert27
27. Now double click on BPEL.
Drag a receive service from Web service palette and place it in empty BPEL. Receive service will receive file from File adapter.
DBInsert28
28. After that double click receive activity and provide a valid name. Click check box Create instance. Click search button of partner link.
DBInsert29
It will open other window, select partner link which is going to provide file to read. Here ReadFileCustomerDetail will provide file. Click OK.
DBInsert30
29. To create a input variable which will give data from file, click plus to create a new variable. Give a proper name and Click OK.
DBInsert31
30. Now drag Invoke service again from component palette.
Give a valid name, select a partner as Database invoke. Create input and output by clicking on plus. Click OK.
DBInsert33
31. Drag a Transfom activity from Oracle Extensions palette into BPEL.
DBInsert34
32. Click on Transform select input, output and give name for transformation. Click OK.
DBInsert35
33. Now map incoming payload to input of DB adapter as per below screen.
DBInsert36
34. Save all work done. We will see complete service like below screen.
DBInsert37
35. Deployed service into local weblogic server.
36. Placed file into mentioned location with below data.
DBInsert38
37. Data inserted into table successfully.
DBInsert39

Oracle SOA Mediator

Oracle SOA Mediator

Mediator is one of the service component of the Oracle SOA Suite, there are four main functionality of Mediator
  1. Routing : Mediator route incoming payload to the external service based on routing rule
  2. Validate: Mediator performs XSD schema validation , it describes the structure of xml payload
  3. Filter: Mediator defines a filter expression that specifies the service to be invoked if the payload satisfy filter condition
  4. Transform: Mediator performs XSLT transformation , it transforms data suitable for the target                                                                                                                                                                                                                                                                    In this Demo we will be creating a composite application that routs the incoming payload to the BPEL process based on filter expression
    Step 1: Click File –> new –> project –> SOA Project                                                                                                                                       OracleSOAMediator1                                                                                                                                                                                                                              Click OK                                                                                                                                                                                                     Step 2: Enter the project name and click nextOracleSOAMediator2                                                                                                                                                                                                                                         Click Finish                                                                                                                                                                                                     Step 3: Create a Schema for input and output                                                                                                                                                                                                                                            OracleSOAMediator3                                                                           Step 4: Expose a SOAP service, drag a Soap from component panel and drop it in exposed service OracleSOAMediator4                                                                                                                                                                                                                                                                            Name it as ProductDeliver, in WSDL URL click on Generate WSDL from schema as shown aboveOracleSOAMediator5                                                                                                                                                                                                                                                                                   In Interface Type choose Synchronous Interface  and click on + sign at input and name it as Request  , browse for input schema element
    OracleSOAMediator6                                                                                                                                                                                                                                                                                                                      Choose the input element and click OKDo the same for output click on + sign at output and name it as Response, browse for output schema element and click ok OracleSOAMediator7                                                                                                                                                                                                                                                                                                                   Now u have exposed a SOAP Service                                                                                                                                            Step 5: Drag a mediator component from component panel and drop it in Components                                                                                                                                                                                                                                                OracleSOAMediator8                                                                                                                                                                                                                                                                                                 and click OK                                                                                                                                                                            OracleSOAMediator9                                                                                                                                                                                                                               Now connect SOAP service with mediatorStep 6:Drag a BPEL process from component panel and drop it in components, name it as DLF and in Template choose Synchronous BPEL ProcessOracleSOAMediator10                                                          In input click browse and select input schema element, Click OK
    OracleSOAMediator11                                                                                               In output click browse and select output schema element, Click OK
    OracleSOAMediator12                                                                                                 And uncheck Expose as a SOAP Service and click OKNow that u have create a BPEL Process (DLF), Follow same steps to create two more BPEL name it as Emirates and FedExOracleSOAMediator13Now connect this three BPEL to the mediatorOracleSOAMediator14
Double click on mediator, u will find three section pointing to DLF, Emirates and FedEx BPEL
OracleSOAMediator15
In DLF section click on filter to specifies routing rule
OracleSOAMediator16
In routing rule we are going to compare payload element i.e. deliveryLocation  with India,if  true it will route to DLF BPEL
Click OK
Now assign payload to the input of DLF BPEL by click Assign value in mediator
OracleSOAMediator17
After mapping payload with input of DLF BPEL
Click OK
Now that u have mapped input to DLF BPEL, u should get the out from DLF BPEL and mapped it to SOAP response
In Synchronous reply click on Assign value
OracleSOAMediator18
Map the out of DLF BPEL to the SOAP response, Click OK
Now that u have done with DLF BPEL, do the same for Emirates and FedEx
BPEL and assign value for request and response
OracleSOAMediator19
If deliveryLocation  is Dubai,it will route to Emirates BPEL else if deliveryLocation  is USA,it will route to FedEX BPEL
Step 6: Click on DLF BPEL , drag  assign from components panel and place it in BPELOracleSOAMediator20
Double click on assign and concat product name with courier name as shown below
OracleSOAMediator21
Do the same for Emirates and FedEx BPEL
OracleSOAMediator22
OracleSOAMediator23
Save all the changes and deploy the application
Step 7: Test the Application
1)
Request
OracleSOAMediator24
Response
OracleSOAMediator25
2)
Request
OracleSOAMediator26
Response
OracleSOAMediator27
3)
Request
OracleSOAMediator28
Response
OracleSOAMediator29