Monday, October 7, 2019

SOA Interview Questions and Answers(Fault handling)

1.Standard faults in BPEL?

Ans: Binding faults
        Selection failure
        Remote faults
        Invalid reply
        join failure

2.How to get fault trace in catch all block?

Ans: By using get fault As String () function.

3.Can we have custom faults in Bpel ?

Ans: yes, we can create custom faults in Bpel,those faults are usually called Business faults and we usually handle it by using specific catch block.


4. Can we re-throw fault from catch block?

Ans: Yes, we can re-throw fault in catch block using re-throw activity.

5. where we keep fault-policies.xml or fault.binding.xml files ?

Ans: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 "

Fault management form-work: Two xml files.

a) fault -policies.xml
b)fault -binding.xml

-Scope level we are applying catch and catching block.
catch all-Can handle any kind of exception.
Catch-Supports particular exception.



Sunday, September 29, 2019

SOA Interview Questions and Answers part-1

1.What is SOA?

Ans: SOA is an architecture for building applications using reusable, interoperable services which have well defined business functionalities and can be orchestrated to achieve a specific functionality by utilizing them together.


2.What is Web Service ?


Ans: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)



3.What is WSDL ?


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


4.Explain elements/tags of WSDL?

Ans:Types, messages, port type, Binding, Services.
  a) Types:      Pointing to XSD
  b)messages: Based on operation, we are creating multiple message,each                            message pointing to one element in XSD. Syn-operation two                              message,a syn-operation we have to create two-message,one                            way operation create one message
  c)Port type: it means define the list of operations
  d)Binding  :Its contains style of communication(RPC,Document)
  e)Services :Its  contains communication address in the URL 

5. Difference between Abstract and Concrete WSDL ?

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

6.Difference between Include and Import in context to XML schema ?

Ans: 

Include:If two files(xsd) Target namespace same is called 'include'
Import:if two files (xsd) target namespace is different, have to use import.

7.What is the difference between 

Ans:Sequence- flowing the order all elements in XSD
       Choice-only one element in XSD
       All:all elements in XSD,don't ' flowing order
8.What is the difference between Complex type and simple type ?

Complex: 1. To declare child elements
               2. To do reuse-ability  

In reuse-ability scenario, We are providing has to complex type.

Simple type: We are using to apply "restriction on element "
                 - length,list of values,Range of values,Pattern.
9.In WSDL can we have multiple port types?
Ans: Yes

10.In WSDL Can we have multiple bindings?

Ans: Yes

11.By Seeing WSDL, can we justify syn or asyn  or one way operation ?

Ans: Yes, we can justify, syn- operation contain two messages, one input message and one out message.

One way operation contains only one operation.

The structure asyn-operation different, it contains two port types, each port type one contains only one operation,each operation contains only one input message.

In Bpel my syn-flow,start with "receive and end with reply".  
one way -flow start with" receive and there is no reply".
asyn-flow start with "receive and end with invoke".(Call back handler)

12.What is the difference between receive and pick activity?

Ans:If the expose service contains single operation, we can go with receive.
        if the expose service contains multiple operation, we have to use pick activity.

13.What is the difference between  expose service and external reference ?

Ans:Expose service, we are creating based on "XSD"
       External reference we are creating based  on service URL.

14.What is the difference  between partner role and my role in partner link?

Ans:my role we are using while exposing the service
       partner role we are selective for external reference.

15. What is the difference between Assign and Transformation ?

Ans:Assign support one to one mapping, its internally uses X path to transform data .

Transform  support one to one mapping and one to many mapping, many to many mapping , many to one mapping ,it internal uses XSLT to transform data.


X-path:X-path is the Query language to process my XML data.

16.How can we declare collection in Schema?

Ans:We have to use minoccures & Max-occurs to declare collections in Schema.If dont  provide any values to minoccures & Max-occurs by default,it taking "1 and 1".

17.We want do parallel processing of data, what is the activity, we have to use?

Ans:We have to use flow activity.

Single Thread Model:

It set this property in composite.xml.it set true.

<property name : "single thread model" value ="true"/> 

Advantage  of this, it allows one thread to process.


18.What is the difference between compensate and compensate scope?

Ans:If we use compensate we will revert all scopes executed till that point.
       if we use compensate scope we can revert particular scope   



19.What is the difference between  flow and flowN?

Ans:flow activity used to perform one or more activities parallel.we have to specify the parallel flows in design time.
flow N activity used to generate and execute number of parallel flows dynamically at run time,based on the N values. N values logically decides based on the input data.

20.Types of rejection message handlers ?

Ans:a.Web service handler
       b.Custom java handler
       c.JMS Queue
       d.file  





Thursday, September 12, 2019

For Each action in OSB 12C

In Oracle Service Bus 12c you can use the for-each action to iterate multiple elements in your input.


I want this post to show you how we can use for each component of the OSB 12c to iterate through a list of EMPLOYS.

Suppose we have the input,

<EMPLOYS>
<EMPLOY>
<ID>1</ID>
<NAME>Manohar</NAME>
</EMPLOY>
<EMPLOY>
<ID>2</ID>
<NAME>Ram</NAME>
</EMPLOY>
<EMPLOY>
<ID>3</ID>
<NAME>AnkaBabu</NAME>
</EMPLOY>
<EMPLOY>
<ID>4</ID>
<NAME>SAI</NAME>
</EMPLOY>

</EMPLOYS>

and want to log the EMPLOY node.

Let’s go through an example and see how For Each component works:
1) Create a Service Bus application with Service Bus project
2) Create a pipeline



3) Double click on the pipeline and drag and drop the pipeline pair node. Drag and drop the For Each component from the component pallet under the Request stage:

4) Configure the For Each properties like below:
Let’s see the properties:
  • For Each Value: Configure the variable that need to iterate. In our case we have configured body as we have the payload in our body only.
  • Expression: Which node you need to iterate. In our case we have configured ./EMPLOYS/EMPLOY as we need to iterate each EMPLOY node from the payload.
  • Value Variable: You can leave it blank, not required.
  • Index Variable: This is the variable that keeps the track of current index.
  • Counter Variable: This is the variable that contains the total no of nodes available in the payload.
5) Drag the log activity from the component pallet under the For Each and put the expression:
$body/EMPLOYS/EMPLOY[xs:int($currentIndex)]
Let’s run the pipeline and see the logs





DVM(Domain Value Maps) in OSB_12C

Here I am going through the Domain Value map (DVM) functionality in OSB 12c.
In the 12c versions of OSB, Support for the DVM is included, Hence lets discuss the use case and Steps to implement DVM.


Use Case 

Simple Integration  Scenarios, Where Source system, Which sends data to Target System needs domain conversion of values.

A very typical example is Country name to Country Code conversion using DVM, i.e. Source system sends Country name and Target system expects Country code.

dvm:lookup function returns a string by looking up the value for the target column in a domain value map, where the source column contains the given source value.

dvm:lookup(dvm-location, src-column, src-value, target-column, default-value)

Design:


Step 1 :
Open Jdevloper 12c (Service Bus console can also be used), Create a Service Bus Project.
I have given name to project as 'DVM'

Step 2:

Create Source and target Schemas or WSDL (This is not a essential Step). For better demonstration, I Have used WSDL.

Step 3:

Create a Domain value map (CountryName_Code.dvm) and Add the Domain Name and Values. Atleast 2 rows needs be added.

Step 4:


Create a XSLT mapper (CountryNameToCode.xsl), Choose Source and Target to this mapper from your WSDL.

Step 5 :

User mapper to drag and Drop mapping element.

Step 6:

Go to XSLT source view and Edit the code as below.

<CountryCode>          
            <xsl:value-of select="DVMFunctions:lookupValue (&quot;SBProject_DVM/CountryName_Code&quot;, &quot;Name&quot;, string(/ns0:process/ns0:CountryName), &quot;Code&quot;, &quot;Unknown&quot; )"/>
 </CountryCode>

Now if you go to Design view, the below design will be visible

Step 7:

Create a new Pipeline Based on your WSDL and go to design view.
Add Pipeline pair to it, 
Inside Request Pipeline add a Stage. Inside stage add a 'Replace' action.
Inside Response Pipeline add a Reply action with Success.

Step 8:

Lets go to Replace action and use the Earlier created XSLT mapper to do the DVM  task.

In the input Field add the Variable which contains input element, as below

Step 9:


Save your changes and Export is to deploy to Test Server or Deploy directly from Jdeveloper.

Wednesday, September 11, 2019

Difference Between : Routing action Vs Service Callout Vs Publish action in OSB

When you are first starting with OSB it can be a little tricky to determine when to use a Route, Service Callout or a Publish node.  All three can be used to call either a Business service or a local Proxy service.  You can use the following lists to determine which will best fit your needs.
Route:
  1. Last node in request processing.  It can be thought of as a bridge between request pipeline processing and the response pipeline processing.
  2. You can only execute one route in your Proxy Service.
  3. Can only be created in a route node.
  4. OSB will wait for the Route call to finish before continuing to process.
    1. If you are calling a Business service and you specify Best Effort for QoS (Quality of Service), then OSB will release the thread it is holding while the business service executes.
    2. If you are calling a Business service and you specify Exactly Once or At Least Once for QoS, then OSB will hold onto the thread while the business service executes.
    3. If you are calling a local Proxy service, then OSB will hold onto the thread until the Proxy service finishes executing.
Service Callout:
  1. Can have multiple Service Callout nodes in a Proxy service.
  2. Pipeline processing will continue after a Service Callout.
  3. Can be invoked from the request and/or response pipelines.
  4. Used to enrich the incoming request or outgoing response. For example, a call to get a country code.
  5. Used for real time request/response calls (Synchronous calls).
  6. OSB will hold a thread and not continue until the Service Callout completes.
  7. Can tie up resources and degrade performance under heavy loads.
Publish:
  1. Can be synchronous or asynchronous
    1. If you are calling a business service with a Quality of Service of Best Effort , then it will be an asynchronous call.
    2. If you call a business service with a Quality of Service of Exactly Once or At Least Once, OSB will wait until the processing completes in the business service completes before proceeding and it is effectively a synchronous call.
    3. If you are calling a local proxy service, OSB will wait until the processing in the local proxy service completes and it is effectively a synchronous call.
  2. Can be invoked from the request and/or response pipelines.
  3. Best to use when you do not need to wait for a response from the process you are calling (Fire and Forget.... Asynchronous Calls)





Tuesday, September 10, 2019

The Server Instance cannot be started because the Integrated Weblogic domain was not built successfully.

Problem :

[Waiting for the domain to finish building…]
[03:13:25 PM] Creating Integrated Weblogic domain…
[03:13:31 PM] ERROR:  An error occurred while building the default domain.
Please see this log file for more details:
C:\Users\manohar\AppData\Roaming\JDeveloper\system11.1.1.9.40.66.73\o.j2ee.adrs\CreateDefaultDomain.log
The Server Instance cannot be started because the Integrated Weblogic domain was not built successfully.
Reason:
Domain creation fails after installing on new Windows version

When JDeveloper is installed on a newly released Windows version, it is possible that Jython, which is used by Oracle WebLogic Server’s script tool, does not recognize the Windows version and instead assumes that it is running in a Linux environment.

This causes domain creation to fail with the following error in CreateDefaultDomain.log:

wlst > Failed to get environment, environ will be empty: (0, ‘Failed to /
execute command ([\’sh\’, \’-c\’, \’env\’]): java.io.IOException: Cannot run /
program « sh »: CreateProcess error=2, The system cannot find the file /
specified’)/
@ wlst > Error: ADRS_DOMAIN_PASSWORD environment variable not set.

The workaround is to obtain a patch for jython-modules.jar, or to run on a supported version of Windows.

Solution :

jdeveloper 12c generic installer windows 10 integrated weblogic cannot create domain
If you try to install JDeveloper 12c (12.2.1 or 12.1.3) on Windows 10 using the generic installer you will not manage to create a new WebLogic domain because jython libraries that integrated weblogic have cannot recognize the operating system. The same problem can happen if you install on Windows 7 the 12c JDeveloper using the generic installer, then upgrade the operating system to Windows 10 and need to recreate the domain. This is also happening in SOA Suite and Business Process Management Suite quick start for Developers installation.


A quick solution for this is to use the Windows installer and not the generic one. For SOA/BPM/OSB quick start JDeveloper installation you need to patch the juthon-modules.jar to create the SOA/OSB domain.


If you still want to use the generic installer (for example to use a newer version of JDK) you can extract the jython-modules.jar at C:\Oracle\Middleware\Oracle_Home\wlserver\common\wlst\modules and edit javashell.py inside Lib. Find _osTypeMap and add the string 'Windows 10'.

_osTypeMap = (
        ( "nt", ( 'nt', 'Windows NT', 'Windows NT 4.0', 'WindowsNT',
                  'Windows 2000', 'Windows 2003', 'Windows XP', 'Windows CE',
                  'Windows Vista', 'Windows Server 2008', 'Windows 7', 'Windows 8', 
                  'Windows Server 2012', <b>'Windows 10'</b> )),
        ( "dos", ( 'dos', 'Windows 95', 'Windows 98', 'Windows ME' )),
        ( "mac", ( 'mac', 'MacOS', 'Darwin' )),
        ( "None", ( 'None', )),
        )

Then you need to package jar file again using jar -cvf jython-modules.jar *.* inside jython-modules extracted folder


Difference between RPC and Document web services


There are many differences between RPC and Document web services. The important differences between RPC and Document are given below:


RPC(Remote process control) Style:

1) RPC style web services use method name and parameters to generate XML structure.
2) The generated WSDL is difficult to be validated against schema.
3) In RPC style, SOAP message is sent as many elements.
4) RPC style message is tightly coupled.
5) In RPC style, SOAP message keeps the operation name.
6) In RPC style, parameters are sent as discrete values.


Document Style:


1) Document style web services can be validated against predefined schema.
2) In document style, SOAP message is sent as a single document.
3) Document style message is loosely coupled.
4) In Document style, SOAP message loses the operation name.
5) In Document style, parameters are sent in XML format.