Wednesday, April 16, 2014

oracle.webservices.preemptiveBasicAuth for invoking the webservices with Basic Authentication- Oracle SOA Suite

oracle.webservices.preemptiveBasicAuth for invoking the webservices with Basic Authentication- Oracle SOA Suite

HTTP basic authentication can have two types of authentication handshake methods, one is Reactive another one is Preemptive,

Reactive:

  • The client makes a request for a resource which needs authentication;
  • The server returns an HTTP 401 Authorization required response (indicating the authentication scheme and realm) with WWW-Authenticate header.
  • The client re-submits the request with an Authentication header;
  • The server verifies client credentials and returns the resource if authenticated successfully..

Preemptive:

The client can preemptively pass the credentials on the first request. The server returns immediately the resource if authenticated successfully.

Not all the authentication server accepts the Preemptive authentication mode, The NTLM authentication will not support the Preemptive handshake method it should be Reactive.

In Oracle SOA 11g the parnerlink binding property oracle.webservices.preemptiveBasicAuth will help us to set the handshake method accordingly.
  • oracle.webservices.preemptiveBasicAuth=false - Reactive mode
  • oracle.webservices.preemptiveBasicAuth=true - Preemptive mode


Monday, April 14, 2014

Backing up the MDS Repository Artifacts - Oracle SOA Suite 11g

Backing up the MDS Repository Artifacts - Oracle SOA Suite

In Oracle SOA Suite 11g and Oracle SOA Suite 12c , all the common artifacts , the deployed composites and the common configurations are stored in the MDS database schema. Sometimes there is a possibility of MDS schema getting corrupted (the best example is the composites getting corrupted frequently)those scenario we will not be able to bring up the soa-infra and also we may loose all the deployments.

Backing up the MDS artifacts is the the solution for these kind of issues.

In this post i will be explaining some of the different options to back up the MDS artifacts.

The best approach is do a full back up of MDS repository schema using database backup utilities(dbexp).The backup can be restored if there is any issue with the MDS schema.

EM console - MDS configuration Page :

Right click on soa-infra and click on Administration and MDS Configuration.
Click Export on MDS Configuration page.


This will export the MDS artifacts to local machine as zip file.




Tuesday, April 8, 2014

Dynamic where condition in DB Adapter - Query By Example

Dynamic where condition in DB Adapter - Query By Example

Sometime we may have the scenario to query the data in a table with dynamic where condition through DB Adapter in Oracle SOA Suite 11g.
The Query by Example option in the DB Adapter provides the option to construct the where condition dynamically based on the input data provided.Query-by-example uses the AND operator to tie the input attributes together to form the where condition.



For example when we are defining the Query By Example option for the Employee table the adapter will consider the Employee object as input and returns the Employee Object list.



Saturday, April 5, 2014

Oracle Cloud Adapter for Salesforce.com - Oracle SOA Suite

Oracle Cloud Adapter for Salesforce.com - Oracle SOA Suite

Oracle introduces the Cloud Adapter for Salesforce.com as the extension of Oracle SOA Suite and this is certified only with the version 11.1.1.7.0.This will help the customers to integrate with the the Salesforce.com cloud easily.

When integrating the Salesforce.com via web service integration the main concerns are the Security management and the Session management.The web service integration requires more manual configurations, we have to connect to the Enterprise login with the authentication details to get the token values then using the token we have to do a API call to perform the operations in Salesforce.Oracle Cloud Adapter for Salesforce.com provides Intelligent Session management and security management and also provides a GUI to perform all the configurations.





Tuesday, April 1, 2014

Oracle SOA Suite Composite Deployment - Global Type declaration/definition of name *are duplicated - Part2

Oracle SOA Suite Composite Deployment - Global Type declaration/definition of name *are duplicated - Part2

We were receiving the following exception while trying to invoke a composite(A) from other composite(B) in Oracle SOA Suite.

Error(284): part "payload" of variable "SFDCIN" is defined as XML element "{http://trm.com:I100:OrderProcessing:orderToQuote_Recieve}MT_BackfillStatus" whose definition cannot be resolved because "Global Type declaration/definition of name '{http://trm.com:I100:OrderProcessing:orderToQuote_Recieve}DT_BackfillStatus' are duplicated at the following locations: http://localhost:8000/soa-infra/services/CRMSYNC/SFDCOMQT_EventManager/xsd/SAP.MSG.EAI_610_OLIStatus_Quote.xsd [line#: 4] http://localhost:8000/soa-infra/services/CRMSYNC/SFDCOMQT_EventManager/sfdcomqt_eventmanager_client_ep?XSD=xsd/SAP.MSG.EAI_610_OLIStatus_Quote.xsd [line#: 5] There are at least two of them looking different: http://localhost:8000/soa-infra/services/CRMSYNC/SFDCOMQT_EventManager/xsd/SAP.MSG.EAI_610_OLIStatus_Quote.xsd [difference starting at line#:6] http://localhost:8000/soa-infra/services/CRMSYNC/SFDCOMQT_EventManager/sfdcomqt_eventmanager_client_ep?XSD=xsd/SAP.MSG.EAI_610_OLIStatus_Quote.xsd [difference starting at line#:7] ".

But the deployment of the composite(A) is success and we were able to test the composite(A) successfully from SOAP UI but while trying to invoke from other composite(B), the deployment of the invoking composite(B) failed with the above exception.

The both the differences pointing to the same xsd in the same component, one is design time xsd and another one is run time xsd.

While comparing, we were able to see some small differences between these two xsd's but unfortunately we could not able to correct it because both are pointing to the same xsd.

After a long struggle i was able to find out the root cause, the actual root cause is the annotations defined in the xsd.


After removing the annotation sections from the specified schema and redeploying the composite(A), i was able to invoke successfully from other composite(B).

It seems to be when the xsd's have the annotation defined , the BPEL run time generated xsd has difference compare to the original local schema.


Thursday, March 27, 2014

Getting the Audit Detail of a BPEL instance in JAVA - Oracle SOA Suite

Getting the Audit Detail of a BPEL instance in JAVA - Oracle SOA Suite

In Oracle SOA Suite 11g and Oracle SOA Suite 12c,the audit trail of the BPEL is stored in the table AUDIT_TRAIL.If the size of the payload crossed the threshold size configured in the EM console then the details are stored in the AUDIT_DETAILS table.


The payload in the AUDIT_DETAILS table is in compressed binary form, you can use the below approach to get the actual payload.

import java.sql.*;
import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.InitialContext;
public class GetPayload {
    public static Connection getConnection() throws Exception {
        Context ctx = null;
        Hashtable ht = new Hashtable();
        ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
        ht.put(Context.PROVIDER_URL, "t3://:8000");
        ctx = new InitialContext(ht);
        javax.sql.DataSource ds =(javax.sql.DataSource)ctx.lookup("jdbc/SOADataSource");
        return ds.getConnection();
    }

    public static String getPayload() {

        Statement stmt = null;
        Connection connection = null;
        ResultSet rs = null;
        
        String query="select  UTL_COMPRESS.LZ_UNCOMPRESS(b.bin) DOC from audit_details b where cikey='5148077' and rownum<2";
       
        String payload = "";
        try {
            connection = getConnection();
            stmt = connection.createStatement();
            rs = stmt.executeQuery(query);
            while (rs.next()) {                    
                Blob blob=rs.getBlob("DOC");
                byte[] sdata = blob.getBytes(1, (int) blob.length());;
                payload = new String(sdata);             
                
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                if (rs != null)
                    rs.close();
                if (stmt != null)
                    stmt.close();
                if (connection != null)
                    connection.close();
            } catch (Exception e) {

            }
        }
        return payload;

    }
}




Wednesday, March 26, 2014

Recovering the composites to JDeveloper from MDS - Oracle SOA Suite

Recovering the composites to JDeveloper from MDS - Oracle SOA Suite

Sometimes there is a possibility the latest code changes of the deployed composite in JDeveloper might have lost in other hand some cases we will not be having the implementation code for the deployed composites.

These scenarios the Oracle SOA Suite composite artifacts can be exported from MDS through em console and the same can be converted to design time artifact in JDeveloper.

This post will explain the steps to recover the composite to JDeveloper from MDS.

Steps to recover the composite from MDS

Login to Em console, right click on the particular composite and click on Export


Select the appropriate options as shown and click on Export


Tuesday, February 25, 2014

SOA-INFRA app is not starting up - Oracle SOA Suite 11g

SOA-INFRA app is not starting up - Oracle SOA Suite 11g:

When we restarted the soa server, the soa server came up properly except the SOA-INFRA app.
The status of the SOA-INFRA app in weblogic console is failed and also the SOA node in the em console is not displayed.



We could not able to find any particular error from log files including diagnostic log except schema mismatch error with some of the composites.It  seems due to some reason the status of the soa-infra application is failed and the server is restarted without fixing the actual issue then even after fixing the issue and restarting the server the soa-infra app is not Active.

We have tried deleting the following folders from $DOMAIN_HOME/servers/AdminServer
data
temp 
cache 

Unfortunately even after deleting the above folders the SOA-INFRA app did not come up. 

Tried starting the SOA-INFRA app manually from weblogic console, this time the SOA-INFRA app came up and we could able to see the SOA in em console.





Tuesday, December 17, 2013

Custom Message Throttling and Interface Management – Oracle BPEL

Custom Message Throttling and Interface Management – Oracle BPEL

This post explain the details on Custom Message Throttling and Interface Management – Oracle BPEL/Oracle SOA Suite 11g



Custom Message Throttling and Interface Management.pdf


Thursday, December 12, 2013

Approaches to integrate Oracle SOA Suite with SalesForce.com

Approaches to integrate Oracle SOA Suite with SalesForce.com

This post explain the different Approaches to integrate Oracle SOA Suite with SalesForce.com.



Integrate Oracle SOA With SalesForce.pdf


Thursday, October 17, 2013

ORABPEL-05250 Error - JDeveloper Part1

ORABPEL-05250 Error - JDeveloper Part1

I faced a strange ORABPEL-05250 issue while deploying the composite to Oracle SOA Suite Server through JDeveloper.

The composite was successfully build in JDeveloper but during deployment to the server received the following exception.

[03:59:18 PM] Sending internal deployment descriptor
[03:59:18 PM] Sending archive - sca_SFDCOT_Invoker_rev1.0.jar
[03:59:38 PM] Received HTTP response from the server, response code=500
[03:59:38 PM] Error deploying archive sca_SFDCOT_Invoker_rev1.0.jar to partition "CRMASYNC" on server AdminServer [http://localhost:8000] 
[03:59:38 PM] HTTP error code returned [500]
[03:59:38 PM] Error message from server:
There was an error deploying the composite on AdminServer: Error occurred during deployment of component: SFDCOT_Invoker to service engine: implementation.bpel, for composite: SFDCOT_Invoker: ORABPEL-05250

Error deploying BPEL suitcase.
error while attempting to deploy the BPEL component file "/oracle/as01/fmw/config/admin/domains/SOACoreDomain/servers/AdminServer/dc/soa_b3d3a863-3515-4d6d-9b7f-0d0c7d1977a6"; the exception reported is: java.lang.Exception: BPEL 1.1 compilation failed

ORABPEL-05250 exception can occur for number of reasons . After a long struggle( tried removing the partner links one by one) received the actual error

There was an error deploying the composite on AdminServer: Error occurred during deployment of component: SFDCOT_Invoker to service engine: implementation.bpel, for composite: SFDCOT_Invoker: ORABPEL-09705

Could not initialize variable.
An error occurs while initializing BPEL variable inputVariable; the schema processor cannot find the element {http://xmlns.oracle.com/pcbpel/adapter/db/top/SFDCOT_POLLING_V}SfdcotPollingVCollection in the following schemas: oracle.fabric.common.wsdl.SchemaManager@7eb126f4.
The XSD element on which the variable was based was not properly defined in XSD or the WSDL.

Ensure that the element named in the error message is valid in the XSD or the WSDL.

The issue is due to schema name in the wsdl file is wrongly specified(wrong case) even though the schema name was wrongly specified in wsdl the composite was able compile and build successfully in JDeveloper installed in windows but failed while deploying to the server running in UNIX, this is due to case sensitive nature of file names in UNIX OS


After correcting this issue the composite got deployed successfully.


Friday, November 16, 2012

Oracle Fusion Middleware 11g Certification Matrix

Oracle Fusion Middleware 11g Certification Matrix

The below URL is having the certification matrix for all the Oracle Fusion Middleware components.








Monday, October 29, 2012

Oracle SOA Suite Composite Deployment - Global Type declaration/definition of name *are duplicated - Part1


Oracle SOA Suite Composite Deployment - Global Type declaration/definition of name *are duplicated - Part1

Sometimes we used to get the below error message while deploying the composites to theOracle SOA Suite  server.

oracle.fabric.common.wsdl.XSDException: Global element declaration/definition of name '{http://xmlns.oracle.com/GlobalDeclaration/employee}Employee' are duplicated at the following locations:

http://localhost:8000/soa-infra/services/default/EmployeeServer/employeeserver_client_ep?XSD=xsd/EmployeeServer.xsd [line#: 4]
http://localhost:8000/soa-infra/services/default/EmployeeServer/xsd/EmployeeServer.xsd [line#: 3]
file:/reuters/shared/11g/software/soa_deploy/code/Utilities/EmployeeClient/xsd/EmployeeClient.xsd [line#: 6]
There are at least two of them looking different:
http://localhost:8000/soa-infra/services/default/EmployeeServer/employeeserver_client_ep?XSD=xsd/EmployeeServer.xsd [difference starting at line#:7]
file:/reuters/shared/11g/software/soa_deploy/code/Utilities/EmployeeClient/xsd/EmployeeClient.xsd [difference starting at line#:9]

The exception states the definition of the element Employee with the names spaces “http://xmlns.oracle.com/GlobalDeclaration/employee” differs in the following location.


file:/code/Utilities/EmployeeClient/xsd/EmployeeClient.xsd

I am having two composites EmployeeClient and EmployeeServer, EmployeeClient invokes EmployeeServer via parnerlink, EmployeeClient and EmployeeServer composites are defined with the following xsd’s

EmployeeClient/EmployeeClient.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<schema attributeFormDefault="unqualified"
                elementFormDefault="qualified"
                targetNamespace="http://xmlns.oracle.com/GlobalDeclaration/employee"
                xmlns="http://www.w3.org/2001/XMLSchema">
                <element name="Employee">
                                 <complexType>
                                                 <sequence>
                                                                 <element name="empid" type="string"/>
                                                 </sequence>
                                 </complexType>
                </element>               
</schema>

EmployeeServer/EmployeeServer.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<schema attributeFormDefault="unqualified"
                elementFormDefault="qualified"
                targetNamespace="http://xmlns.oracle.com/GlobalDeclaration/employee"
                xmlns="http://www.w3.org/2001/XMLSchema">
                <element name="Employee">
                                 <complexType>
                                                 <sequence>
                                                                 <element name="empid" type="string"/>
                                <element name="empname" type="string"/>
                                <element name="contactno" type="string"/>
                                <element name="state" type="string"/>
                                                 </sequence>
                                 </complexType>
                </element>
               
</schema>



Wednesday, October 24, 2012

ResourceLimitException : No resources currently available in pool to allocate to applications – Oracle SOA 11g

ResourceLimitException : No resources currently available in pool to allocate to applications – Oracle SOA 11g

You could have observed the below exception frequently in the weblogic server log file, weblogic server throws the below exception when there is not enough database connections in the pool to serve the incoming requests reporting increasing the connection pool count. This will affect the overall system  performance

java.sql.SQLException: Internal error: Cannot obtain XAConnection weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool SOADataSource to allocate to applications, please increase the size of the pool and retry..
at weblogic.common.resourcepool.ResourcePoolImpl.reserveResourceInternal(ResourcePoolImpl.java:577)
at weblogic.common.resourcepool.ResourcePoolImpl.reserveResource(ResourcePoolImpl.java:342)
at weblogic.common.resourcepool.ResourcePoolImpl.reserveResource(ResourcePoolImpl.java:329)
at weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.java:417)
at weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.java:324)


The above exception is due to there is not enough connections available in the pool to service the requests.

To identify which datasource / connection pool requires more connection do the following.

  • Go to Weblogic Admin console
  • Go to Environment -> Servers
  • Select the server on which the connection pool needs to be monitored
  • Go to Monitoring -> JDBC
  • Customize the table to add the below two properties
This page will list all the datasources/ connection pools targeted to that particular server and how many connections are waiting to get the connection. If more number of connections are waiting, that is not a good which will cause performance impact and also cause stuck threads on the server if the wait time is going to be beyond the thread stuck time (By default it's 10 mins).

(This screen shot taken by reducing the max capacity to 5 for blogging purpose, unfortunately I did not captured the actual screen shot)


Monday, October 15, 2012

Getting the SOAP Envelope of the request/response messages in Oracle SOA Suite


Getting the SOAP Envelope of the request/response messages in Oracle SOA Suite

This post will explain how to Get the SOAP Envelope of the request/response messages in Oracle SOA Suite 11g or Oracle SOA Suite 12c(screen will be little different in Oracle SOA Suite 12c )

The bpelx:inputHeaderVariable and bpelx:outputHeaderVariable attributes in invoke/receive activity will help us to add or retrieve the custom SOAP headers to SOAP message in oracle SOA.

If you want to see the whole SOAP message (header & body) it’s not possible out-of-the-box on the EM Console or in the logs.

 Steps to capture complete SOAP conversations for a SOA composite service

  • Open the Composite.xml
  • Attach the management policy named oracle/log_policy to the webservice reference to which the SOAP headers needs to be monitored. 



Monday, October 8, 2012

DB Adapter Message Throttling in Oracle SOA Suite 11g

DB Adapter Message Throttling in Oracle SOA Suite 11g:


DB throttling is the mechanism to control the number of database records processed by the SOA engine in a particular interval through DB Adapter. 

Throttling also can be used to control the number of records send to the end systems. If the throttling is not defined, the end systems may flood with number of messages that will affect the functioning of the end systems. Throttling parameters should be configured based on the end systems capacity to process the incoming messages.

Until Oracle SOA Suite 11.1.1.6.0 the message throttling will not work as we expect, all the messages matching the where condition of the polling sql are processed in the same polling interval.

As of Oracle Adapters release 11.1.1.6.0 we can set the inbound DBAdapter property RowsPerPollingInterval to control the throttling. It acts as a limit on the number of records which can be processed in one polling interval. The default value is unlimited.

The Patch 12881289 should be applied to enable this for SOA 11.1.1.5.0 and earlier versions.

The maximum rows processed per second

The maximum rows processed per second are:
Number of active nodes in SOA cluster x NumberOfThreads x RowsPerPollingInterval / PollingInterval

MaxTransactionSize can be thought of as RowsPerDatabaseTransaction or DatabaseFetchSize that is how many records will be fetched to DB Adapter engine from the database for each transaction. It does not affect how many rows can be processed in one polling interval period.

The one exception is the following configuration:
-distributed polling checked, usesSkipLocking="false"