Monday, December 19, 2011

Oracle SOA Suite 11g - Multiple partner link endpoint locations to enable failover in composite.

Oracle SOA Suite 11g - Multiple partner link endpoint locations to enable failover in composite

Oracle SOA Suite provides the support for specifying multiple partner link endpoint locations. This capability is useful for failover purposes if the first endpoint is down.

The endpointURI property of the Composite.xml will help us to override the endpoint location specified in the default WSDL as shown below.

<reference name="HelloworldService"
<interface.wsdl interface=""
< port=""
<property name="endpointURI">http://localhost:8002/soa-infra/services/MEDIATOR/HelloWorld/helloworld_client_ep</property>
<property name="endpointURI">http://localhost:8002/soa-infra/services/UTILITIES/HelloWorld/helloworld_client_ep</property>
<property name="weblogic.wsee.wsat.transaction.flowOption"
type="xs:string" many="false">WSDLDriven</property>
< port=""/>

In runtime the location specified in the endpointURI at the end will be invoked first and if it fails it will try to invoke the previous endpointURI specified and so on; if all the endpointURI invocations are failed, the location(default) specified in the WSDL file will be invoked.

Default location:

Saturday, December 10, 2011

WLST script to change the log setting for all the servers in the weblogic domain

WLST script to change the log setting for all the servers in the weblogic domain

This tutorial explains the approach to change the log settings for all the servers in the weblogic domain

WLST Script

The below WLST script will help us to change the log setting for all the servers in the weblogic domain.

fileCount = 10
fileMinSize = 20000
fileTimeSpan = 12
log4jEnabled = false
httpAccessLoggingEnabled = true
stdoutSeverity = Info
logBRSeverity = Info
logFileSeverity = Info
memBufferSeverity = Info
memBufferSize = 400
numOfFilesLimited = true
redirectStdout = true
redirectStdErr = true
rotateOnStartup = true
rotateType = bySize

domain.folderPath = C:\Albin\SW\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain

from import FileInputStream


Before executing the script, change the configurations as required.

Execute the script — <<Oracle_Home>>\oracle_common\common\bin\wlst.cmd

Now the log settings are changed as required

Base64 Encoding/Decoding in Oracle BPEL 11g

Base64 Encoding/Decoding in Oracle BPEL 11g:

Sometimes we may need to send the binary data to the reference services or decode the binary data received from the services in BPEL. The Java Embedding activity can be used to Encode/Decode the binary data.

Encoding the XML data:

The below Java Embedding Code snippet will retrieve the XML data and encode the same to the binary format and assign the encoded data to the BPEL variable.

oracle.xml.parser.v2.XMLElement inputPayload = (oracle.xml.parser.v2.XMLElement)getVariableData("inputVariable","payload","/client:process");
oracle.xml.parser.v2.XMLDocument xmlPayload = inputPayload.getDocument(); outputStream = new;
try {
xmlPayload.print(outputStream );
java.lang.String xml_output = outputStream.toString();
oracle.soa.common.util.Base64Encoder encoder = new oracle.soa.common.util.Base64Encoder();
java.lang.String encodedString = null;
encodedString = encoder.encode(xml_output);
} catch (Exception e) {

Decoding the Binary Data:

The below Java Embedding Code snippet will retrieve the binary data and decode the same to the XML format and assign the decoded data to the BPEL variable.

String input = (String)getVariableData("base64EncodedString");Base64Decoder Decoder = new Base64Decoder();
String decodedString = Base64Decoder.decode(input);
setVariableData("decodedString",decodedString );
catch(Exception e)

Before deploying the Composites, make sure the oracle.soa.common.util.Base64Decoder/ oracle.soa.common.util.Base64Encoder classes has been imported in the bpel file.



Wednesday, December 7, 2011

Oracle SOA Suite 11g – Advanced Configurations for Database Adapter.

Oracle SOA Suite 11g – Advanced Configurations for Database Adapter.

This blog give the insight on the new features in Database Adapter configuration in Oracle SOA Suite 11g.

Query by Example:

A new Operation type 'Query by Example' has been introduced in Database Adapter Configuration. Query By Example does not require a selection criteria to be specified at design time like SELECT Operation. A selection criteria is inferred from an exemplary input XML record for each invoke. Use queryByExample when you do not want to create a query using the visual query builder and want the flexibility of allowing the input record to share the same XML schema as the output records. The queryByExample operation is will take little more time compared to SELECT operation because a new SELECT must be prepared for each execution.

Doing Synchronous Post to BPEL (Allow In-Order Delivery):

In this feature, the entire invocation is in a single thread and global transaction. By default, initiation is asynchronous and the BPEL process is invoked in a separate global transaction. With Oracle Mediator, it is generally a synchronous invoke so this is only specific to an Oracle BPEL process.

Advanced Options:

A new screen in Adapter configuration wizard for advanced options is added. This screen shows different options based on the type of operation selected. The below are the some of the advanced configurations.


We can set options like no. of retry attempts, interval between retries back-off factor and max interval values.

JDBC Options: 

This includes options like Query timeout value to specify the timeout for query execution.

Interaction Options: 

This includes various interaction options. Get Active UnitOfWork ( advanced setting that forces all invoke activities in the same global transaction to use the same SQL connection if going to the same database), Detect Omissions (allows the MERGE and INSERT operations to ignore empty or missing XML elements in the input payload), Optimize Merge (should always be set to true, as it is a general enhancement to MERGE performance)

Tuesday, December 6, 2011

Oracle SOA Suite - Custom Data Publisher for Sensor Action.

Oracle SOA Suite - Custom Data Publisher for Sensor Action.

This blog will explain the steps to create the custom data publisher for the sensor action in Oracle SOA Suite 11g or Oracle SOA Suite 12c(the same steps will work in Oracle SOA Suite 12c but the screens will be different) .

Steps to create custom data publisher

1. Create the java class e.g. MyCustomSensorPublisher that implements the class DataPublisher in the composite project.
Implement the method - public void publish(ITSensorAction action,ITSensorActionData actiondata,Element xml) to publish the event to the custom publisher.

package customjavasensor;
import org.w3c.dom.Element;
public class MyCustomSensorPublisher implements DataPublisher{
public MyCustomSensorPublisher() {
public void publish(ITSensorAction action,ITSensorActionData actiondata,Element xml) {
ITHeaderInfo header =actiondata.getHeader();
ITSensorData data=actiondata.getPayload();
System.out.println("Sensor "+header.getSensor().getSensorName()+" fired for BPEL Process "+header.getProcessName());
System.out.println("Sensor Data "+xml.toString());

2. Open the BPEL file and add the sensor.
Right click on the activity and select Create - Sensor