Showing posts with label SOA/SCA/SDO. Show all posts
Showing posts with label SOA/SCA/SDO. Show all posts

Thursday, June 26, 2014

Practise BPEL Process and XSLT Programming

How did you develope your BPEL processes and XML transformation? What is the best approach for development with BEPL and XSLT in Oracle SOA Suite? Should we put most effort on BPEL processes to manipulate the data or should we put more time on XSLT to transform the data? What is a good practice for BPEL + XSLT programming?

When I ask myself these questions, I couldn't give myself an truly answer. It is really difficult to have a clear standard for these programming. But I definitely have my own 2 standards in my daily work.

  1. For business orchestration, 100% sure we should use BPEL to make it works
  2. For data manipulate or transformation, I will prefer to use XSLT to transform them
But they are not always working. As, sometimes, the XSLT may not be able to complete what you want and you may have to leverage the BEPL or even the Embeded Java. 

Recently, I worked on a project and the product of vender is using UTC time to save the datetime. But client is using local time without timezone. In the BPEL processes, I have to convert the local time to UTC time. But it is not just timezone issue and I need to handle daylight saving too. In summer, the offset is 4hrs (Toronto), but it is 5hrs in winter. I looked for a solution and tried many times, but it didn't work. At the begining, I used the current time function in XSLT to get the offset. But when I test the dates which crosses over the daylight saving change day, it will not work. What should I do?

Later, I have to leverage the power of Java. Don't laugh at me, I know it is a little of ugly to introduce the embeded Java in BEPL process. But only several lines of Java code really make the time calculation working. 

I never advocate the purity of codes, but I would insist my these 2 standards to make the code clear and maintainable and keep the intrusive codes as less as possible. Just like many years ago, when I was using Hibernate, I used it to handle CRUD and small volume of data access and never refuse to use stored procedures to handle big volume of data for efficiency.

What I believed is we should use the right tool or approach to do the right thing.

Friday, March 07, 2014

SOA - Handle timeout in a synchronous BPEL processes with Correlation Sets



Recently, I worked on a project and need to handle webservice call time-out issue. In current solution, the developers used JMS Queue to handle the time-out issue. The flow can be described as the following steps.

  1. When our webservice gets a request from client, the message will be put in the request queue
  2. a MDB picks the message and initializes an webservice call to an scheduling system to make an appointment
  3. After the MDB gets the response, it puts the response message into response queue.
  4. The caller  process picks up the message and returns to client.
That the happy path, but sometimes you will need a long time to get the response back caused by the slow network or the busy scheduling system. As the client can't wait for too long and the socket connection has been closed when the response comes back. At this time, the response message will sit in the response queue. When it gets expired, it will be moved to an error queue. The Error handling MDB will initialize a call to the scheduling system to cancel the booked appointment.

Now, we prepared to move the application from WLI to SOA Suite and were asked to handle the same issue in SOA Suite. What I thought is there are 2 approaches to do it.

  1. Implement the exact same logic with BPEL and JMS Queue.
  2. Implement a much smarter process to return the response to client utilizing the BPEL correlation.

I did some research on the internet and didn't get a happy answer on how to implement second solution. But theoretically, I thought BPEL should be able to complete this job as it is statful and supports long run transaction. I didn't give up and kept to look for any sample I could find on the internet and books. Eventually, I found some helpful information from Oracle SOA Suite 11g Developers Cookbook and a blog on AMIS Technology Blog, which are listed in the references. Based on these pieces information, I began my adventure.

At the beginning, I just followed the book as the book mentioned the correlation implementation is different from SOA Suite 11.1.1.6 and didn't looked at the log in detail. I copied the schema and wsdl from the sample code of Oracle SOA Suite 11g Developers Cookbook, then modified them to add an response for the service.  But the code didn't work when I completed and it could not accept any further call with the OnMessage activity.

Later, I began to look at the blog line by line and tried to find useful information. Fortunately, it is really helpful and I found I need to add correlation on the response too. After that, it still didn't work. Then I added an reply before the invocation of third part webservice. Woo! What a magic it is. it worked eventually.

References:
Use BPEL Correlation Sets for repeated (synchronous) access to long running BPEL processes
Chapter 5 of Oracle SOA Suite 11g Developers Cookbook (P96)

SOA - DB connection issue in SOA env.

Today, I installed SOA Suite and OSB on a machine. Then I created a domain with OSB, SOA Suite and BAM support. When I started the weblogic service, I always got the follow error and the server could not be started.

The error is 
Insufficient data while reading from the network - expected a minimum of 6 bytes and received only 0 bytes.  The connection has been terminated.
    at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source)
    at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
    at org.apache.derby.jdbc.ClientDriver.connect(Unknown Source)
    at java.sql.DriverManager.getConnection(DriverManager.java:322)
    at java.sql.DriverManager.getConnection(DriverManager.java:273)
    at jdbc.JDBCSample.main(JDBCSample.java:19).

Searched on the internet, but didn't get any useful info. But it looks like a connectionissue. Then I opened the config file wlsbjmsrpDataSource-jdbc.xml and found the follow funny configuration.

jdbc:derby://localhost:1521/XE;create=true;ServerName=localhost;databaseName=XE
org.apache.derby.jdbc.ClientDriver

The driver is used derby, but the database was pointed to Oracle XE. Really have no idea why got such a config. Whatever, I modified it to the follow and the server started properly.

jdbc:oracle:thin:@localhost:1521/XE
oracle.jdbc.xa.client.OracleXADataSource


Tuesday, October 29, 2013

SOA - No silver bullet in software development at all

With the emerge of a new technology, there always some people would tell the people that technology would solve the problem and make the development successful. But people found that is not true soon and got disappointed as the silver bullet they expected is not true at all.

When the Java appeared in our development life, the people praises it is a revolution as it has garbage collection and is Object-Oriented. Also, it makes the software runs anywhere by using JVM. Theoretically, Java can improve the re-usability and  readability of code. Later, I saw many many developers create giant classes and giant methods without any OO concept, and there is no re-usability and readability at all. I do agree that it is not for all of developers, but pretty a lot did, especially some developers who worked with C previously.

When the SOA was introduced, people felt they found another extreme weapon to solve the development issues and make the project much successful. But I cannot believe it. If the developers don't follow the best practices and related disciplines, nothing can get better but more difficult to trace the problem.

When I first began to learn SOA Suite on 2010, the trainer told me a lot of advantage of it and gave me wonderful picture of it. But I couldn't believe it completely. The SOA Suite allow you to build BPEL process by dragging and dropping and I supposed it should make the process much easy to understand and be clear.  It should bring agility too. Later, I see some developers are creating giant complicated BPEL processes. It is too big to look at it and too complicated to understand it. Some giant one really make me scared.

After so many years, I have to say there is no silver bullet in software development as the issue is created by people not the technologies. For Java, the developer should create proper classes and extract proper methods to put the logic in different places leveraging the advantages of OOP and design patters to make the code re-usable and readable. For BPEL, the developer should create multiple BPEL processes to make the processes as clear as possible and as unique as possible to make it understandable and re-usable.

I still strongly believe the software programming/development is still an Art and really need the people think more and do more.  Otherwise, the people just create another mess when they criticize the mess made by somebody else.

Wednesday, July 31, 2013

OSB-Error handling with Resume action to execute the process continously without throw the exception



In some scenarios, we want the process continuously executes the further steps and ignore the error. In Java code, it is pretty easy and what you need to do just uses a try..catch and then properly set the variables and not throw the exception again. In OSB, it has a little bit difference and a Resume action must be introduced to make the process resumed and executed continuously to handle the further steps.


Error Handler Actions
http://docs.oracle.com/cd/E13171_01/alsb/docs21/consolehelp/proxyerrors.html#1113851
When an error handler processes an error, it can finish with one of two actions:
Table 18-1 Error Handler Actions
Error Actions
Description
Reply
If you assign this action, an error response is immediately created for the proxy service client. All further Message Flow processing stops and a response message is sent based on the message-related context variables. In this instance, you can configure the error handler to send a simple reply to the proxy service or a more detailed reply stating that an error occurred.
The difference between HTTP reply with success and reply with failure is as follows:
  • Reply with success sends status code 200 and $body
  • Reply with failure status sends status code 500 and $body
Resume
When this action is included in a message flow, message flow processing continues as though no error has occurred. Processing continues after the node or stage in which the error handler is configured. You may need to configure the error handler with compensating logic to set the context variables and message state to correspond with the variable and message state expected by subsequent message flow logic. Configure the compensating logic prior to the Resume action.
If neither the Reply nor the Resume action is initiated, the error is rethrown. In this case, the error is pushed forward and handled by the next level error handler. Unless otherwise specified, the rethrow action is the default action of an error handler.

Thursday, June 20, 2013

OSB-Create an fault with customized error code and error message

When you developed in OSB, you may want to provide a customized error code instead of BEA-xxxxxxx when you catch a fault. By the follow steps, you can replace the error code in fault and reply a fault with your customized error code.

In error handler,
1. Replace the error code with the customized error code by xpath ./ctx:errorCode  in fault2. Replace reason with your customized error message by xpath ./ctx:reason in fault
3. Replace the node contents by xpath . in body with $fault
4. Put a Reply at the end of error handling and select the radio button With Failure

For more detail about error handling in OSB, you can refer the follow blog of Eric.

Oracle Service Bus 11g, handling SOAP Faults


Thursday, June 06, 2013

OSB-Parallel Programming with Static and Dynamic Split-Join

JAVA

In Java language, we can make one Thread to wait for another by using join method. 
private void startThreads(int nfOfThreads) {
  Thread[] threads = new Thread[nfOfThreads];
  //start the threads
  for (int i = 0; i < threads.length; i++) {
    threads[i] = new ThreadTestWithoutJoin.MyThread();
    threads[i].start();
  }
  //join the threads
  for (int i = 0; i < threads.length; i++) {
    try {
      threads[i].join();
    } catch (InterruptedException e) {}
  }
}

NOTE:
In the above code, there are two for-loops, the first to create and start each thread, and the second loop to join each thread. If each thread is joined right after start, the effect is these threads are executed sequentially, without the desired concurrency.
// The following is NOT concurrent:
private void threadTest(int numOfThreads) {
 Thread[] threads = new Thread[numOfThreads];
 for (int i = 0; i < threads.length; i++) {
     threads[i] = new foo.ThreadTest.MyThread();
     threads[i].start();
     try {
         threads[i].join();
     } catch (InterruptedException ignore) {
     }
 }
}
(Refer http://javahowto.blogspot.ca/2007/05/when-to-join-threads.html)

WLI

In WLI, Parallel node represents a point in a business process at which a number of activities are executed in parallel. By default, parallel nodes contain an AND join condition. In this case, the activities on all branches must complete before the flow of execution proceeds to the node following the parallel node. You can change the join condition to OR

NOTE:
Parallel branches of execution in a business process are logically parallel; physically the branches are executed serially by the business process engine. While one branch of execution is waiting for a response, another branch of execution in the parallel flow can progress.
(Refer http://docs.oracle.com/cd/E13214_01/wli/docs102/bpguide/bpguideParallelDesign.htmlhttp://docs.oracle.com/cd/E13214_01/wli/docs102/jpdtutorial/tutWLIProcessParallel.html)

OSB

In OSB, Split-Join feature lets you split a service payload, such as an order, into individual messages for concurrent processing. Concurrent processing, as opposed to sequential processing, greatly improves service performance. Split-Join achieves this task by splitting an input message payload into sub messages (split), routing them concurrently to their destinations, and aggregating the responses into one overall return message (join). This process of payload splitting and response aggregation is called a Split-Join pattern.we can create Split-Join flow for parallel programming. There are two types of Split-Join, one is static and another one is dynamic.

The Static Split-Join can be used to create a fixed number of message requests
The Dynamic Split-Join can be used to create a variable number of message requests.

Any webservice needs a WSDL, Split-Join flow is the same and the first thing we need to do is to create a WSDL. Every Split-Join is based upon a WSDL operation. When you first create a Split-Join, you will be asked to browse to the appropriate WSDL file and to select an operation as part of the creation process. The WSDL of Split-Join flow can be same as the proxy service which will invoke the flow or you can defined a totally different WSDL. The choice is really based on your requirement.

For dynamic Split-Join, please refer the follow blogs. As these blog is pretty detail, I won't write anything.
http://biemond.blogspot.ca/2008/11/split-join-in-oracle-service-bus.html
http://www.xenta.nl/blog/2011/07/03/oracle-service-bus-implementing-aggregator-pattern-by-use-of-split-join/
http://rohanlopes.blogspot.in/2011/10/implement-parallel-split-join-osb.html

For static Split-Join, I got few help from the internet. But it is pretty easy when you have done a dynamic one.
First, create a new Split Join based on the WSDL operation you want to use.  In the Split-Join editor, you can see following flow, which consists of a Start Node, a Receive, a Reply. By clicking the triangle icon beside of Start Node, you can see the Start Node contains both a Request Variable and a Response Variable that have been determined by the WSDL operation initially selected. You can change the variables' name same as what you did in dynamic Split-Join. The Receive Node receives the incoming request message, and the Reply Node generates a response message and sends it back to the client.
Debugging a proxy service
Second, add an Assign Node after the Receive Node to initialize the Response Variable in a form such that the later nodes can work on the data within it. This output message is relayed to the final Reply node in the Split-Join and, in turn, returned to the original client.
Third, add a Parallel Node. The Parallel Node contains two main branches at the beginning, you can add more by clicking on the plus icon. Each branch is composed of a number of actions, the sequence and general configuration being the same for both branches.
Debugging a proxy service

Forth, add an Invoke Service Node. On the properties tab, config the service and operation. Select the Input Variable to create a new request variable and then select the Output Variable to create response variable. The result will be stored in the output Variable. The service you reconfigured for each branch may be not the same based on your requirement.

Fifth, add an Assign/Copy/Insert/Replace before the Invoke Service Node to prepare the input variable for service invocation. As the service invoked may be different, the logic in the node is not the same.

Sixth, add an Assign/Copy/Insert/Replace after the Invoke Service node to put the data in the Output Variable to the response variable of flow.

When you done everything you need, you can follow the steps in dynamic Split-Join to generate a business service. Then you can invoke it and test it in a proxy service.

If you have the book The Definitive Guide to SOA, you can look at the chapter 7 Parallel Calls with Split-Join for help as there is more detail.
(Reference http://docs.oracle.com/cd/E13159_01/osb/docs10gr3/eclipsehelp/tasks.html#wp1150654)

When I opened the source code of flow in text editor, I found the flow is implemented with BPEL instead of genera OSB xml.

Tuesday, May 14, 2013

OSB-SOAP Action Header Issue

Issue:
Recently, I worked on an existing code developed by somebody else long time ago and a defect was opened for SOAP action header issue. The invoked web service always complained 'no SOAPAction header!'.

As the business service was developed by vendor and they used RPC style, we have to define the business service as any XML service. (If we defined as a WSDL webservice, OSB threw exception when it got the response - unrecognized response.) As the business service was set an any XML service, it looks like the the OSB can automatically set soap action header.

Resolution:
In OSB proxy service, before the service callout, put a replace action to replace the soap action hdead in outbound.
In this application, I just used the soap action header of inbound to replace the one of outbound by the easiest way. (From the OSB console, I saw the soap action header is empty string for the initial request and same as the one needed for the service call, then I just copied them from Inbound Request.)

Note: A Transport Headers action looks like not work properly and the soap xml was modified by OSB automatically and caused an additional soap body was added to the soap envelop incorrectly.

SOAPAction References:

Wednesday, May 08, 2013

SOA - Set Loopback for SOA suite installation on a DHCP host

In order to install SOA suite on a DHCP host, we need to set the loopback. If you have installed VM ware or Virtual Box, you are lucky and the loopback had been created. If not, just follow the follow steps to create a loopback.

(From http://docs.oracle.com/cd/E16764_01/install.1111/e14318/qisoa.htm#BGBJEFDH)

3.7 Installing on DHCP Hosts

If you are installing Oracle SOA Suite on a DHCP host, you must follow the configuration steps in this section for your platform.

3.7.1 For UNIX Platforms

On UNIX operating systems, configure the host to resolve host names to the loopback IP address by modifying the /etc/hosts file to contain the following entries:
127.0.0.1 hostname.domainname hostname
127.0.0.1 localhost.localdomain localhost
After doing so, check that the hostname resolves to the loopback IP address by entering the following command:
/bin/ping hostname.domainname

3.7.2 For Windows x86 Platforms

On Windows systems, install a loopback adapter on the DHCP server (see Section 3.7.3, "Installing a Loopback Adapter (Windows Only)"). This assigns a local IP address to your computer.
After installing the adapter, add a line to the %SYSTEMROOT%\system32\drivers\etc\hosts file with the following format, immediately after the localhost line:
IP_address   hostname.domainname   hostname
Replace IP_address with the local IP address of the loopback adapter.

3.7.3 Installing a Loopback Adapter (Windows Only)

To install a loopback adapter on Windows 2003 or Windows XP:
  1. Open the Windows Control Panel.
    Windows 2003: Select Start > Control Panel > Add Hardware.
    Windows XP: Select Start > Control Panel, then double-click Add Hardware.
  2. In the "Welcome" window, click Next.
  3. In the "Is the hardware connected?" window, select Yes, I have already connected the hardware, then click Next.
  4. In the "The following hardware is already installed on your computer" window, in the list of installed hardware, select Add a new hardware device, then click Next.
  5. In the "The wizard can help you install other hardware" window, select Install the hardware that I manually select from a list, then click Next.
  6. In the "From the list of hardware types, select the type of hardware you are installing" window, select Network adapters, then click Next.
  7. In the "Select Network Adapter" window, make the following selections:
    • Manufacturer: Microsoft
    • Network Adapter: Microsoft Loopback Adapter
  8. Click Next.
  9. In the "The wizard is ready to install your hardware" window, click Next.
  10. In the "Completing the Add Hardware Wizard" window, click Finish.
  11. If you are using Windows 2003, restart your computer.
  12. Right-click My Network Places on the desktop and choose Properties. This displays the Network Connections Control Panel.
  13. Right-click the connection that was just created. This is usually named "Local Area Connection 2". Choose Properties.
  14. On the "General" tab, select Internet Protocol (TCP/IP), then click Properties.
  15. In the "Properties" dialog box, click Use the following IP address and do the following:
    1. IP Address: Enter a non-routable IP for the loopback adapter. Oracle recommends the following non-routable addresses:
      192.168.x.x (x is any value between 1 and 255)
      10.10.10.10
      
    2. Subnet mask: Enter 255.255.255.0.
    3. Record the values you entered, which you will need later in this procedure.
    4. Leave all other fields empty.
    5. Click OK.
  16. In the "Local Area Connection 2 Properties" dialog, click OK.
  17. Close Network Connections.
  18. Restart the computer.

3.7.4 Removing a Loopback Adapter (Windows Only)

To remove a loopback adapter on Windows 2003 or Windows XP:
  1. Start the System Control panel.
    Windows 2003: Select Start > Control Panel > System.
    Windows XP: Select Start > Control Panel, then double-click System.
  2. In the "Hardware" tab, click Device Manager.
  3. In the "Device Manager" window, expand Network adapters. You should see Microsoft Loopback Adapter.
  4. Right-click Microsoft Loopback Adapter and select Uninstall.
  5. Click OK.

Oracle SOA Suite Basic

In SOA suite, we must understand the follow concepts.

  • Adapter - used to connect resources
  • Mediator - Route and Transform
  • Rule Engine - Business Rules
  • BPEL Process - Orchestration
  • Human Workflow - Involve human beings
  • Security Framework - Policy-based security
  • BAM - Business Activity Monitor, visualization of process running


What is SCA?

SCA - Service Component Architecture, which is a specification backed by a growing number of leading industry vendors (http://www.OSOA.org) and being standardized at OASIS, the international open standards consortium . SCA is:
  • language-neutral
  • component model 
  • assembly model
SCA terminologies:
  • Composite: deployment unit
  • Service: entry-point into composite
  • Component: provides logic
  • Reference: refers to external services
  • Wire: connects services, components and references – no special semantic.
SOA Composite:
  • SOA composite is a standards-based deployment unit
  • Leverages the SCA assembly model
  • Can mix variety of components: Mediator, BPEL, Human Workflow, etc.


Thursday, April 25, 2013

Token Configurations in Oracle SOA Suite PS6


Eventually, we find a way to deploy our application easier and can modify the endpoint of service instead of redeploy the application with deployment plan.

References:
http://docs.oracle.com/cd/E28280_01/dev.1111/e10224/sca_bindingcomps.htm#CIHFJFJC
http://biemond.blogspot.ca/search?updated-min=2013-01-01T00:00:00%2B01:00&updated-max=2014-01-01T00:00:00%2B01:00&max-results=3

Handle a transaction between OSB and SOA suite

Recently looked at how to handle a transaction between OSB and SOA suite. From all of document I found, the HTTP protocol can not support transaction however you set your service. If we want them to support transaction, we have to use direct binding.
In composite, we need to modify the reference to set <binding.direct> .
For SOA-OSB, we should set the transport protocol to sb protocol of proxy service.
For OSB-SOA, we should set the transport protocol to soa-direct of business service.

For the features of SOA-Direct, see OSB-SOA Direct transport

For how to implement a global transaction, we can refer to Edwin blog.
Global Transactions and Quality of Service in OSB

References
http://docs.oracle.com/cd/E14571_01/integration.1111/e10224/invocapi.htm#SOASE85537
http://docs.oracle.com/cd/E14571_01/doc.1111/e15866/soa.htm
http://biemond.blogspot.ca/2010/11/global-transactions-and-quality-of.html





Monday, December 03, 2012

OSB-Thread model in OSB


When you handle a performance issue in your development, you much want to know how the system handle the request and how to utilize the thread management. For OSB, I heard many stories and complains about servers being hang. 

Recently, I began to work on OSB and wondered how OSB handle the request and response and how the thread is used. Then I searched with Google and found the follow useful blogs about the thread model in OSB. I found the usage of thread is kind of tricky with different implementation in OSB code. Some of implementation may cause performance issue and thread lock. With the follow blogs, you can get much familiar with the OSB thread model and know how to make it work much stable.

Following the Thread in OSB
https://blogs.oracle.com/reynolds/entry/following_the_thread_in_osb

Oracle Service Bus: thread blocking evidences, transport level
http://mazanatti.info/index.php?/archives/73-Oracle-Service-Bus-thread-blocking-evidences,-transport-level.html

OSB performance issue
http://sgrosjean.blogspot.ca/2013/02/osb-performance-issue-v.html


Friday, October 19, 2012

SOA - Using Preferences in Oracle SOA Suite 11g


In the Oracle SOA 11g, we can add a preferences in composite.xml and use it in our BPEL process.
Where to add?
In the composite.xml, locate the component element.
  <component name="SubmitHUPOrderWireless" version="2.0">
    <implementation.bpel src="SubmitHUPOrderWireless.bpel"/>
    <property name="bpel.preference.timeout">PT240S</property>
  </component>

In the BEPL, we can use it by the follow code.
  <onAlarm>
       <for>ora:getPreference('timeout')</for>
       <assign name="AssignTimeoutFault">
             <copy bpelx:insertMissingToData="yes">
                  <from>'System Timeout'</from>
                  <to>$fault_var/Body/Exception/ExceptionType</to>
             </copy>
        </assign>
  </onAlarm>

OSB-SOA Direct transport

The OSB provides a SOA-DIRECT transport that can be used to invoke Oracle SOA Suite service
components, such as BPEL processes, human tasks, rules, and Oracle Mediator components. The SOA-DIRECT transport provides native connectivity between OSB services and Oracle SOA
Suite service components.

The features supported by SOA-DIRECT transport:
  • Invocation of any SOA binding component services through Java Remote Method Invocation (RMI)
  • WS-Addressing
  • Identity propagation
  • Transaction propagation
  • Attachments
  • Optimized RMI transport for invoking SOA services
  • High availability and clustering support
  • Failover and load balancing (not available for services in the service callback role)
  • Connection and application retries on errors
The SOA-DIRECT transport uses WS-Addressing for message correlation in synchronous and asynchronous communications.

For Security, the SOA-DIRECT transport supports one-way SSL. To use SSL, enable SSL in the domain, use the secure protocol in the endpoint URI, such as https, iiops, or t3s, and reference the secure port in the URI.


The SOA-DIRECT transport stores the following environment values for SOA-DIRECT services:

  • JNDI Service Account (security category)
  • Pass Caller's Subject (security category)
  • Invocation Service account (security category)
  • Work Manager (environment category)

Synchronously invoking a SCA composite from an OSB service
The SOA-DIRECT transport supports transactions and identity propagation across JVMs and
uses the T3 RMI protocol to communicate with the SOA Suite server.

Note:
The SOA Suite and the OSB server must be on the same patch set level, otherwise we can get java class version errors.

The SOA-Direct transport supports WSDL type services with SOAP 1.1, SOAP 1.2, or, alternatively, XML bindings. The SOA direct binding framework only exposes direct binding services as WSDL with SOAP 1.1 and SOAP 1.2 bindings, not XML. However, if you want to use an XML binding, you must manually customize the imported SOA service WSDLs for the direct binding services. An XML binding has no effect on the message payload, since messages between the SOA-DIRECT transport and SOA binding components are always abstract (no binding).

References:

SOA - Why we need a wrapper wsdl?

In Oracle SOA, when we create a webservice reference in composite and link it with BPEL component, a wrapper wsdl may be generated. What is the purpose of wrapper wsdl?

The wrapper wsdl will be added specific elements for BPEL in SOA suite - partner link information.


    <plnk:partnerLinkType name="FinalCheckIntegrity">
        <plnk:role name="IPricePlanService" portType="tns:IPricePlanService"/>
    </plnk:partnerLinkType>



Thursday, August 16, 2012

OSB 11g ANT Build Scripts

Please reference to the follow blog.
http://biemond.blogspot.ca/2010/07/osb-11g-ant-deployment-scripts.html

Notes:
Use setDomainEnv.cmd to set the env properly.

http://www.javamonamour.org/2011/07/oracle-service-bus-configuration-jar.html

https://cn.forums.oracle.com/forums/thread.jspa?threadID=943099

Problem
In general this OSB export works fine, this error occures only if any OSB project contains proxy/business services using JCA transport e.g. used by the DB or SAP adapter.
Solution Summary
Add system property "com.bea.plateng.common.util.logging.useJDKlogger" set to "true" for configexport task, so that ANT target body look like:


<java \[...] jar="\[...]/org.eclipse.equinox.launcher_1.0.1.R33x_v20080118.jar">
\[...]
<sysproperty key="com.bea.plateng.common.util.logging.useJDKlogger" value="true"/>
</java>


Solution Description
The problem is in OSB module "com.bea.cie.comdev", which provides custom logging abstraction classes. Class com.bea.plateng.common.util.logging.LogFactory dynamically detects log4j library. If it is found, returns Log4jLogger, otherwise Jdk14Logger. The problem is that it uses context class loader for log4j detection and current class loader for Log4jLogger instantiation. In runtime, detection finds log4j installed in plugins/ directory (version 1.2.13), but instantiation finds none.

Specified parameter disables log4j detection.

Tuesday, June 26, 2012

OSB - Assign and Conditional Branch



The Conditional Branch is not possible directly to handle multiple compares. Using Assign to work around such scenario is doable.

1. Add a pipeline pair before the conditional branch
2. Add a stage in the request pipeline
3. Add an assign action in the stage to create a variable name as x, which will be using in the conditional branch


The XQuery expression in Assign Action:

for $type in $body/request/type
return
if ((data($type) = 'a') or (data($type) = 'b') or (data($type) = 'c')) then 
    <BranchValue>branch1 < /BranchValue>
else if ((data($type) = 'x') or (data($type) = 'y') or (data($type) = 'z')) then
    <BranchValue>branch2 < /BranchValue>
else ()

Then the conditional branch can work with the variable defined in above step to compare against 'branch1' or 'branch2' as values. The XPath should be $x/BranchValue/text().

Tuesday, June 12, 2012

OSB - fn-bea:execute-sql vs JCA DBAdapter



1. Issue with a structure changes of DB
The JCA DB Adapter is tightly coupled to the DB structure. A rework is always needed to reflect any DB table structure changes (such as adding new fields or removing some fields, modifying data types). We have to regenerate the WSDL using JDeveloper & and make impacting changes in OSB services.

The fn-bea:execute-sql() function is much flexable and just change the select query used in the function, no additional changes.

2. Reusability
The JCA DB Adapter is a reusable across projects/products. All Oracle SOA products (BPEL, ESB, OWSM, Oracle BPM) use the same adapter. In case you want to migrate to a different product from OSB then there is less migration effort for the JCA DBAdapter.

3. Performance
For simple select queries, both of them seem to give a similar performance. But the bea function was more expensive than the DBadapter as the number of records in the DB tables increase.

Reference:
Thread: fn-bea:execute-sql() function vs Oracle JCA Adapter(https://forums.oracle.com/forums/thread.jspa?threadID=2358998&tstart=1275)