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"
ui:wsdlLocation="http://localhost:8000/soa-infra/services/default/HelloWorld/Helloworld.wsdl">
<interface.wsdl interface="http://xmlns.oracle.com/Failover/HelloWorld/Helloworld#wsdl.interface(Helloworld)"
callbackInterface="http://xmlns.oracle.com/Failover/HelloWorld/Helloworld#wsdl.interface(HelloworldCallback)"/>
<binding.ws port="http://xmlns.oracle.com/Failover/HelloWorld/Helloworld#wsdl.endpoint(helloworld_client_ep/Helloworld_pt)"
location="http://localhost:8000/soa-infra/services/default/HelloWorld/helloworld_client_ep?WSDL"
soapVersion="1.1">
<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>
</binding.ws>
<callback>
<binding.ws port="http://xmlns.oracle.com/Failover/HelloWorld/Helloworld#wsdl.endpoint(helloworld_client_ep/HelloworldCallback_pt)"/>
</callback>
</reference>

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.
endpointURI’s:



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.

domain_log.properties

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
domain.admin.url=t3://127.0.0.1:7001
domain.admin.username=weblogic
domain.admin.password=weblogic1

DomainLogConfigurtionChange.py

from java.io import FileInputStream


Script

Before executing the script, change the configurations as required.

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



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();
java.io.ByteArrayOutputStream outputStream = new java.io.ByteArrayOutputStream();
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);
setVariableData("base64EncodedString",encodedString);
outputStream.close();
} catch (Exception e) {
e.printStackTrace();
}

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();
try
{
String decodedString = Base64Decoder.decode(input);
setVariableData("decodedString",decodedString );
}
catch(Exception e)
{
e.printStackTrace();
}

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.



O/P


DOWNLOAD SAMPLE