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.

Proxy Service VS Business Service in OSB

It’s very confusing for the OSB learner, the difference between Business Service and Proxy Service.
Let me help you to understand the exact difference between them.


Proxy Service

1.It is a service in OSB which is exposed to source system or calling applications or services, which means, this is the service provided to the source system.

2.Proxy Service like Source for your system.

3.its enter point of your service.

Business Service

1.It is a service in OSB which is used to connect to target system, which means it’s used to fetch the data from JMS, DB or any other third party system etc. and provide the data to the proxy service.

2.Business Service like your target system.

Install OSB 12C with WebLogic in windows operating System

Checking Java Installation

The Java version installed in your computer may be different from this example. That is fine as long as it’s version 1.8+.
Open Command Prompt as Administrator.
1. Check if “JAVA_HOME” environment variable is properly set. Type echo %JAVA_HOME% then press Enter.
It should show the JDK installation directory. Mine is C:\Program Files\Java\jdk1.8.0_74. Yours might be slightly different.
2. Check the Java version installed. Type java –version and press Enter.
This is the output in my workstation:
  • java version “1.8.0_74”
  • Java(TM) SE Runtime Environment (build 1.8.0_74-b02)
  • Java HotSpot(TM) 64-Bit Server VM (build 25.74-b02, mixed mode)
3. Check if JDK is installed properly. In step 1, we were able to confirm that a JDK installation directory is set in the system environment variable “JAVA_HOME”. To ensure that JDK is installed properly, type javac –version then press Enter.
Mine shows javac 1.8.0_74. This means we’re good to go.

Download SOA Suite Quickstart Installer

Open any Web Browser and search “Oracle SOA Suite Downloads” in google.

Click “Oracle SOA Suite Downloads”.
For a quick reference, this is the link as of the time of this writing:
You will be redirected to this page.
Choose the “Accept License Agreements” radio button.
Expand “Recommended Install Process” section.
Ensure that “Microsoft Windows 64bit JVM” is selected.
If you read the note in Part 1 under Product Installation, notice the last part: “Oracle JDeveloper with SOA IDE extensions and an integrated WebLogic Server…”. That’s what we’re interested in.
Let’s ignore those under the “Additional Components” section as our installation is already rich with features we need.
In my future posts, we will try different features of Service Bus by deploying SB Projects in the WebLogic Server.
Click Download for the Part 1. You will be redirected to the Oracle Single Sign In page. Enter credentials, then download will start.
Once download is complete, simply press the back button of the browser, then download the Part 2. If it prompts to accept the license again, then just click “Accept License Agreements” radio button like you did earlier.
Now we have two zip files:
  • fmw_12.2.1.3.0_soaqs_Disk1_1of2.zip
  • fmw_12.2.1.3.0_soaqs_Disk1_2of2.zip
Extract each Zip file. Two folders will be extracted, one for each zip file. What we’re interested in are the jar files within those folders, so move those jar files outside. That way, both jar files are within the same directory.

Extract and Run JARs to Start Installer

Run Command Prompt as Administrator then navigate to the location of the installers.
Type java -jar fmw_12.2.1.3.0_soa_quickstart.jar then press Enter.
This could take a couple of minutes. Around 10 minutes in my workstation.
Once extraction and initial checks are complete, the Installation window displays.

Installation Dialog Steps

1. Welcome: Click “Next”.
2. Auto Updates: Leave default (Skip Auto Updates). Click “Next”.
3. Installation Location:
You may set any valid installation directory. In this example, I will just leave the default as it is.
Click “Next”.
4. Prerequisite Checks
Based on experience, you may encounter warnings in this part of the installation. I have encountered warnings on either items shown below but still continued successfully. If it’s a warning, perhaps you could just ignore it and continue. Click “Next”.
5. Installation Summary:
Review the details. Click “Install”.
This may take about 30 minutes. Once done, you’ll see the screen the same as below. Click “Next”.
Take note that by default, “Start JDeveloper” checkbox is checked. Then click “Finish.”
JDeveloper splash screen appears.
“Select Role” dialog box appears. For now, just leave the default as is (Studio Developer (All Features)). Then click “OK”.
We have installed JDeveloper IDE successfully.

Running and Terminating the Integrated WebLogic Server

As mentioned earlier, this installation includes an Integrated WebLogic Server.
So let’s go ahead and try running it!
In the JDeveloper window menu bar, click Window > Application Servers.
Notice the “Application Servers” tab added on the left pane. Expand “Application Servers” and you will see “IntegratedWebLogicServer”. This is the WebLogic Server instance that we will start.
Right click the “IntegratedWebLogicServer” instance > Start Server Instance.
“Create Default Domain” dialog box appears.
FieldDescriptionValue
Administrator IDUsername for WebLogic admin console and Service Bus console.Defaulted to “weblogic”. For this installation, we’ll leave it as it is.
PasswordPassword for WebLogic admin console and Service Bus console.Default is blank. For this installation, let’s set it to “weblogic1
Confirm
Password
Repeat for confirmation of password.Default is blank. For this installation, let’s set it to “weblogic1
Listen
Address
IP Address/Domain for the WebLogic Admin and Service Bus consoles.Default to <All Available Addresses>. For this installation, we’ll leave it as it is.
Listen
Port
Port for the WebLogic Admin and Service Bus consoles.Defaulted to 7101. For this installation, we’ll leave it as it is.
SSL
Listen
Port
SSL Port for the WebLogic Admin and Service Bus consoles.Defaulted to 7102. For this installation, we’ll leave it as it is.
After the fields are populated, click “OK”.
You should see this in the Log pane:
Creating IntegratedWebLogicServer Domain . . .
It takes about 15 minutes for it to start. You would see the Logs below:
[IntegratedWebLogicServer started.]
Let us now access the WebLogic admin console.
Open the browser and type this:
http://localhost:<listener port>/console
<listener port> was the value set earlier in the “Create Default Domain” dialog box. In this installation, we left the default 7101, so let’s use:
WebLogic Server admin console login screen loads. Login by entering your credentials set earlier in the “Create Default Domain” dialog box. In this installation, the username is “weblogic” and password is “weblogic1”.
Once you login, go to Environment > Servers.
Under Servers, you should see the DefaultServer(admin) in RUNNING state. Health should be OK.
This confirms that our WebLogic installation is successful.
Alright! So for now, let’s shutdown the WebLogic Server.
Back to the JDeveloper window, right-click IntegratedWebLogicServer > Terminate Server Instance.
It will take a few minutes until it is properly terminated. Logs should be like the one below:
After this, you may now safely close the JDeveloper window.