XA Transactions with SOASuite JMS Adapter by Martien van den Akker

clip_image001

 

JMS is perfect for setting transaction boundaries and in OSB it is pretty clear on how JMS transactions are handled. However, in SOASuite using the JMS adapter the SOA Infrastructure is handling your JMS transactions by default; and messages are removed from the queue rightaway because the Get’s are Auto-acknowledged. If something fails, you would expect that messages are rolled back to the JMS queue and eventually moved to the error queue. But, again by default, not with the SOASuite/JMS Adapter. In that case the BPEL process, for instance, fails and get’s in a recovery state, to be handled in the ‘Error Hospital’in Enterprise Manager. But I want JMS to handle it! (Says the little boy…)
So how do we accomplish that? Today I got the chance to figure that out.
Start with a JMS setup with a JMS Server, Module and a Queue with an Error Queue that is configured to be the error destination on the first queue. On the first queue set a redelivery limit to 3 and a redelivery delay on for instance 60000 ms (or something like that). I’m not going in to that here.
Create also a Connection Factory in the JMS Module with a proper jndi, something like ‘jms/myApplicationCF’.
In the JMS adapter on SOASuite there are several OutboundConnectionFactories already pre-configured. It is quite convenient to use the one with JNDI ‘eis/wls/Queue’. But if you look into that, you’ll see that it uses the default WebLogic JMS Connection factory ‘weblogic.jms.XAConnectionFactory’. Not much wrong with that, but you can’t configure that for your own particular situation. But more over it is configured with ‘AcknowledgeMode’ = ‘AUTO_ACKNOWLEDGE’. As you can read in the docs there are three values for the AcknowledgeMode:

  • DUPS_OK_ACKNOWLEDGE, for consumers that are not concerned about duplicate messages
  • AUTO_ACKNOWLEDGE, in which the session automatically acknowledges the receipt of a message
  • CLIENT_ACKNOWLEDGE, in which the client acknowledges the message by calling the message’s acknowledge method

So create a new outbound connection factory, with a JNDI like ‘eis/jms/MyApp’. 
Now, apparently we don’t want  ‘AUTO_ACKNOWLEDGE’, because that would cause the message-get acknowledged ‘On Get’. So you could rollback until ‘Saint Juttemis’ (as we say in our family) but it won’t go back on the queue. Dups aren’t ok with me, so I’ll choose ‘CLIENT_ACKNOWLEDGE’ here. Then there’s another option: ‘IsTransacted’. I want that one on ‘true’. Then in ConnectionFactoryLocation, you’d put the JNDI of your JMS Connection factory, in my example ‘jms/myApplicationCF’. So you’ll get something like: Read the complete article here.

SOA & BPM Partner Community

For regular information on Oracle SOA Suite become a member in the SOA & BPM Partner Community for registration please visit www.oracle.com/goto/emea/soa (OPN account required) If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn image[7][2][2][2] Facebook clip_image002[8][4][2][2][2] Wiki

MTOM using SoapUI and OSB by Martien van den Akker

 

clip_image001MTOM (Message Transmission Optimization Mechanism) is incredibly hard… to find practical information about, on SoapUI and OSB. There are loads of articles. Like:

But I need to process documents that are send using MTOM to my service. And to be able to test it, I need to create a working example of a SoapUI project to do exactly that. Also about SoapUI and MTOM there are loads of examples, and it is quite simple really. But I had a more complex wsdl that I was able to use for Soap with Attachments (SwA) wich is also simple really. But how to connect those two in a simple working example? Well, actually, it turns out not so hard either… So bottom-line, MTOM with SoapUI and OSB is not so hard. If you know how, that is.
So let’s work this out on a step-by-step basis.

XSD/WSDL

I’ll start with a simple XSD: Read the complete article here.

SOA & BPM Partner Community

For regular information on Oracle SOA Suite become a member in the SOA & BPM Partner Community for registration please visit www.oracle.com/goto/emea/soa (OPN account required) If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn image[7][2][2][2] Facebook clip_image002[8][4][2][2][2] Wiki

SOA Suite UMS: Deregister obsolete Messaging Client applications by Martien van den Akker

clip_image002There are already several blogs on how to receive and send email using the UMS email adapter. A few good starting points that use GMail as a provider are the ones written by our respected con-colleagues of Amis:

So I won’t bother to do a how-to on that on my account. Although I managed to get that working with a local Exchange setup.

What I managed to do is to read e-mail and then process it to upload the attachments and body using BPEL and java in a Spring-Context to Adaptive Case Management. If you want to do something similar make sure you install the patch 18511990 for fetching the attachment-properties and -content, since without the patch the properties for inline attachements are not written properly to the soa-infra database. See my earlier blog-posts here and here.
Having it all setup and playing around with it, you might end up in the situation that the service won’t listen to the actual email-address you reserved for it, as I did. This might be the case when you change the email address in your receiving adapter component in the composite. Or after deploying several versions of the composite, especially with different addresses.
It turns out that there is a panel to deregister Messaging Client Applications to cleanup the mess.
First go to the Enterprise Manager and under the Weblogic Domain navigate to the ‘usermessagingserver’ (there are also entries for the different usermessagingdriver’s, but in this case you need the server itself):

Right click on it and in the pop-up choose ‘Messaging Client Applications’: Read the complete article here.

SOA & BPM Partner Community

For regular information on Oracle SOA Suite become a member in the SOA & BPM Partner Community for registration please visit www.oracle.com/goto/emea/soa (OPN account required) If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn image[7][2][2][2] Facebook clip_image002[8][4][2][2][2] Wiki

It’s Spring for Oracle ACM API’s by Martien van den Akker

clip_image002Before the holiday season I was working on a service to receive e-mails in BPM using the UMS-email-adapter. Then process the attachments and the body and upload them to the Oracle ACM-case the email was meant for.
I won’t get in too much detail here, since there are some articles on the use of ACM-API’s like the ones of Niall Comminsky.
Unfortunately, until now, there are no WSDL/SOAP or REST services available on the ACM-API’s, as they are on the Workflow Task API’s. However, it is not so hard to make the API’s available as services. The trick is to wrap them up in a set of Java-beans, with one class with methods that do the jobs and create ‘request and response beans’ for the input parameters of the methods and the response.
A few years ago I wrote an article on using Spring components in SOA Suite 11g. This approach is still perfectly usable for SOA/BPM12c. And gives you a WSDL interface on the API’s in near to no time.
There is one remark on the API’s, though. That is on the creation of the the ACM Stream Service, or actually the creation of the BPMServiceClientFactory to get the context. In the blog of Niall you’ll read that you need to set the following context-properties: Read the complete article here.

SOA & BPM Partner Community

For regular information on Oracle SOA Suite become a member in the SOA & BPM Partner Community for registration please visit www.oracle.com/goto/emea/soa (OPN account required) If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn image[7][2][2][2] Facebook clip_image002[8][4][2][2][2] Wiki

BPM & SOA Application missing in JDeveloper 12c gallery by Martien van den Akker

clip_image001

A few weeks ago I did a BPM12c Quickstart Installation under Oracle Linux 6. Everything went smoothly, as described in the install guide as well as on many blogs already.
But I found that most of those blogs did an installation under Windows, where I did it under Oracle Linux in Virtualbox.
You would think (as I did) that it shouldn’t matter. However, it turns out that in JDeveloper I was missing the ‘BPM Application’ amongst others in the JDeveloper New Gallery. Very inconvenient. I couldn’t find any hints on the big internet. My friend Google wasn’t very helpful in this.
But I wouldn’t write this blog if I did not solve it. It turns out that with an update I got it solved.
It turns out that I lacked the ‘Spring & Oracle Weblogic SCA’ extension. Using the Help->Update functionality I downloaded and installed that and after restarting JDeveloper my ‘New Gallery’ was properly filled.
For those not so familiar with the JDeveloper update mechanism, here a step by step guide:

Choose Help->Update: Read the complete article here.

SOA & BPM Partner Community

For regular information on Oracle SOA Suite become a member in the SOA & BPM Partner Community for registration please visit www.oracle.com/goto/emea/soa (OPN account required) If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn image[7][2][2][2] Facebook clip_image002[8][4][2][2][2] Wiki

OSB12c: Errorhandling in REST by Martien van den Akker

 

clip_image002Yesterday, I had an OSB consulting day at a customer. We looked into a REST service that was to be extended with update functionality. Since calling an update service of an EIS (Enterprise Information System) can go wrong with all sorts of errors, it is important to be able to return a fault-message with the errors, jason format.
Now in OSB12c it’s very apparent how you define possible fault-messages and even how the should be formatted in JSON:

In this sample case we created a more or less simple xsd for faults (dutch: fouten). To test with different fault messages we simply duplicated the ‘fouten’ element in the xsd to ‘fouten2’. You can assign different HTTP-status codes to the different fault.
So this is configuration is pretty simple and straight forward. But it is not quite clear in the documents how you would return a specific fault within your error-handlers in the pipeline.
Internally OSB works not only ‘XML’-based but actually SOAP-based. So the trick in the end is to replace the body with a soap-fault message and the selection of the REST/JSON errormessage is done based on the structure of the document in the details-section of the SOAP-Fault. In the screen above, you would define for each fault message an xsd-element and apparently it validates the soap-fault-details content against each XSD defined, and the xsd against which the detail-content is valid points to the returned fault, with the corresponding HTTP Status.

Read the complete article here

SOA & BPM Partner Community

For regular information on Oracle SOA Suite become a member in the SOA & BPM Partner Community for registration please visit www.oracle.com/goto/emea/soa (OPN account required) If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn image[7][2][2][2] Facebook clip_image002[8][4][2][2][2] Wiki

Generate Tradingpartners for Oracle B2B 11g with Ant by Martien van den Akker

At my previous customer, a Dutch energy infrastructure managing company, I worked on an implementation of AS2 (http://en.wikipedia.org/wiki/AS2) message exchanging with Oracle B2B (part of SOASuite 11g) The company needed to exchange information about energy delivery with other companies that supply and transport energy (in this case natural gas).

Problem
Since there are many companies in the Netherlands that supply and transport gas, we needed to enter about 80 tradingpartners (TP’s), that were very similar in message-exchange capabilities. Instead of entering those 80 TP’s in Oracle B2B by hand, which is a lot of error-prone work, I decided to see if it was possible to automate the process, by generating an export file that would serve as input property file for B2B. Hence, as a start I looked at the B2B selfservice scripts. With those (ANT) scripts you can generate an export file based on a set of definition input xml files. Afterwards this export file can be imported into B2B. This last step can be done manually, but you could even import (deploy) the generated export file and even deploy the agreements automatically.

Generating the export file from an addressing properties input Excel sheet
Oracle B2B IntegrationIn our case we had two roles: shippers and suppliers. There are a few differences between the two tradingpartner roles, but all the shippers have the same capabilities as well as all the suppliers.
Hence, shippers and suppliers send and receive about the same set of messages.
Also, all the TP’s are identified in the same way, using a code. Furthermore, all the addressing properties were delivered in an Excel sheet. So I could generate a property file naming all the TP’s with all their properties and their roles. Based on the TP’s role I determined if the TP should be enabled or not: only suppliers and shippers had to be imported, the rest of the TP’s I disabled in the property file.
Lets take a look in how this was done.

Initializing
For the scripting I have some base targets and a base property file.

The property file: Read the full article here.

SOA & BPM Partner Community

For regular information on Oracle SOA Suite become a member in the SOA & BPM Partner Community for registration please visit  www.oracle.com/goto/emea/soa (OPN account required) If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn Mix Forum