Friday, 29 April 2016

Integrating File and SOA Service using Oracle Managed File Transfer 12C

1.       Login to the mfl console using below url:


2.       In mfl console you can see three components in top side right corner.






1.       Click on design tab-> left side navigator as you can see source, targets and transfer. Click on source - > enter file location in content folder path.


In advance properties select Trigger file strategy as below and  mention which file name and rest of options keep same .

In Operation tab select  action type as per your requirement.



Source creation completed. Next we have to configure target, before creating target , we should configure soa service.

1.       Create SOA project  with empty bpel component-> next copy the mft wsdl from below location, once you configure mft ,it will create default wsdl’ s in below location

/home/oracle/OracleFMW/Middleware/Oracle_Home/mft/integration/wsdl

Copy the MFTAnyTypeService.wsdl  in your project.
 



1.       Create bpel process using above wsdl file. In my case reading data from mft and inserting into db.


Inserting records into the DB. Here am using assign activity for mapping purpose.




Next deploy the composite into the server.
1.       Next go to the mft console create target as below:



In url place don’t pass entire wsdl-> pass only upto endpoint-> create

Select message type as XML  in Advance properties.

8. Next create transfer between source and target. Target we can create multiple, here I created file and soa service.


In Target service delivery preference properties select delivery method as Inline and Reference File.
Next save the changes and deploy. Click on the   Monitoring, here you can see the transfer instance for your project.



This is the file am sending from folder location.

Now you can see the instance in soa server as well. Go to the em console and check the instance of service.




Here is flow of the instance:


Thank  you Guys.

Wednesday, 3 June 2015

Fixed Length Records Processing to DB in JBOSS Fuse Service Works



 Today am going to explain how to insert fixed length records into db.
 Here is the example:
For processing fixed length file, we need BeanIO or camel BeanIO, in this example am using bean IO.
Bean IO is open source frame work for processing all type of files like fixed length, csv, xml, separated by special characters.

1.      Fixed length file looks like below

    


Based on file we have to define pojo class like below:
package order.sample.com.orderitemsdb;

public class OrerItems {

       String ORDERNUMBER;
       String DATE1;
       String DATE2;
       String AMOUNT;
       String REFNUM;
              …………………,
              …………………,
             …….etc.

             Getter and Setter methods here
}

Add BeanIO dependency in pom.xml



Mapping File for converting fixed length file to xml


Mapping file looks like below, in this mapping file we  have to create the stream like input stream and out stream and each stream use to refer pojo class for fetching property values and we have to mention what is root element for input record .here we can give any name. But if you’re getting inputs from service we have to mentioned exact name of xsd root element.





Call Mapping File from Exchange Process Class


Here am using camel processor for calling java class.

package order.sample.com.orderitemsdb;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.beanio.*;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
import java.io.*;
import java.util.ArrayList;
import javax.inject.Named;

@Named("OrderInput")
public class OrderInputFileProcessor implements Processor {

                // public static void main(String[] args) throws Exception
                @SuppressWarnings("null")
                @Override
                public void process(Exchange exchange) throws Exception {      
                               
System.out.println("OrderInputFileProcessor fixedlenght File coverting into xml file");
                                // create a StreamFactory
                                StreamFactory factory = StreamFactory.newInstance();
                                // load the mapping file
                                factory.load(/order/MappingFile/OrderPaymentInboundMapping.xml);         
                                // use a StreamFactory to create a BeanReader
                BeanReader in = factory.createReader("OrderPaymentInboundRequest",new File(/u01/app/jboss/order/FIN/order.txt));
                                // OrderPaymentInboundRequest this name should match with mapping file input stream name
                                 Object record = null;                     
                                 ArrayList< OrerItems > collectionlist = null;
                                 collectionlist = new ArrayList< OrerItems >();
                //            OrerItems collection = null;              
                        // read records from "input fixed length file"                             
                           Configuration cfg = new Configuration();         
                            cfg.configure("OrderInbound.cfg.xml");
                        Here am using hibernate for inserting records into DB.
                            SessionFactory sessionfactory = cfg.buildSessionFactory();
                             Session session = sessionfactory.openSession();
                              while ((record = in.read()) != null) {
                                  // process each record
                                OrerItems collection = (OrerItems) record;
                             if ("OrderPaymentRequest".equals(in.getRecordName()))
Note: OrderPaymentRequest this name should match with input record in the mapping file.
                             {                             
                               // process the OrerItems
                             collectionlist.add(collection);
                                 try{
                                         session.save(collection);
                                         session.flush(); 
                                                        session.beginTransaction().commit();
                                                        session.clear();
                                         }
                                        catch(Exception e)
                                        {
                                         System.out.println("----------ErrorTrace-------------"+e);
                                        }                     
                            }            
                        }           try{
                  session.close();
                        /*Transaction tx = session.beginTransaction();
                         tx.commit();
                         session.close();
                         sessionfactory.close();*/
                        }        catch(Exception e)
                        {
                         System.out.println("----------ErrorTrace-------------"+e);
                        }
}

Deploying the Project into the JBOSS Server


Before deploying this project add jboss-deployment-structure.xml in below folder structure



Adding external jar files into the sever


If you want add any external jar files into the jboss eap server follow the below steps.
Go to jboss eap folder -> module folder-> system->
\jboss-eap-6.1\modules\system\layers\base
In above location you can see org folder inside create BeanIO folder next create main inside this folder place BeanIO jar.

Next create module.xml like below:



Note: if you are getting class not found exception means some dependency missed in your module folder….
Hope you guys understand this code.

Cheers,

Madhu

Thursday, 18 December 2014

Oracle Service Registry 11g Installation Guide

1. Introduction to Oracle Service Registry:


Oracle Service Registry is not part of Oracle SOA Suit 11g, Oracle Enterprise Repository /Service Registry is a Critical part of SOA governance. The combination of the Enterprise Repository with a UDDI-compliant Service Registry provides a common communication channel for the automated exchange of metadata and service information between service consumers, producers, providers, and additional governance tooling. It provides the visibility, feedback, controls, and analytics to keep your SOA on track to deliver business value. The intense focus on automation helps to overcome barriers to SOA adoption and streamline governance throughout the lifecycle.
Oracle Service Registry (OSR) is a fully V3-compliant implementation of UDDI (Universal Description, Discovery and Integration), and one of the key components of Oracle SOA Suite 11g. It allows us to publish and discover services and service providers, and manage metadata about services (security, transport, or quality service) using taxonomies. Therefore, it plays an important role when trying to improve visibility and promote service reuse. It is also important in the scope of SOA governance.

Service registry is very important for various reasons. It provides a central place where all service definitions are stored. This becomes important when the number of services (including BPEL processes) grows. It helps to maintain overview of services. Service registry also provides a central place where developers can search for existing services. This improves service reuse, which is one of the most important aspects of SOA. Of course, service registry also provides means to publish services for other developers to discover and reuse.

In addition to reuse, service registry can also be helpful when we need to migrate services from one server to the other. This can happen because of various reasons, but one of the most common reasons is the migration between the development, test, and production environments. Service registry is also helpful when we need to version services and manage changes. With service registry we can also develop more loosely-coupled composite applications, because we do not need to hard-code the service URLs. Rather, the application will resolve URLs at run-time. In all cases, service registry is often used together with the ESB. We will not discuss all OSR details in this article. We will demonstrate how to publish a service, how to export/import resources between OSB and OSR, how to browse the OSR using JDeveloper, and how to enable dynamic endpoint lookup in a SOA composite application.

2. OSR User Creation in DB:

2.1. First we need to create OSR user in oracle DB with admin privileges as sysdba.


2.2. Next run the osr jar file from command line welcome window open click on next.

















2.3. Select Installation type as Standalone registry click on next.
















2.4.Create registry folder in middleware home directory 














2.5. Select Registry home path from middleware and select check boxes for shortcuts for the Registry from start and desktop.
















2.6. This windows is optional if we want email configuration we need to configure SMPT server details.














2.7. Administrator Account Configuration  here we need give user name and password to the service Registry controls click on next.













2.8.Database setup here we have to connect to the schema here selecting Populate schema then Click on next.














2.9. Select DB type here select Oracle 10g/11g click on next.














2.10. Provide DB Details of OSR Schema user.














2.11. Select JDBC Data source as default no need to change.















2.12. Next select JDBC Driver location from your db or from web logic server click on next.














2.13. Select account provider information store in DB click on next.













2.14. Select Application server as Oracle Web logic 11g 














2.15. Choose deployment of Domain Configuration.
2.16. Select HTTP port for Service Registry Console click on next.














2.17. Confirmation window click on next if we want change the property go back.















3. Installing Oracle Service Registry in the Same Domain as Oracle SOA Suite:

When installing Oracle Service Registry 11g in the same Weblogic Domain as Oracle SOA Suite, you may see the following error message on the WebLogic Server console when Oracle Service Registry is starting up:


java.lang.LinkageError: loader constraint violation in interface itable
initialization:....

To work around this issue:
Please refer below link:


Solution: Better to create managed server in separate web logic domain. 

 4. Domain Configuration for Service Registry

 4.1. We can configure the domain at levels extending the existing domain. Create new domain with new   
         Application server and managed server.

         Here I am creating separate domain for service registry.








Click on next.


4.2. Select Domain Source as Oracle Service Registry click on next.













4.3. Enter domain location click on next.
















4.4. Enter Password for web logic user click on next.








4.5. Select JDBC Data source as jdbc/registry enter osr db password and click next.















4.6. Select Admin Server setting click on next.













4.7. Change the Admin server port by default it is 7001 we can use any port out of Web logic click on next.















4.8. Click on Done.














5. OSR Server Start:

       Now we can start the Server from OSR_Domain.

       From command line we need to start admin server and osr server as below:








6. Oracle Service Registry Consoles:

Console windows for login to Oracle Service Registry Console and Business Service Control go to Programs-> Oracle Service Registry 11.1.1 click on here we can open consoles.

6.1. Oracle Service Registry:

Login Page: http://localhost:7101/registry/uddi/web











6.2. Business Service Control:

Login Page: http://localhost:7101/registry/uddi/bsc/web











7. UDDI Registry Connection in Oracle JDeveloper11g:

Start JDeveloper and add a new UDDI Registry Connection. We need to provide the UDDIv2 inquiry url ( http://localhost:7101/registry/uddi/inquiry).

   1. Open the JDeveloper -> click on file menu go to new ->Categories -> General ->click on connections.
Select UDDI Registry Connection click on ok.













2.   Enter Inquiry Endpoint URL click on next.













3.Next click on finish and test the connection finally we can see UDDI Registry at Resource palette


















 8. Oracle Service Registry reference links:


Download Oracle Service Registry 11g patch setup from below link:

http://www.oracle.com/technetwork/middleware/registry/downloads/index.html

Download Oracle Service Registry reference guide from below link:

http://www.oracle.com/technetwork/middleware/registry/documentation/index.html


Cheers...happy installation.

Oracle Opatch utility 12c

 Hi Blog Viewers, This post will describes the how to apply single or multiple patches at a time. Prerequisites : Set the Oracle Home and Op...