Sunday, November 30, 2014

Oracle SOA file adapter example part 2

Continuing from previous part Oracle SOA file adapter examples using mediator, will will now configure File Adapter to write file.

1)  Drag and drop a file adapter in External references lane. Name it as "WriteFileAdapter" click next and then again next on operation window select Write File. Click next again and on file configuration window give directory path where you want to write your file like i did and also give file naming convention.

2) Click next to move on Messages window. click browse for schema file icon and select Writefile from OutputData.xsd. click next and finish the file creation wizard.your composite will now look like as shown below.
3) Now double click on your Mediator component "RouteRequest" It will open .mplan file, click on green + icon and select static routing rule. A popup will come then click on service as we are going to call a service.
4) From preferences select write under WriteFileAdapter. Now we will create a mapping file to map input and output files. Click on transform icon and create a new mapping file as shown below.
 6) Now map firstName with fName and lastName with LName as shown below

7) Now deploy your project on SOA server by directly using JDeveloper or create an SAR file and deploy manually. I suppose you have an idea how to deploy composite on server.
Copy the below lines and create new xml file, then put this file to your file reading directory wait at least some seconds max 1 minute. Your file will get delete from read file directory and will be written in your output file directory, Please check to verify. Lets see instance on enterprise manager.
XML file to use

<?xml version="1.0" encoding="UTF-8" ?>
<!--  $Header: sampleinput.xml 18-may-2007.04:44:38 mahnaray Exp $ -->
<ReadFile xmlns="http://TargetNamespace.com/readFile">
   <ReadFiles>
      <FirstName>Muhammad</FirstName>
 <LastName>Nasir</LastName>
   </ReadFiles>
</ReadFile>



You can expand flow trace to check process execution. Now you can check your write file directory as shown below.
Now you have learned how to configure SOA file adapter for file read and file write. You have learned how to configure and use Oracle Mediator and how to create transformation file. Please don't hesitate to comment if you find any problem.

Oracle SOA File read and Write example using Mediator and File Adapter

The main aim of this post is to show how we can use Mediator in SOA suite and how to configure file read and write adapters. This case could be useful in many cases. This is just a sample example and in real world you can design more complex scenarios using Mediator component. But this post will give you good information how to work with Mediator.

In this post we are going to read an xml file using read operation of file adapter and then we will write this to a file by using another file adapter component.

1) Create a new SOA application using JDeveloper and give name as "SampleFileReadWrite" and click next and name your project as "SampleFileReadWritePro" make sure SOA is select click next and then finish with Empty Composite Template


2) Now we are going to create two XSD files for our File Adapter. This will show how to create an XSD file in SOA. It is schema file that defines input and output of different services. In you project right click on xsd folder. Give name as "InputData" and click OK.

3) Click on the source view of your newly created file, Copy the below XML and past(override) into your InputData file.

<?xml version="1.0" encoding="UTF-8" ?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
            xmlns:tns="http://TargetNamespace.com/readFile"
            targetNamespace="http://TargetNamespace.com/readFile"
            elementFormDefault="qualified"
            attributeFormDefault="unqualified">
  <xsd:element name="ReadFile">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="ReadFiles" minOccurs="1" maxOccurs="unbounded">
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name="FirstName" type="xsd:string"/>
             <xsd:element name="LastName" type="xsd:string"/>
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

</xsd:schema>

4) Similarly create a another XSD file named as "OutputData" and copy below data in it.

<?xml version="1.0" encoding="UTF-8" ?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
            xmlns:tns="http://TargetNamespace.com/readFile"
            targetNamespace="http://TargetNamespace.com/readFile"
            elementFormDefault="qualified"
            attributeFormDefault="unqualified">
  <xsd:element name="Writefile">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="WriteFiles" minOccurs="1" maxOccurs="unbounded">
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name="FName" type="xsd:string"/>
             <xsd:element name="LName" type="xsd:string"/>
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

</xsd:schema>

5) Now click on composite.xml file to open it if its not open already. Drag and Drop a Mediator in Components pallet of composite and give name as "RouteRequest" and select "Define Interface later " as template if not selected already.

6) Now lets configure an inbound File Adapter for file reading. Drag and Drop a File adapter Component in Exposed Services swim-lane. Give name as "ReadFileAdapter"  Click Next then again next and from Operation window select "Read File" as operation type and again click next. On file directories window, give some physical path where your server reside as shown below in my case.
7) Click next to move on File Filtering window. Enter *.xml in Include files with name pattern. click next and let the polling frequency as it is i.e 1.  Click next to move on Messages Window. At the end of URL field click on browse for scheme file icon. Expand project schema file and select readfile under InputData.xsd as shown below
8) Click next and finish the file adapter wizard. Now drag a wire from ReadFileAdapter to RouteRequest mediator. Your composite will look like this now 
Now in next part of this post I will configure File Adapter to write in a file and then will will deploy this application on SOA server and test it.
Click to move on part 2 of this post

Tuesday, October 28, 2014

Error(24,68): SCAC-50012 Oracle SOA BPEL Error in JDeveloper while building application

I was following one of document/tutorial to implement email notification service in BPEL. But after completing it when I tried to build it, It gave Error(24,68): SCAC-50012. It was so generic error that I could not find exact detailed error. So I did again every step that I did to build application and rebuilt application of completion of each step.

Problem came when I created a BPEL process and I left its Input and output variable as it is. I rebuilt the application and It was fine at that point, then according to tutorial I need to past some XSD elements structure to my newly created XSD file. After doing that when I compiled it gave the above error. It could be because I did not mention Input and output parameter in wizard but added new elements to XSD and It could be some data types related error So I solved it first by designing an XSD and then I created BPEL process and gave Input and output parameter. Just sharing my findings and issue resolution. Hope it might help others too.    

Wednesday, September 17, 2014

Oracle OSB tutorial port issue, could not connect over HTTP to server

I was following Oracle OSB tutorial and got the following error

Tried all: '1' addresses, but could not connect over HTTP to server: 'localhost', port: '7021'

I thought that It could be a problem for new person on OSB so I am going to tell how you can resolve this issue. Simply first go to your WSDLs file after creating a new session on OSB and click WSDL file and click on EDIT button. Then scroll down the WSDL file and you will see the end point URI change it to according to your admin server as I did below

After doing in all your WSDLs, go to your business services and click on any business service which you are using. Go to Configuration Details tab and click Edit icon in front of Transport configuration.  and Update your End point URI port according to your WSDL file port as you did above. then click next and finish the wizard and hit save, Activate your session and test again and this time it will be successful.

Sunday, August 17, 2014

Internet of things (IoT), Oracle Internet of things

The inter connection of uniquely identifiable embedded computer like devices within an existing internet infrastructure is refers as Internet of things (IoT).  There is plenty of research and development going on in this field. Business men smell new opportunities of business in this area. Because of ubiquity nature of these devices, the number of devices will increase dramatically in near future.

The more and more of these devices are coming into market and consuming a huge amount of IP addresses. But due to the shortage of IPv4 IP addresses the need of IPv6 has increased intensively. So any research and development of IPv6 would be having a great impact on IoT. There are plenty of new IoT applications coming day by day. The importance of IoT devices and components data has increased.  So now some companies like Oracle providing framework to get this huge amount of data and process it to get valuable information of it.
Oracle provides an infrastructure to integrate and get these devices data securely and easily. Oracle IoT platform provides analytics capabilities and security of data, devices and users. Oracle SOA and BPM suite help integration of IoT with different enterprise application including cloud. For security Oracle IDM can be used and for mobility we can use Oracle mobile platform.

The internet of things (IoT) components and devices generate huge amount of useful data that can be collect and use to get useful information. Well to collect and use this data to gain valuable information is still going on and many developments have already done in this field. The difficulty to get and use this data is because of security, management of data and ever increasing of IoT components. 

Sunday, August 3, 2014

Oracle SOA Suite Mediator component

Oracle mediator provides mediation capabilities like transformation, selective routing and validation. It also provides message exchange patterns like synchronous, asynchronous, and event punishing or subscription. It provide a light weight framework for mediation in intra-composite components such as human workflow, business process etc.

Mediator can transform data from one format to another i.e we can give text file data and then after transformation we can send it to database. You can also use mediator component to consume a business event and for receiving service invocation. It helps integration between event and services. You can define rules based on message payload or header in mediator. You can select any attribute to make a routing rule. You can also set execution type of router either parallel or in sequence. 

Sunday, July 20, 2014

cfgfwk-64069 the following prerequisite found to be missing

I was getting this error while creating domain for Webcenter content

cfgfwk-64069 the following prerequisite found to be missing oracle enterprise manager

I re-installed Webcenter content and then recreated domain too but the same issue was there. I was unable to see Oracle Enterprise Manager in list.

I was starting domain configuration wizard from command line. I did many work around but in vain. Then I opened command line as an Administrator (Right click on command line and select run as administrator) and then I ran the configuration wizard again and surprisingly i found Enterprise manager in list this time and this solved my issue. I hope It would be helpful for other that's why I am sharing it. 

Tuesday, July 15, 2014

"Invalid Service Name" while installing RCU Schema's

Recently I need to create some Schema's using RCU but It was giving error "Invalid Service Name". However DB was connecting fine using SQLDeveloper using ORCL sid. But when i used the same in RCU window it threw above error. Then I checked my tnsnames.ora file and it was having different Service Name like below.


ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1523))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl.add.com)
    )
  )
So Instead of ORCL, I used orcl.add.com and it worked fine.

Tuesday, June 24, 2014

Oracle SOA Certification and Interview questions Part 1


1) Receives messages from the service providers or external partners through SOAP
services or adapters
a) Service Infrastructure                        
b) Service engines

2) A ----- deployed to the same infrastructure must have a unique name across
SOA composite applications
a) Project 
b) Application

3) Oracle --- can only have one inbound service.
a) Mediator 
b) BPEL

4) You cannot drag an outbound service (external reference) to a ---,
because business rules do not support references.
a) Business rule
b) Mediator

5) Which file describes the services and references for the BPEL process
service component
a) .wsdl
b) .bpel
c) .componentType

6) BPEL process ----- can send data to Oracle BAM for analysis and graphical display
through the Oracle BAM adapter
a) file adapter

b) monitors

7) In OSB a business service definition is similar to that of a proxy service, but it does not have--- 

1) Pipelines

8) Business documents are what --- is all about
a) OSB
b) B2B

9) 
Security policy is applied to -------- to provide authentication and authorization.  

a) service endpoints

Tuesday, April 22, 2014

Domain Value Map(DVM) in BPEL, Use in SOA BPEL Transformation file

Domain value mapping(DVM) is very useful feature of BPEL that you can use to transform one vocabulary to another. You can change one value to another. Recently i had a requirement to convert Arabic values to their corresponding English values. So i used DVM in my Transformation fileto perform this.
 Following are some steps to to use DVM in your BPEL and Transformation file to map one value to other.
1) Right click on Project and search type dom you will find Domain Value Map, select it and click ok.
2)  Give name and then in first domain name give some name like Arabic value in my case and give its value i.e in Arabic. Now give the name to second Domain Value like English Value in my case and give Value in English like i did. i.e first Domain value has value in Arabic and second domain value has value in English, click OK

3) Now .dvm file opens and here you can add as may values as you want like i have shown below snap.

4) Now to add this DVM to your Transformation file, go to transformation file and then choose advance functions from Drop down and then select DVM functions and then drag and drop lookupValue1M to your xsl file as shown below.

5) Double click and open newly dragged function and give the following detail to your dvm function. Click on Search icon to find DVM file in dvmLocation field, then also select your source and target column name i.e i am converting from Arabic to English so Arabic is my source value and English is my target value. Now you need to select source value i.e which value you want to change, in my case I am converting Arabic UOM to English and that Arabic value in Coming in UOM field so i will select that, you need to hit Ctrl+Space and here you can see you variables .

I hope this would help. 

Tuesday, March 25, 2014

How to test WSDL/Webservice using SoapUI. What is Soap-UI

In this post I am going to show how to test WSDL or Webservice using SoapUI . SoapUI is a open source cross platform functional testing solution. It is really easy to use for create and execute automated functional, regression, compliance, and load tests. Open SoapUI tool then go to File and Create new soapUI project as  shown below

1)


2) Now give name of your project and select WSDL as shown below
3) Here on the left side you can see the methods of your WSDL that you can invoke
4) Now click on + sign on front of any method and then double click on Request, here your schema will load according to your WSDL method, just give values and hit run icon top of middle screen and then you will saw your result at extreme right side

Monday, February 24, 2014

Oracle Application Adapter error on activating in Weblogic Console resolved

Last couple of days i was facing the following issue when i try to update Apps Adapter in Oracle Weblogic consoleAn error occurred during activation of changes, please see the log for details.
[1] The ra.xml <connection-interface> class 'oracle.tip.adapter.apps.IAppsConnection' was not found in the resource adapter archive/application. 
[2] The ra.xml <connection-impl-class> class 'oracle.tip.adapter.apps.AppsConnection' was not found in the resource adapter archive/application. 
[3] The ra.xml <managedconnectionfactory-class> class 'oracle.tip.adapter.apps.AppsManagedConnectionFactory' was not found in the resource adapter archive/application. 
[4] The ra.xml <connectionfactory-impl-class> class 'oracle.tip.adapter.apps.AppsConnectionFactory' was not found in the resource adapter archive/application.


I was doing following guide to develop a service using Oracle Application Adapter Using Business Events

http://docs.oracle.com/cd/E12839_01/integration.1111/e10537/T430238T430579.htm

but no instance was getting created in Enterprise manager console. then i checked my Apps Adapter in Weblogic console and that was not in OK state. I had configured cluster environment and there were two SOA servers. I had to remove the target from 'cluster' and target it only to WLS_SOA1 server and then i updated and saved it and it started working fine without giving the above error.

Then again i created an Invoice (I was calling invoice Event) and instance created successfully in Enterprise manager console.

Tuesday, February 11, 2014

Forcefully close application in Linux command, Kill process in Linux

In this post i will show you how to forcefully close any application in Linux. I was using JDeveloper and unfortunately it got hang I tried to close it but i was unable to do it. I was looking some functionality like task manager in windows and found some commands to do this task. 
Following are some steps to do it.

1) Type "top" command in terminal and hit enter, you will see the running processes 
2) Find the PID of that application 
3) Then use "sudo killall [PID of that application]"  and hit enter.
Now your application has closed successfully.

Monday, February 10, 2014

Oracle SOA Suite installation required software & tools

To install Oracle SOA server, we need to have and installed following software. Download these software from OTN and then install for Oracle SOA suite environment.
1) Oracle Database 11g or SQL server
2) Repository Creation Utility (to create schema's )
3) WebLogic Server 11g
4) SOA Suite 11g
5) JDeveloper 11g
     JDeveloper extensions for SOA and BPM

You can also install oracle Service bus as per requirements.

Monday, January 27, 2014

Bridged Adapter problem, Host-only adapter problem Linux solved

From couple of weeks i was facing problem while setting my network setting in Virtual box. I explored lot of resources but unable to solve that problem. At last i figure out the issue and solve this problem and now i am sharing here and it could saves much time of others whom are facing the same issue.

 When i tried to choose bridge adapter or host-only adapter then i was facing the "no bridge adapter is selected"  or "no host-only adapter is selected" respectively. here are the snapshot to clear the problem.


I was using window 7 as a host and Virtual box which have Linux based environment for guest system. I wanted to communicate both of these machines but could not. Now what was the issue that i was facing :) little strange.

Open your network and sharing center in host machine i.e Window 7 in my case you will see disabled your network for virtual box. Please see the following snapshot for more clear idea.
oh the host-only network was disabled here and similarly others except my host machine network. Just right click on it and enable it. Now go to your virtual box and got to settings again and choose network setting and this time when you will choose host-only network there will be no issue. have a look at the following snapshot
Cheers! Now have a look at the IP of guest machine as well.