Tuesday, February 15, 2011

Oracle SOA Interview Questions



SOA/BPEL basic questions

1.    Explain SOA architecture?
2.    Explain WSDL structure?

3.    What is the use of SOA in IT industry and how it resoves the problem?

4.    Why we use BPEL and ESB in SOA?

5.    What is the main concept behind ESB?

6.    What builds up Oracle Fusion Middleware?

7.    What are various parts of Oracle SOA Suite?

8.    What is the main function of Business Rules?

9.    Why we use Web service Manager?

10.  How can we secure our web services using Oracle SOA Suite?


Project Question


11.  Explain about your project Architecture?

12.  How you are using SOA in your architecture (Flow of BPEL--> ESB)?


BPEL Technical’s


13.  What is the use of PICK activity in BPEL PM?

14.  Why we use Decision service?

15.  How can we improve the performance of an XSL file? –

Answer: - By avoiding use of various if statements and using choose, and by using for-each group in place of for-each.

16.  How to deploy an XSL file without deployment of BPEL Process?

Answer: - we will directly deploy the XSLT, options: -

    ü  Using ANT script by file replacement in TMP folder.

    ü  By creating a folder in BPEL PM installation folder and specifying its location in our BPEL code with http        
                 call and replacing our xslt to that location



Question on Dehydration Database


17.  What is the use of Work_Item table?

18.  How can we clear the instances using dehydration database?


ESB Technical’s


19.  How can you call a web service or BPEL process in an ESB?

Answer: -

    ü  By selecting the service of deployed BPEL process -- It creates problem while deployment as it has
                dependencies.

    ü  By copying the wsdl of deployed process and then creating a SOAP service of that process.

20.  What are DVM's and how are they helpful in SOA?

21.  What is end point virtualization?




Monday, February 7, 2011

Oracle SOA Suite Best Practices

As per my day today activities I had discovered some best practices which can be implemented while developing a BPEL, ESB or SOA services. Below are some of the key points.
  • Use of preference variables or deployment descriptors in-spite of hard coding while assigning values.
  • Using ws-addressing schema in Dynamic Partner link while mapping values for header schema or while mapping the URL.
  • Create and copy the commonly used xsl, xsd, wsdl, config xml and other files in a server folder which can be accessed using http call. i.e. create the transformation file and copy it under the location "$ORACLE_HOME/bpel/system/xsd" and access it using "http://<<host:port>>/orabpel/xsd/<<name of file>>"
          Note: - Try avoiding copying the files under Apache location because it might hamper the server performance and in case the server crashes then the file might also get impacted.
  • Designing Integration flow, as all the adapters and routings should come under ESB part and the Implementation logic under the BPEL, so that we can access the adapters and other routings as a web service and whenever an exception is encountered under ESB our BPEL logic would not be impacted. This will also help in system performance.
  • For improving performance of our BPEL/ESB service:-
    • Use assign along with "ora:processXSL" API in place of transform activity or go to source of BPEL code and delete the annotation part under transformation.
    • Implementing conditions as "<xsl:value-of select="<<element node>>[condition]/<<element node>>"/>" rather than using if condition
    • Rare use of for-each and use "for-each group" in place of "for-each", with "version=2.0"

Saturday, February 5, 2011

Transaction Handling in FileAdapter



I struggled a lot while implementing transaction handling in file adapter and come to a solution of using compensation handler for implementation of rollback of files.
Below is the scenario for my requirement: -
We have been provided 2 types of files to different partners and as per our scenario if 1st File transfer is success and the second transfer got failed then the first transfer should also get rolled back.
The solution implemented is: -
1. Create an empty BPEL Process.
2. Create File adapter(1) with read operation linked with receive activity
3. Create a Partner1(File Adapter with write Operation) linked with invoke activity
4. Create another File Adapter with Synch Read Operation linked to another Invoke activty and mapped to another Partner2(File Adapter with write Operation) linked with invoke activity
5. For Implementing Transaction handling, Compensation handler is implemented at scope level and in Compensation handler Partner1 is called for synch read operation and file is written back to location of File Adapter(1).
Below is the bpel code for the above requirement: -
<?xml version = “1.0″ encoding = “UTF-8″ ?>
<process name=”BPELProcess3″
targetNamespace=”http://xmlns.oracle.com/BPELProcess3″
xmlns=”http://schemas.xmlsoap.org/ws/2003/03/business-process/”
xmlns:bpws=”http://schemas.xmlsoap.org/ws/2003/03/business-process/”
xmlns:xp20=”http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20″
xmlns:ns4=”http://xmlns.oracle.com/pcbpel/adapter/file/FileAdapter_SynchRead/”
xmlns:ns7=”http://xmlns.oracle.com/pcbpel/adapter/file/File_Compensate_Write/”
xmlns:ldap=”http://schemas.oracle.com/xpath/extension/ldap”
xmlns:xsd=”http://www.w3.org/2001/XMLSchema”
xmlns:ns5=”http://xmlns.oracle.com/pcbpel/adapter/file/Partner2/”
xmlns:client=”http://xmlns.oracle.com/BPELProcess3″
xmlns:ns6=”http://xmlns.oracle.com/pcbpel/adapter/file/FileCompensate_Rollback/”
xmlns:ora=”http://schemas.oracle.com/xpath/extension”
xmlns:ns1=”http://xmlns.oracle.com/pcbpel/adapter/file/n/”
xmlns:ns3=”http://xmlns.oracle.com/pcbpel/adapter/opaque/”
xmlns:ns2=”http://xmlns.oracle.com/pcbpel/adapter/file/m/”
xmlns:bpelx=”http://schemas.oracle.com/bpel/extension”
xmlns:orcl=”http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc”>
<partnerLinks>
<partnerLink myRole=”Read_role” name=”FileAdapter1″
partnerLinkType=”ns1:Read_plt”/>
<partnerLink name=”Partner1″ partnerRole=”Write_role”
partnerLinkType=”ns2:Write_plt”/>
<partnerLink name=”FileAdapter_SynchRead” partnerRole=”SynchRead_role”
partnerLinkType=”ns4:SynchRead_plt”/>
<partnerLink name=”Partner2″ partnerRole=”Write_role”
partnerLinkType=”ns5:Write_plt”/>
<partnerLink name=”FileCompensate_Rollback” partnerRole=”SynchRead_role”
partnerLinkType=”ns6:SynchRead_plt”/>
<partnerLink name=”File_Compensate_Write” partnerRole=”Write_role”
partnerLinkType=”ns7:Write_plt”/>
</partnerLinks>
<variables>
<variable name=”Receive_1_Read_InputVariable” messageType=”ns1:Read_msg”/>
<variable name=”Invoke_1_Write_InputVariable” messageType=”ns2:Write_msg”/>
<variable name=”Invoke_2_SynchRead_InputVariable”
messageType=”ns4:Empty_msg”/>
<variable name=”Invoke_2_SynchRead_OutputVariable”
messageType=”ns4:SynchRead_msg”/>
<variable name=”Invoke_3_Write_InputVariable” messageType=”ns5:Write_msg”/>
<variable name=”Invoke_4_SynchRead_InputVariable”
messageType=”ns6:Empty_msg”/>
<variable name=”Invoke_4_SynchRead_OutputVariable”
messageType=”ns6:SynchRead_msg”/>
<variable name=”Invoke_5_Write_InputVariable” messageType=”ns7:Write_msg”/>
</variables>
<sequence name=”main”>
<scope name=”Scope_1″>
<faultHandlers>
<catchAll>
<compensate name=”Compensate_1″ scope=”Scope_3″/>
</catchAll>
</faultHandlers>
<sequence name=”Sequence_1″>
<sequence name=”Sequence_1″>
<receive name=”Receive_1″ partnerLink=”FileAdapter1″
portType=”ns1:Read_ptt” operation=”Read”
variable=”Receive_1_Read_InputVariable”
createInstance=”yes”/>
<scope name=”Scope_3″>
<compensationHandler>
<sequence name=”Sequence_2″>
<scope name=”Scope_2″>
<sequence name=”Sequence_3″>
<invoke name=”Invoke_4″
partnerLink=”FileCompensate_Rollback”
portType=”ns6:SynchRead_ptt” operation=”SynchRead”
inputVariable=”Invoke_4_SynchRead_InputVariable”
outputVariable=”Invoke_4_SynchRead_OutputVariable”/>
<assign name=”Assign_3″>
<copy>
<from variable=”Invoke_4_SynchRead_OutputVariable”
part=”opaque” query=”/ns3:opaqueElement”/>
<to variable=”Invoke_5_Write_InputVariable”
part=”opaque” query=”/ns3:opaqueElement”/>
</copy>
</assign>
<invoke name=”Invoke_5″ partnerLink=”File_Compensate_Write”
portType=”ns7:Write_ptt” operation=”Write”
inputVariable=”Invoke_5_Write_InputVariable”/>
</sequence>
</scope>
</sequence>
</compensationHandler>
<sequence name=”Sequence_4″>
<assign name=”Assign_1″>
<copy>
<from variable=”Receive_1_Read_InputVariable” part=”opaque”
query=”/ns3:opaqueElement”/>
<to variable=”Invoke_1_Write_InputVariable” part=”opaque”
query=”/ns3:opaqueElement”/>
</copy>
</assign>
<invoke name=”Invoke_1″ partnerLink=”Partner1″
portType=”ns2:Write_ptt” operation=”Write”
inputVariable=”Invoke_1_Write_InputVariable”/>
</sequence>
</scope>
<scope name=”Scope_4″>
<sequence name=”Sequence_5″>
<invoke name=”Invoke_2″ partnerLink=”FileAdapter_SynchRead”
portType=”ns4:SynchRead_ptt” operation=”SynchRead”
inputVariable=”Invoke_2_SynchRead_InputVariable”
outputVariable=”Invoke_2_SynchRead_OutputVariable”/>
<assign name=”Assign_2″>
<copy>
<from variable=”Invoke_2_SynchRead_OutputVariable”
part=”opaque” query=”/ns3:opaqueElement”/>
<to variable=”Invoke_3_Write_InputVariable” part=”opaque”
query=”/ns3:opaqueElement”/>
</copy>
</assign>
<invoke name=”Invoke_3″ partnerLink=”Partner2″
portType=”ns5:Write_ptt” operation=”Write”
inputVariable=”Invoke_3_Write_InputVariable”/>
</sequence>
</scope>
</sequence>
</sequence>
</scope>
</sequence>
</process>

Datasource Creation using ant script


I worked on a POC for Automated Configurations in ant, and struggled in creating multiple datasource and connection pools at a single go. For that I created an XML file containing all configuration settings as attributes and used for multiple tags.
Below is the part of my XML file and ANT targets.
Configuration XML:-

DataSourceName=”TEST_DataSource” User=”user”
Password=”pass” jndiLocation=”jdbc/TEST_DataSource”
JNDIUrl=”jdbc:oracle:thin:@<>:<>:<>”/>


ANT Target: -

description=”Manage the data sources and database connection pools”>
userid=”${admin.user}”
password=”${admin.password}”
name=”${connPool}”
factoryclass=”oracle.jdbc.pool.OracleDataSource”
applicationname=”default”
dbuser=”${conn.user}”
dbpassword=”${conn.pass}”
url=”${conn.jndi}”/>
userid=”${Configuration-Property.Oracle-Config.Admin_User}”
password=”${Configuration-Property.Oracle-Config.Admin_Pass}”
datasourcename=”${dataSrc}”
applicationname=”default”
jndilocation=”${conn.jndi.location}”
connectionpoolname=”${connPool}”/>
path=”/Configuration-Property/CreateDataSource/DatabaseConnectionPool”

B2B Features with OIC

During last couple of months various new features are getting introduced in Oracle Integration Cloud, out of those there is a new feature f...