Saturday, December 12, 2015

Oracle SOA Interview Questions and Answers (File Adapter)

Question: What is “Minimum Age” in File adapter?

Answer: This parameter specifies the minimum age of files to be retrieved. This enables a large file to be completely copied into the input directory before it is retrieved for processing.


Question: What is trigger file in File adapter?

Answer: When we choose “Trigger File” checkbox, file adapter will not poll/read the file/files from specified directory unless it sees trigger file in trigger file directory. Once trigger files is there in the trigger file directory, file adapter will start polling the files.


Question: What is Logical path in File adapter?

Answer: This parameter specifies the logical input directory to be polled. The parameter is of type String. We provide value of logical path in composite.xml file.


Question: How to handle errors when we unable to read/poll a file using file adapter if that file is corrupt?

Answer: We need to use File rejection handler to catch these types of error.


Question: What is Sync-Read in file adapter?

Answer: When we want to read a file in between our BPEL flow then we use this option.


Question: Can we read remote files using file adapter?

Answer: To read file from remote location we need to use FTP adapter.


Question: What is native format?

Answer: when we want to read the file as it, means we don’t want to transform file content to XML format then we use native format option.




Question: What is difference between Transient and Durable processes?

Answer: Below is difference between Transient and Durable process
Transient Process: 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.
Durable Process: 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 activity


Question: Can we set audit level at BPEL level?

Answer: Yes, we can use bpel.config.auditLevel property inside composite.xml file for BPEL process service component to set audit level for BPEL. This property takes precedence over audit level settings at the SOA Infrastructure, service engine, and SOA composite application levels.

<component name="BPELProcess">
   <implementation.bpel src="BPELProcess.bpel" />
   <property name="bpel.config.auditLevel"></property>
</component>


Question: What are disadvantages of Asynchronous process?

Answer: It adds dehydration overhead. This can become a problem if there are large numbers of asynchronous processes waiting for a response since for every callback, a new thread/transaction is needed and a callback needs to be matched to a correlation table which takes longer if there are a lot of open processes. Design processes to be synchronous as much as possible, avoid nesting of asynchronous processes also avoid synchronous processes calling asynchronous processes.


Question: Does Oracle recommend batch processing?

Answer: No, we should avoid batch processing in BPEL as much as we can. Batch processing takes lot of memory and causes a lot overhead for storing audit information. We should put the work to be done in a separate BPEL process and optimize this process. Design for worst case scenarios. Implement retry mechanisms in fault-policies. Implement your own scheduling mechanism to spread the load, if no message level processing is needed, ODI might be an option.


Question: What is idempotent activity?

Answer: An idempotent activity is an activity that can be retried.
This property has the following values:

False: Activity is dehydrated immediately after execution and recorded in the dehydration store. When idempotent is set to False, it provides better failover protection, but may impact performance if the BPEL process accesses the dehydration store frequently.

True (default): If Oracle BPEL Server fails; it performs the activity again after restarting. This is because the server does not dehydrate immediately after the invoke and no record exists that the activity executed. Some examples of where this property can be set to True are: read-only services (for example, CreditRatingService) or local EJB/WSIF invocations that share the instance's transaction.


Question: What is nonBlockingInvoke property?

Answer: This property is used when we use Flow or Flow N in BPEL. By default, Oracle BPEL Process Manager executes in a single thread by executing the branches sequentially instead of in parallel. When this property is set to True, the process manager creates a new thread to perform each branch's invoke activity in parallel. This property is applicable to both durable and transient processes.


Question: What is streamResultToTempFile property in Mediator?

Answer: Until 11g Release 1 11.1.1.3, for XSLT operations in Oracle Mediator, the result was cached into memory as a whole document in binary XML format. For large document processing, this caused out-of-memory errors. Starting with 11g Release 1 11.1.1.4, the streamResultToTempFile property is available. This property enables XSLT results to be streamed to a temporary file and then loaded from the temporary file. Set streamResultToTempFile to yes when processing large payload using XSLT. The default value is no.

<component name="Mediator1">
   <implementation.mediator src="Mediator1.mplan"/>
   <property name="streamResultToTempFile">yes</property>
</component>

This property is recommended only for processing large payloads. Enabling this property could reduce performance for normal payloads.



Question: Which property we have to use to process JMS, AQ or MQ messages on one node in cluster environment.

Answer: we use singleton property in composite.xml file.

<property name="singleton" type="xs:boolean" many="false" override="may">true</property>


Question: Which property we need to use to control number of message processed from MQ at one time?

Answer: we need to use InboundThreadCount property to control number of messages which MQ adapter pick from MQ.


Question: Which property we need to use with singleton property to process the message in sequential order for AQ?

Answer: We need to set activtionInstances=1 along with singleton property for AQ adapter in cluster environment to process message in sequential order.


Question: Can we set IncludeFiles property dynamically for file/ftp adapter?

Answer: No, by default we can’t set IncludeFiles property at run time. But Oracle provided one patch (patchId=10380349), if we apply that then we can use set this property at run time.


Question: What is delay property for AQ adapter?

Answer: This property is used when we don’t want to make the message visible to outside world for some time. Message is visible and ready to read once that delay time expire message. This property is set at Invoke for AQ adapter.


Question: What is adapter.jms.receive.threads property for JMS adapter?

Answer: To improve performance, the adapter.jms.receive.threads property can be tuned for an adapter service. The default value is 1, but multiple inbound threads can be used to improve performance. When specified, the value of adapter.jms.receive.threads is used to spawn multiple inbound poller threads.


Question: What is UseStaging property in file and FTP adapter?

Answer: If the parameter is set to true, then the outbound Oracle File or FTP Adapter writes translated data to a staging file and later streams the staging file to the target file. If the parameter is set to false, then the outbound Oracle File or FTP Adapter does not use an intermediate staging file. It is defined in Outbound JCA File.


Oracle SOA Interview Questions and Answers (Adapter)

Question: Types of Adapters ?

Answer: Transactional & Non- Transactional Adapter

Transactional : Database, JMS, AQ, MQ adapters

Non- Transactional: File & FTP adapter


Question: Difference between Read & Sync-Read operation in File & FTP adapter?

Answer: Read is used when Polling is required to be done while SyncRead is used when you need to read the file in between the flow i.e you want to have a synchrnous communication.


Question: What is File Debatching ?

Answer: When a file contains multiple messages, you can choose to publish messages in a specific number of batches. This is referred to as debatching. During debatching, the file reader, on restart, proceeds from where it left off in the previous run, thereby avoiding duplicate messages. File debatching is supported for files in XML and native formats.


Question: What is File ChunkedRead ?

Answer: This is a feature of Oracle File and FTP Adapters that uses an invoke activity within a while loop to process the target file. This feature enables you to process arbitrarily large files.

If an invalid payload is provided, then ChunkedRead scenarios do not throw an exception. When a translation exception (bad record violating the NXSD specification) is encountered, the return header is populated with the translation exception message that includes details such as line and column where the error occurred. All translation errors do not result in a fault. These errors are manifested as a value in the return header. You must check the jca.file.IsMessageRejected and jca.file.RejectionReason header values to ascertain whether an exception has occurred. Additionally, you can also check the jca.file.NoDataFound header value.


Question: Multiple Directories supported in File & FTP adapter ?

Answer: The Oracle File and FTP Adapters support polling multiple directories within a single activation. You can specify multiple directories in JDeveloper as opposed to a single directory. This is applicable to both physical and logical directories.


Question: What is the use of Trigger file ?

Answer: By default, polling by inbound Oracle File and FTP Adapters start as soon as the endpoint is activated. However, if you want more control over polling, then you can use a file-based trigger. Once the Oracle File or FTP Adapter finds the specified trigger file in a local or remote directory, it starts polling for the files in the inbound directory.

For example, a BPEL process is writing files to a directory and a second BPEL process is polling the same directory for files. If you want the second process to start polling the directory only after the first process has written all the files, then you can use a trigger file. You can configure the first process to create a trigger file at the end. The second process starts polling the inbound directory once it finds the trigger file.


Question: Types of Rejection Message Handler ?

Answer

  • Web Service Handler
  • Custom Java Handler
  • JMS Queue
  • File



Question: What is MDS & Why we use MDS in Oracle SOA?

Answer: MDS stands for Oracle MetaData Service. It is central repository inside Oracle Fusion Middleware. MDS purpose is to provide centralized store where we can keep, manage & access metadata.

Metadata is often defined as data about data, or in other words, pieces of information that describes and gives meaning to other information. Typical examples of metadata used by Oracle Fusion Middleware components are XML files, XSD schema files, XSL transformations, SCA composites, BPEL processes, WSDLs, business rules, Oracle ADF pages, JaveServer Pages (JSP), and Oracle ADF task flows, among others.

The same metadata that is used during the design phase of application is used at application runtime through the metadata service layer. This ensures consistency through the lifecycle of the application. Metadata such as XML files or XSD schema files is usually shared among different components. Therefore, it is not only necessary that those resources can be accessed easily and referenced by all the components, but it is also important that they remain consistent; a change in the metadata should be reflected in all the components that are referencing it. Having only one copy of each metadata resource avoids unnecessary redundancy and guarantees that the changes are made in only one place.


Question: Types of MDS Repository?

Answer: File-Based & DB Based.


Question: What is File-Based MDS Repository?

Answer: The idea behind file-based repositories is to allow developers to have a light repository available in their local environment that can be easily adapted for development and tests; a file-based repository relieves developers of having to configure and maintain an external database while providing necessary functionality, such as file referencing and customizations. These kinds of repositories are easily modified and maintained, since they define a directory structure similar to any other directory structure inside an operating system. They can be navigated and altered using common shell commands or any kind of visual file explorer application. The file-based repository is usually located inside the Oracle JDeveloper home (JDEV_HOME/integration) if the default configuration is used.


Question: What is DB-Based MDS Repository?

Answer: Database-based repositories are used in production environments where robustness is needed. These repositories are created using the Repository Creation Utility (RCU) application from Oracle. This utility helps with the creation of a new database schema with its corresponding tables and objects. Repositories can later be registered or deregistered via the Oracle Enterprise Manager Fusion Middleware Control console.


Question: Which configuration file store MDS configurations?

Answer: The adf-config.xml file is a configuration file that is used to store MDS Configurations.


Question: What type of WSDL file we usually keep in MDS?

Answer: We usually keep Abstract WSDL’s only in MDS.


Question: By how many ways we can handle error/fault in BPEL?

Answer: By using Catch blocks & Fault handling framework.


Question: Can we use both Catch block & fault handling framework in one BPEL?

Answer: Yes, we can have both Catch Block & Fault policies files in one BPEL.


Question: Standard Faults in BPEL?

Answer: Below is the list of Standard Faults in BPEL.

  • bindingFault, conflictingReceive, conflictingRequest, correlationViolation
  • forcedTermination, invalidReply, joinFailure, mismatchedAssignmentFailure
  • remoteFault, repeatedCompensation, selectionFailure, uninitializedVariable


Question: Standard Faults in Mediator?

Answer: Mediator has only one standard fault.

{http://schemas.oracle.com/mediator/faults}mediatorFault.


Question: How to get Fault Trace in CatchAll block?

Answer: By using getFaultAsString() function.


Question: Can we have custom faults in BPEL?

Answer: Yes we can create custom faults in BPEL, these faults are usually called Business Faults and we usually handle it by using specific Catch block.


Question: Can we re throw a fault from Catch blocks?

Answer: Yes, we can re-throw fault from Catch block.


Question: Where we keep fault-policies.xml & fault-binding.xml files?

Answer: We can keep these files either local to project or in MDS and in both the cases we have to specify the path in composite.xml file.



Question: What is OWSM?

Answer: OWSM stands for Oracle Web Service Manager. Oracle Web Services Manager offers a comprehensive and easy-to-use solution for policy management and security of service infrastructure. It is a standalone platform for securing and managing access to web services.


Question: How do we call secured web service from SOA?

Answer: By using OWSM policies.


Question: Can we generate custom OWSM policies?

Answer: Yes, we can create custom OWSM policies.


Question: By how many ways we can add OWSM policy to Web Service?

Answer:

  • Through policy annotations at design time
  • Via the Administration Console at runtime
  • Via Fusion Middleware Control or WLST


Question: When we call secured web service from SOA, which policy we will use “Client” or “Service”?

Answer: When we call secured web service from SOA then we add “Client” policy to reference partner link and when we want to secure our web service then we use “Service” policy.


Question: Can we use OWSM with Oracle Service Bus?

Answer: Yes, we can access OWSM policies from OSB.


Question: Can we attach OWSM policy to multiple composites to secure composites?

Answer: yes, we can apply one policy to all composites in one domain using policy sets.


Question: what is the scope of Policy Sets or where we can apply Policy sets ?

Answer:

  • Domain — all policy subjects of the specified type in a domain
  • Application or Partition—all policy subjects of the specified type in an application or SOA partition
  • Application module or SOA composite—all policy subjects of the specified type in an application module or SOA composite
  • Service or reference—all policy subjects of the specified type in a SOA service or reference
  • Port or component—all policy subjects of the specified type in a port or SOA component


Oracle SOA Interview Questions and Answers (Mediator)

Question: What is role of Mediator?

Answer: Oracle Mediator provides a lightweight framework to mediate between various components within a composite application. Oracle Mediator converts data to facilitate communication between different interfaces exposed by different components that are wired to build a SOA composite application.


Question:Difference between Mediator & OSB?

Answer: OSB is all together different tool which is used for integration like SOA but the main purpose of OSB is to route the information and same we can do with mediator. The main difference two is, we go for Mediator when we want to route information between different components inside composite and go for OSB when we want to route the information between composites. Mediator is used light weight mediation and OSB is used for heavy weight mediation.


Question: What is echo in Oracle Mediator?

Answer: The purpose of the echo option is to expose all the Oracle Mediator functionality as a callable service without having to route it to any other service. For example, you can call an Oracle Mediator to perform a transformation, a validation, or an assignment, and then echo the Oracle Mediator back to your application without routing it anywhere else.

For synchronous operations with a conditional filter, the echo option does not return a response to the caller when the filter condition is set to false. Instead, it returns a null response.

The echo option is available for asynchronous operations only if the Oracle Mediator interface has a callback operation. In this case, the echo is run on a separate thread.


Question: What is resequencing in Mediator ?

Answer: The resequencing feature of the Oracle Mediator reorders sets of messages that might arrive to the Oracle Mediator in the wrong sequence. You can define resequencing for all operations in an Oracle Mediator or for a specific operation.


Question: Resequencing options available in mediator?

Answer:

  • Standard (based on input Id)
  • FIFO(based on time)
  • Best Efforts


Question: What is Schematron Validation?

Answer: Schematron is an XML schema language, and it can be used to validate XML contents in an XML payload.


Question: Types of routing exist in Mediator?

Answer: Static & Dynamic Routing.


Question: What is Dynamic Routing in Mediator ?

Answer: A dynamic routing rule lets you externalize the routing logic to an Oracle Rules Dictionary, which in turn enables dynamic modification of the routing logic in a routing rule.

When you choose to create dynamic routing rule then it creates a new business rule service component that is wired to the Oracle Mediator service component within the SOA composite of the Oracle Mediator service component. The business rule service component includes a rule dictionary. The rule dictionary is a metadata container for the rule engine artifacts, such as fact types, rulesets, rules, decision tables and so on.

Inside routing rules, you need to set endpoint URI.


Question: Types of Static Routing rules?

Answer: Sequential & Parallel.


Question: Which static routing rule support fault policy ?

Answer: Parallel rules only.


Question: How many faults can Oracle Mediator service engine throw ?

Answer: Only One

{http://schemas.oracle.com/mediator/faults}mediatorFault.

Question: Difference between Sequential & Parallel static routing rules ?

Answer:

S.No: Sequential Parallel
1 Oracle Mediator evaluates routings and performs the resulting actions sequentially. Sequential routings are evaluated in the same thread and transaction as the caller Oracle Mediator queues and evaluates routings in parallel in different threads. The messages of each Oracle Mediator service component are retrieved in a weighted, round-robin fashion to ensure that all Oracle Mediator service components receive parallel processing cycles. This is true even if one or more Oracle Mediator service components produce a higher number of messages compared to other components. The weight used is the message priority set when designing an Oracle Mediator service component. Higher numbers of parallel processing cycles are allocated to the components that have higher message priority. You can set the Priority field in the Mediator Editor to indicate the priority of an Oracle Mediator service component. Priorities can range from zero to nine, with nine being the highest priority. The default priority is four.
2 Oracle Mediator always enlists itself into the global transaction propagated through the thread that is processing the incoming message. For example, if an inbound JCA adapter invokes an Oracle Mediator, the Oracle Mediator enlists itself with the transaction that the JCA adapter has initiated. Oracle Mediator initiates a new transaction for processing each parallel rule. The initiated transaction ends with an enqueue to the Oracle Mediator parallel message dehydration store. For example, if an Oracle Mediator service component has one parallel routing rule, one message is enqueued on the Oracle Mediator parallel message dehydration store. The parallel message dispatcher to the store then initiates a transaction, reads the message from the database store, and invokes the target component or service of this routing rule. The transaction initiated by the listener thread is a completely new transaction and is propagated to the target components.
3 Oracle Mediator propagates the transaction through the same thread as the target components while executing the sequential routing rules.
4 Oracle Mediator never commits or rolls back transactions propagated by external entities. Oracle Mediator commits or rolls back transactions because it is the initiator of these transactions. If an operation or event has both sequential and parallel routing rules, first sequential routing rules are evaluated and actions are performed, and then parallel routings are queued for parallel execution.
5 Oracle Mediator manages the transaction only if the thread-invoking Oracle Mediator does not already have an active transaction. For example, if Oracle Mediator is invoked from inbound SOAP services, Oracle Mediator starts a transaction and commits or rolls back the transaction depending on success and failure.


Friday, December 11, 2015

Oracle SOA Interview questions and answers

Part-1 : WSDL and XSD interview questions
Question : What is Web Service ?
Answer: Web service is a piece of code which is available on web (internet). That code of piece can be developed in any language (java, .net etc). A client invokes the web service by sending xml message and it wait for xml response (synchronously or asynchronously).

Question: What is WSDL ?
Answer : WSDL stands for Web Services Description Language
WSDL is a document written in XML. The document describes a Web service. It specifies the location of the service and the operations (or methods) the service exposes.

Question: Explain elements/tags of WSDL ?

  • Types : A container for abstract type definitions defined using XML Schema
  • message - A definition of an abstract message that may consist of multiple parts, each part may be of a different type
  • portType - An abstract set of operations supported by one or more endpoints (commonly known as an interface); operations are defined by an exchange of messages
  • binding - A concrete protocol and data format specification for a particular portType
  • service - A collection of related endpoints, where an endpoint is defined as a combination of a binding and an address (URI)


Question: Difference between Abstract and Concrete WSDL ?
Answer : Abstract WSDL contains only messages and operations. Abstract WSDL is used by SOAP Server.

Where as concrete WSDL contains messages, operations and transport specific information (JMS or Http). This is used by SOAP client.

Question : What is SOAP ?
Answer : SOAP is a simple XML-based protocol to let applications exchange information over HTTP. Or more simply: SOAP is a protocol for accessing a Web Service.

Question : What is XML Schema ?
Answer : An XML Schema describes the structure of an XML document.

Question : Difference between Include and Import in context to XML schema ?
Answer : The fundamental difference between include and import is that you must use import to refer to declarations or definitions that are in a different target namespace and you must use include to refer to declarations or definitions that are (or will be) in the same target namespace.

Question : What is targetNamespace's function?
Answer : <schema xmlns="http://www.w3.org/2001/SchemaXML         targetNamespace="http://www.example.com/name"         xmlns:target="http://www.example.com/name">
The targetNamespace declares a namespace for other xml and xsd documents to refer to this schema. The target prefix in this case refers to the same namespace and you would use it within this schema definition to reference other elements, attributes, types, etc. also defined in this same schema definition.


Part-2: XSL and Transaction interview questions


Question : How to refer another XSL from main XSL file ?

Answer : The <xsl:import> element is a top-level element that is used to import the contents of one style sheet into another.

Note: This element must appear as the first child node of <xsl:stylesheet> or <xsl:transform>. Syntax: <xsl:import href="URI"/>


Question: Why we use Call-template inside XSL ?

Answer : Call-template works similar to the apply-template element in XSLT. Both attach a template to specific XML data. This provides formatting instructions for the XML. The main difference between the two processes is the call function only works with a named template. You must establish a 'name' attribute for the template in order to call it up to format a document.

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
< xsl:call-template name="myTemplate">
< !-- Content: xsl -->
< /xsl:call-template>
< stylesheet>


Question: Difference between XA & Non-XA transaction ?

Answer: 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.


Question: What is inline schema ?

Answer: Inline schemas are XML schema definitions included inside XML instance documents. Like external schema documents, inline schemas can be used to validate that the instance matches the schema constraints.


Question: what is the use of Pick Activity?

Answer: 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.


Question: Design patterns in SOA ?

Question: Difference between Synchronous Process and Asynchronous Process ?

Question: Use of Config Plans ?