Thursday, 12 November 2015

SOA Interview Questions

1.What is SOA?
Service Oriented Architecture (SOA): “is an application architecture based on standards, design to achieve loose coupling among interacting software applications providing great flexibility in developing, integrating and managing enterprise applications and thus reduce costs”
2.What is Service?
A service is self contained business functionality. Services are not classes and components.
3.What is web service?
Web service as a software system designed to support interoperable machine-to-machine interaction over a network. It has an interface described in a machine-process able format (specifically Web Services Description Language WSDL). Other systems interact with the Web service in a manner prescribed by its description using SOAP messages, typically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards.
4.What is business service?
It is a logical encapsulation of self contained business functionality.
5.What is the difference between services and components?
Services are logical grouping of components to achieve business functionality. Components are implementation approaches to make a service. The components can be in JAVA, C#, C++ but the services will be exposed in a general format like Web Services.
6.Principles of SOA?
  • Loose coupling
  • Re-usability
  • Interoperability
  • Flexible
7.What is SOA governance? What are its functions?
SOA governance is a concept used for activities related to exercising control over services in a Service Oriented Architecture. Some key activities that are often mentioned as being part of SOA governance are:
Managing the portfolio of services : This includes planning development of new services and updating current services.
Managing the service lifecycle : This is meant to ensure that updates of services do not disturb current services to the consumers.
Using policies to restrict behaviour : Consistency of services can be ensured by having the rules applied to all the created services.
Monitoring performance of services : The consequences of service downtime or under performance can be severe because of service composition. Therefore action can be taken instantly when a problem occurs by monitoring service performance and availability.
8.What is SCA?
Service Component Architecture(SCA) provides a programming model for building applications and systems based on a Service Oriented Architecture. SCA is a model that aims to encompass a wide range of technologies for service components and for the access methods which are used to connect them.

SCA
9.What are the SOA Suite 11g Components?
  • Oracle Adapters
  • Oracle Mediator
  • Business Events and Events Delivery Network
  • Oracle Business Rules
  • Human Workflow
  • Oracle Business Activity Monitoring
  • Oracle Enterprise Manager
10.What are the different design patterns in SOA?
  • Synchronous
  • Asynchronous
  • Fire and Forget
  • Asynchronous Delayed Response
11.What is choreography? How does it differ from orchestration?
In choreography there is no business process to control the integration between the systems; each system will directly integrate with one another in sequence where as in Orchestration there is a business process which controls all the services (source/Target) which is part of the integration.
12.What is local service invocation in SOA 11g?
By default SOA 11g tries to call the services through local service invocation by avoiding SOAP/HTTP instead it used java direct to call the services provided the service exist in the same soa infrastructure this will be checked based on the certain parameters like
Server URL
Front end URL
To disable this following properties can be used in the composite.xml
    <property name="oracle.soa.local.optimization.force">false</property>
     <property name="oracle.webservices.local.optimization">false</property>
13.How to suppress ws-addressing header in SOA 11g?
By Default in SOA 11g, WS-Binding component includes WS-Addressing Headers in both request (when calling external web services) and response (when external clients call Composite web services). This will result into errors as some service providers/clients doesn't understand/process these headers and as a result service invocation fails for both inbound and outbound. To overcome this, you can configure the following property in composite.xml to suppress Ws-Addressing headers.
     Request   <property name="oracle.soa.ws.outbound.omitWSA">true</property>
     Response <property name="oracle.soa.addressing.response.enabled">false</property>
Note: These are not part of property list in JDeveloper. You need to add manually and it works.
14.Correlation vs WS-addressing?
WS-addressing - By default SOA engine uses this. The main advantage of this is developer don't have to write the coding to correlate the message for the callback where as it has its dis-advantage that it adds the header to the SOAP header.
Correlation - This is used when the calling service don't support ws-addressing. Also this does not overhead the message since it used content from the message rather than adding some headers to the request. Correlation sets provide another method for directing web service responses to the correct BPEL process service component instance. You can use correlation sets to identify asynchronous messages to ensure that asynchronous callbacks locate the appropriate client. Correlation sets are a BPEL mechanism that provides for the correlation of asynchronous messages based on message body contents. To use this method, define the correlation sets in your .bpel file. This method is designed for services that do not support WS-Addressing or for certain sophisticated conversation patterns.
15.What are dspMaxThread and recieverThread properties? Why are they important?
ReceiverThreads property specifies the maximum number of MDBs that process Async across all domains. Whereas the dspMaxThreadare the maximum number of MDBs that process Async and threads that operate across a domain. So, we need to ensure that the dspMaxThread value is not greater than Receiver Threads.
16.How to increase the transaction timeouts in SOA?
For the transaction timeout needs to be increased, all the below settings timeout value needs to be changed to the expected Timeout value.
JTA     Engine Bean     Delivery Bean
17.Synchronous & Asynchronous web services?
Whenever a synchronous web service is invoked from Oracle BPEL via a partnerlink, only one port is established for communication with the exposed web service which is used by both request & response messages.
However, when an asynchronous web service is invoked, two ports are opened for communication: one for request & one for response messages.
18.How does Oracle BPEL identify asynchronous responses?
As response from an asynchronous web service is not guaranteed to be received within a specified time frame, and many instances of the same service might be invoked before even a response can be obtained, how does Oracle BPEL identify and relate the responses to the appropriate requests and proceed for completion of further activities that may be scheduled? The answer is "WS-Addressing".
19.How does a Async request run in the backend?
The sequences of events involved in the delivery of invoke messages is as follows:
    The client posts the message to the delivery service. The delivery service saves the invocation message to the dlv_message table. The initial state of the       message is 0 (undelivered).
     The delivery service schedules a dispatcher message to process the invocation message asynchronously.
     The dispatcher message is delivered to the dispatcher through the afterCompletion() call. Therefore, the message is not delivered if the JTA transaction fails.
     The dispatcher sends the JMS message to the queue. Places a very short JMS message in the in-memory queue (jms/collaxa/BPELWorkerQueue) in OC4J JMS.
     The small JMS message triggers the Worker Bean in the downstream step.
    This message is then picked up by a Worker Bean MDB, which requests the dispatcher for work to execute. If the number of Worker Bean MDBs currently       processing activities for the domain is sufficient, the dispatcher module may decide not to request another MDB.
     MDB fetches the invocation message from the dispatcher.
     MDB passes the invocation message to Oracle BPEL Server, which updates the invocation message state to 1 (delivered), creates the instance, and executes the       activities in the flow until a breakpoint activity is reached.
20.What is Dehydration store?
Oracle BPEL process manager utilizes a database to store metadata and instance data during runtime. The process of updating process state in the database is called Dehydration. The Dehydration Store database is used to store process status data, especially for asynchronous BPEL processes. A very important to remember if a BPEL process fails without reaching a dehydration point then the instance will not show up on the BPEL console. This instance never gets stored to the database.
Below are the main Dehydration tables for BPEL:
  • CUBE_INSTANCE
  • CUBE_SCOPE
  • AUDIT_TRAIL
  • AUDIT_DETAILS
  • DLV_MESSAGE
  • DLV_MESSAGE_BIN
  • INVOKE_MESSAGE
  • INVOKE_MESSAGE_BIN
  • DLV_SUBSCRIPTION
  • TASK
  • WORK_ITEM

Following are processes state codes and their meaning
CodeState
0Initiated
1Open and Running
2Open and Suspended
3Open and Faulted
4Closed and (Pending or Cancel)
5Closed and Completed
6Closed and Cancelled
7Closed and Aborted
8Closed and Completed
9Closed and Stale
21.Is it possible to use MS SQL Server as dehydration store with SOA Suite ?if yes how?
Yes it is possible. To automatically maintain long-running asynchronous processes and their current state information in a database while they wait for asynchronous callbacks, you use a database as a dehydration store. Storing the process in a database preserves the process and prevents any loss of state or reliability if a system shuts down or a network problem occurs. This feature increases both BPEL process reliability and scalability. You can also use it to support clustering and failover.
22.How can we secure our web services using Oracle SOA Suite?
When accessing the services should be restricted to the group, then service should be secured via OWSM (Oracle Web service Manager).
23.What is Singleton property in SOA?
In the clustered environment when the processing of the message should happen via only one SOA managed server, then the property singleton needs to be defined at the adapter level.
24.What are transient and durable BPEL processes?
The dehydration store is uses to maintain long-running asynchronous BPEL instances storing state information as they wait for asynchronous callbacks. This ensures the reliability of these processes in the event of server or network loss. Oracle BPEL Process Manager supports two types of processes; transient and durable.
 Transient Processes
       Transient processes do not incur dehydration during their process execution. If an executing process experiences an unhandled fault or the server crashes, instances of a transient process do not leave a trace in the system. Thus, these instances cannot be saved in-flight regardless if they complete normally or abnormally. Transient processes are typically short-lived, request-response style processes. Synchronous processes are examples of transient processes.
 Durable Processes
       Durable processes incur one or more dehydration points in the database during execution. Dehydration is triggered by one of the following activities:
  • Receive activity
  • OnMessage branch in a pick activity
  • OnAlarm branch in a pick activity
  • Wait activity
  • Reply activity
  • checkPoint() within a <bpelx:exec> activity

      Durable processes are typically long-living and initiated through a one-way invocation. Because of out-of-memory and system downtime issues, durable processes cannot be memory-optimized.
Durable:- It is long running process and initiated through a one-way invocation and do incur one or more dehydration points in the database during execution
Transient:- It is short-lived process, request-response style processes and do not incur dehydration during their process execution Ex: Synchronous.
25.What are DVM's and how are they helpful in SOA?
DVM-Domain Value Map is static mappings between a source and target system which can be used in transformations. The value can be changed via SOA composer.
26.What is the difference between XREF and DVM?
XREF- It is dynamic since the values to the XREF can be populated dynamically and it is stored in XREF_DATA table in SOA Dehydration store.
     DVM- Domain Value Map is static mappings between a source and target system which can be used in transformations.
27.What is end point Virtualization?
Generally a service bus is used for endpoint Virtualization and in 11g stack; Oracle Service Bus (OSB) is the primary service bus. In exposed proxy's message flow, it can route the request to any of your environment's actual (physical) service on the basis of whatever logic. Mediator can also be used to expose the service and in mediator routing rule, it can be routed to actual service.
28.What is Decision service?
Oracle SOA Suite provides support a Decision components that support Oracle Business Rules. Decision component is a mechanism for publishing rules and rule sets as reusable service that can be invoked from multiple business processes. These rules can be changed without redeploying the code.
29.Why we use BPEL and OSB?
OSB is the light-weight service bus wherever there is not much business logic involves and there is need to just get the message routed between the systems OSB is used where as when there is more business logic involves in the process, then BPEL will be used.

30.What is MDS?
MDS -Metadata Store : Wsdl and Schemas to be used in the process can be published to the MDS and get it used in the code by referring the artifacts from the MDS
     Advantages: JAR (Deployment unit) size will be reduced. Duplication of the artifacts can be avoided between the services.
31.What is the use of Pick Activity?
This activity waits for the occurrence of one event in a set of events and performs the activity associated with that event. The occurrence of the events is often mutually exclusive (the process either receives an acceptance or rejection message, but not both). If multiple events occur, the selection of the activity to perform depends on which event occurred first. If the events occur nearly simultaneously, there is a race and the choice of activity to be performed is dependent on both timing and implementation.
32.Difference between XA & Non-XA transaction?
Non-XA (Local Transaction): It involves only one resource. When you use Non-XA transaction then you can't involve multiple resources (different databases, Queues, application servers etc), you can rollback or commit transaction for only one resource. There is not transaction manager for this transaction as we are dealing with only one resource at a time.
XA (Global Transaction): It involves more than one resource (different databases, queues, application servers) all participate in one transaction. It uses two-phase commit to ensure that all resources either all commit or rollback any particular transaction. When you have scenario like you need to connect to two different databases, JMS Queue and application server, in this case you will use XA transaction that means all resource participate in one transaction only.
33.How to deploy an XSL file without deployment of BPEL Process?
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.
34.How to change the archive file name in SOA 11g?
By default filename will be written in the format filename_digest_timetamp in archive location.
Setting the below property in jca file will change the format to filename_timetamp.
<property name="UseDigest" value="false"/>
35.What is HA File and FTP Adapters?
In the clustered environment, File and FTP adapters should be used as HA (High-Availability)
     Inbound: It is controlled by Control Files and avoids the race between the manages servers in reading the files where the reference of the files read by the managed servers will be maintained in the control directory.
     Outbound: It is controlled by DB Mutex table exist in the SOA dehydration store and this avoids duplicated been written to the same file when all the managed servers in the clusters process the same messages.
36.What is a pick activity? Can I have a pick activity with no onMessage branch?
Pick activity picks the messages from service (Source) which has multiple operations or the BPEL process needs to receive the messages from multiple source system. Pick activity should have at least on Message branch.
37.What is a flow activity? What is a flowN activity and how does it leverages the flow activity?
Flow activity is used, when parallel execution of the flow is needed and to use this property non blocking invoke should be set as true at the partner link level and no.of execution of parallel flow is defined and static. Where as in FlowN the no.of execution of parallel flow is not static and it is determined during run time.
38.What do you mean by non-idempotent activity? Which all activities are non-idempotent by default?
Activities like Pick, Wait, receive, reply and checkpoint() are called non-Idempotent activity and during the execution of the process whenever these activities are encountered then it gets dehydrated to the dehydration store.
39.How can we embed or use a java code in BPEL?
Using JAVA embedding activity in BPEL, Java code can be embedded in BPEL and can be used.
40.How does pick activity differ from a receive activity?
Pick activity can act as a multiple receive activity in some business scenarios. If we have two inbound operations and both can trigger the bpel process then we will go with pick activity as we can't have two receive activity with create Instance box checked.
41.How can we make a partner link dynamic?
If we have to send the request to different service which has the same wsdl then dynamic partner link will be used and using addressing schema we can set the endpoint dynamic to send the request to the desired service.
42.What is a nonBlockingAll property?
Non- blocking invoke is used when Parallel flow needs to be executed where new thread will be created for each invoke a activity and which will execute simultaneously.
43.What is getPreference property? How do we set it and what advantage it provides?
Hard coding is not a good practice, so to avoid hard coding preference variable can be used and the value of the preference variable is accessed using getPreference().The preference variable value can be changed without re-deploying the code via em console MBean property.
44.How can we improve the performance of an XSL file?
By avoiding use of various if statements and using choose, and by using for-each group in place of for-each.
45.How do we handle transactions in BPEL?
Property needs to be defined to start the new transaction/to continue with the same transactions
Property Name: Transaction and if this has value as required then the BPEL process will be continued in the same transaction where as if the value is defined as requiresnew then it will start the new transaction.
46.When you will go for Sync process?
Whenever the services returns the response in few seconds, it is recommended to go for synchronous BPEL process if not the BPEL process should be Asynchronous. The reason is calling application can't proceed further in case of synchronous process.
File Adapter :
47.What is the behaviour of Inbound File Adapter when it is deployed in single-node environment and cluster node environment?
For Inbound File Adapter in single-node, it picks(reads) the file and single instance is created for each file read. Where as it is quite opposite, in cluster environment. Both nodes of the cluster processes the same file, causing duplicate records in final system

Resolution: this issue could be resolved by two ways:
1)Use Singleton property for the inbound endpoint for SOA composite.
In the clustered environment when the processing of the message should happen via only one SOA managed server, then the property singleton needs to be defined at the adapter level. To enable this just add singletom property to composite.xml.

<service name="CustomerInfo" ui:wsdlLocation="CustomerInfo.wsdl">
<interface.wsdl interface="http://xmlns.oracle.com/ht/soa/jcaadapter/fileadapter/customerinfo#wsdl.interface(Read_ptt)"/

<binding.jca config="CustomerInfo_file.jca">
         <property name="singleton">true</property>
</binding.jca>

</service>

2)To use HAFileAdapter for File Adapter. In the .jca file of Inbound File Adapter change location attribute value fromeis/FileAdapter to eis/HAFileAdapter.

<adapter-config name="CustomerInfo" adapter="File Adapter" wsdlLocation="CustomerInfo.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
  <connection-factory UIexcludeWildcard="*.tif;*.lock" location="eis/HAFileAdapter"       

    UIincludeWildcard="*.*"/>
   <endpoint-activation portType="Read_ptt" operation="Read">
     <activation-spec className="oracle.tip.adapter.file.inbound.FileActivationSpec">
       <property name="DeleteFile" value="false"/>
       <property name="MinimumAge" value="0"/>
       <property name="PhysicalDirectory" value="/u01/shared/einvoice"/>
       <property name="Recursive" value="true"/>
       <property name="PollingFrequency" value="10"/>
       <property name="IncludeFiles" value=".*\..*"/>
       <property name="UseHeaders" value="false"/>
       <property name="ExcludeFiles" value=".*\.tif;.*\.lock"/>
     </activation-spec>
   </endpoint-activation>
 </adapter-config> 


Behind HAFileAdapter is the database used as mutex to ensure the one file is only handled by one instance. By default it uses jdbc/SOADataSource. When using HAFileAdapter in OSB this jdbc/SOADataSource should also target the OSB server nodes as well. This also involves some configuration changes for File Adapter.
You need to set Deployments->File Adapter->Configuration->Outbound Connection Pools->javax.resource.cci.ConnectionFactory->eisHAFileAdapter->controlDir to some shared localtion.
To my understanding the first way is to force to serialize the inbound file processing, which means only one File Adapter is processing a file at one time. HAFileAdapter is using some mutex to ensure one file is only processed by one FileAdapter instance. But the multiple HAFileAdapter can process the different file at the same time. So this is the real solution for high availability environment.
48.What is HA File and FTP Adapters?
In the clustered environment, File and FTP adapters should be used as HA(High-Availability)
     Inbound: It is controlled by Control Files and avoids the race between the manages servers inreading the files where the reference of the files read by the managed servers will be maintained in the control directory.
     Outbound: It is controlled by DB Mutex table exist in the SOA dehydration store and this avoids duplicated been written to the same file when all the managed servers in the clusters process the same messages
49.What are the different operations in file Adapter?
The File Adapter supports four operations. They are:
  • Read File: Polls a file directory for files to retrieve and process (inbound direction).
  • Write File: Creates files in a file directory (outbound direction).
  • Synchronous Read File: Synchronously reads an outbound file using an invoke activity. If the specified file does not exist, then the read invoke activity returns nothing.
  • List Files: Lists file names in specified locations.
50.What is a syncFileRead operation? Is a inbound or a outbound operation? Can my process begin with syncFileRead operation?
When file has to be read in the mid of the BPEL process, then we will use syncFileRead Operation, means some process should initiate the file read process. It is an outbound operation and process can't begin with Sync File read.
51.Can we use a File Adapter to get a file without reading its content?
Yes, by selecting the Do not read file content check box in the JDeveloper wizard while configuring the "Read operation".
52.How to increase performance in BPEL DB and file adapters?
We can increase the performance by writing indexes and sequences. (Or) Go to application server --> Configurations --> Change Xml file
Exception Handling :
53.Explain exception handling in BPEL and what is a error handling framework? How does a error handling framework better than simple error handling in BPEL?
EHF -Whenever any error thrown by the BPEL process/Mediator then EHF will check whether exist in Fault-Bindings.xml files and if so then the action in the Fault-Policy.xml file will be taken and if the action is not found then the fault will the thrown and it will be handled in the catch block.
54.How do we resubmit a faulted process?
Scenario A: The BPEL code uses a fault-policy and a fault is handled using the "ora-human-intervention" activity, then the fault is marked as Recoverable and the instance state is set to "Running".
Scenario B: The BPEL code uses a fault-policy and a fault is caught and re-thrown using the "ora-rethrow fault" action, then the fault is marked as Recoverable and the instance state is set to "Faulted"; provided the fault is a recoverable one (like URL was not available).
55.What are the Predefined errors in BPEL?
  • Custom errors
  • Timed out errors
  • BPM errors
  • Validation Errors
56.What are the Fault Variable Types?
  • assertFailure
  • bindingFault
  • conflictingReceive
  • conflictingRequest
  • conflictingFault
  • correlationFault
  • entityInternalNestedError
  • forcedTermination
  • globalRetry
  • invalidReply
  • invalidVariables
  • joinFailure
  • maxLoopCountExceeded
  • mismatchedAssignmentFailure
  • owsmPolicyFault
  • remoteFault
  • repeatedCompensation
  • rollback
  • selectionFailure
  • timeout
  • uninitializedVariable
57.Unable to find Fault variable in RemoteFault
If you are placing a catch block in your service invocation and trying to catch a system remotefault/bindingfault, you can have following issues :
1. First, your faultVariable is not having any child element like code, summary and detail which are part of the RuntimeFault.
2.Second, when you try to compile the composite, you get below error:
   Error(76): WSDL messageType "{http://schemas.oracle.com/bpel/extension}bindingFault" of variable "" is not defined in any of the WSDL files
Reason for above issues and solution:
The reason why you get this is because when you select the system->RuntimeFault as type of fault in your fault handler, JDeveloper copies a wsdl named RuntimeFault.wsdl from your <JDEVELOPER_HOME%\\integration\seed\soa\shared\bpel directory to your project and this wsdl contains following msg :

<?xml version="1.0" encoding="UTF-8"?>
<definitions name="RuntimeFault"
             targetNamespace="http://schemas.oracle.com/bpel/extension"
             xmlns:xsd="http://www.w3.org/2001/XMLSchema"
             xmlns="http://schemas.xmlsoap.org/wsdl/">

    <message name="RuntimeFaultMessage">
        <part name="code" type="xsd:string"/>
        <part name="summary" type="xsd:string"/>
        <part name="detail" type="xsd:string"/>
    </message>
</definitions>

And secondly, JDeveloper create the faultVariable in your BPEL file (.bepl) like this :
<variable messageType="bpelx:bindingFault" name="FaultVar"/>
Now if you observe, the RuntimeFault.wsdl is having the message name as "RuntimeFaultMessage" where as the variable's messageType is messageType="bpelx:bindingFault" and it is this mismatch which is causing the above mentioned two issues.
To get rid of it, simply change the variables msg type from "bpelx:bindingFault" to "bpelx:RuntimeFaultMessage"  and you are good to go with your composite:
 <variable messageType="bpelx:RuntimeFaultMessage" name="FaultVar"/>
58.What is a throw activity? What it is ?
Throw activity will explicitly throw the fault and this fault will get caught by the catch block and the corresponding actions will get executed.
59.What is a difference between assign and transform activities in BPEL?
AssignTransform
Assign activity is generally used to assign values to variables or initializing the variable values or for transforming small payloads.Transform is used for complex and huge payload transformations.
When you use assign the variables reside in the memorywhere as transformations invoke the use of XSL engine.
Assign activity is really used for straight to straight mapping, it cannot do any validation before mapping.We use the transformation to change the data from one format to another format. In Transform, we can validate the data or check for existence of nodes before doing any assignment through the XSLT constructs like if, choose, for-each which prevents errors at runtime

No comments:

Post a Comment