Thursday, April 23, 2015

How To Generate Deployment Plan in BPEL

Hi friends,

When we do code movement from one environment to other then we need some modification in code with respect to  url's,database connections etc.

We implement adapters ,web services using endpoint uri and jndi to develop application but these are different for each environment such as DEV,SIT,PROD etc.

To make this happen smoothly we create deployment plan for each environment and use it while deploying our composite.

Use the below steps in Jdeveloper to generate it.

1) Right click on the composite.xml file and select Generate Config Plan.


it will generate pop up with file name and click ok.

2) You can change all necessary fields accordingly.

e.g. Changing dev endpoint uri to test use below search and replace and do as per requirement.



 <!--Add search and replace rules for the import section of a composite
Example:
<searchReplace>
<search>JNDI_DEV</search>
<replace>JNDI_TEST</replace>
<searchReplace>
<searchReplace>
<search>URI_DEV</search>
<replace>URI_TEST</replace>
<searchReplace>-->

3) use this configuration plan file while deploying .sar in console.

Saturday, April 18, 2015

Dealing with images in DB Adapter in BPEL

Hi Friends,

I had a requirement to fetch image from database table as base64binary and sent it to the third party in the same format.

As we do regularly, i used select query(execute pure sql and select query option in DB adapter) and implemented but it didn't worked as expected. It was returning something like below image in BPEL Console.It was unable to parse in the proper format.




We raised SR with oracle and came to know that this is  because of the bug in DB Adapter while using select or execute pure sql option.

To achieve this we need to create a procedure /function from the same sql query and and use the option stored procedure or function execution in DB Adapter. It worked for this option.

Thanks.

Thursday, April 16, 2015

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

Routing action:

  •  When you need to call a synchronous service then use it.
  • In the message flow, regardless of whether routing takes place or not, the route node represents the transition from processing a request to processing a response.
  • Always Last Node in Message Processing
  • Only one Route node in a Proxy
  • A Route Node indicates that Request Processing will end here and Response Processing will begin
  • At the route node, the direction of the message flow is reversed.
  • Routing action can be created inside a Route Node only


Service Callout :

  • When you need to call a synchronous service and want to save req and resp variable for validation and enrichment.
  • Service Callout is used in real time request-response scenarios (for sync response).
  • If you have a use case where you need to call one or multiple real time request-response services (like sync web-services) then you may use Service Callout action in the message flow. 
  • Being a synchronous call, the thread gets blocked until a response is returned from target service.
  • Can have multiple Service Callout nodes in a Proxy service


Publish action :

  • Publish action is used for Request only scenarios where you don't expect a response back
  • The nature of Publish action (sync or async) will depend upon the target service you are invoking.
  • If you are invoking an external service through a business service then Publish action with Quality of Service(QoS) as "Best Effort" (default) will work like fire and forget and thread won't get blocked (async call). 
  • If you are invoking a local proxy service (proxy with transport protocol as "local") from another proxy using publish action then it would be a blocking call (synchronus call) and thread will get blocked untill the processing of local proxy finishes.


ref. - https://community.oracle.com/thread/1774545





Sunday, April 12, 2015

How to send a SOAP Header in BPEL

Hi Friends ,

Many times, we access a SOAP web service which has been secured by username and password.

We need to send these credentials in header part of the web service.

Lets do it....

1) Creating a XSD from the header payload.

Suppose my Header payload is like :

<?xml version="1.0" encoding="windows-1252" ?>
<Credential>
        <username>abc</username>
        <pwd>abc123</pwd>
</Credential>


Click on file and type xml and choose xml schema from xml as shown in below image.


2) Create a variable and select Type as xsd created from header payload as shown in below image.



3) Double click on Invoke activity which invokes the secured web service or you want to send a header in that service and click on header tab.



4) Check in Source  bpelx:inputHeaderVariable Created correctly.

<invoke name="Invoke_NotificationService"
            inputVariable="Invoke_NotificationService_commonNotificationDetails_InputVariable"
            partnerLink="Service1" portType="ns1:CommonNotification"
            operation="commonNotificationDetails" bpelx:invokeAsDetail="no"
            bpelx:inputHeaderVariable="Header"/>

Because some time it create wrongly as below

<invoke name="Invoke_NotificationService"
            inputVariable="Invoke_NotificationService_commonNotificationDetails_InputVariable"
            partnerLink="Service1" portType="ns1:CommonNotification"
            operation="commonNotificationDetails" bpelx:invokeAsDetail="no"
            bpelx:HeaderVariable="Header"/>

Thats it. Done.

Friday, April 3, 2015

Adding Multiple Sources in XSLT Transformation in BPEL

Hi Friends,

Many Times we need to point input from multiple source variables to one target in xslt mapper file.

There are two ways to deal with :

  • Add Multiple source variables while creating Transformation activity in bpel.
  • Create xsl file based on two xsd's and right click on source panel in xslt mapper in design view and select add source.
1) Adding multiple variables in Transformation Activity.
  • Drag and drop Transformation Activity
  • Go to Transformation tab and click + sign in Source and select required source variables
  • Select Target variables as per requirement.
See Below Snippet :



2) Adding Source to Already Created xsl mapper file.

Please follow below steps:



Thanks.