OSB 10gR3 and SWA and MTOM

This blog is about using soap with attachments and the use of MTOM within the OSB (10gR3).
A service is created that accepts a soap with attachment (DocumentService) and translates it to a service that accepts a binary element. MTOM is used for performance reasons for the second.

Some notes:
* For the use of attachments you need RPC-style document instead of the usual document-style. This due to the fact that the document-style limits a message to a single .
* A service can not have both SWA and MTOM within OSB.

First a WSDL is setup for the DocumentService:



The $attachments variable holds the attachments and the body holds the attachment data. Also other data is stored within the attachment element (see here). In the case of a binary attachment (as described within this post), this data is not put in the body element. Instead the Oracle Service Bus run time stores it in an in-memory hash table and a reference to that content is inserted into the XML (binary-content element).

Then you can use the OSB Test console to send an attachment and view the attachment variable.
After the attachment is sent, you can view the content of the attachments variable and it shows the binary reference.

Now the business service wsdl is defined and configured. The following WSDL is used.




We now define the business service that uses MTOM/XOP as transport protocol. Make a WSDL Web Service with the previous defined WSDL. In the transport properties just use http://localhost:7001/ecm as the endpoint, leave HTTP transport properties the default. In the Message Content you can set the MTOM/XOP enabling of the format. You have two possibilities (I will show both options). First select the "Include Binary Data by Value".

  • Include Binary Data by Reference: (Default) In an outbound response message, replace xop:Include elements with ctx:binary-content elements when setting up the $body message context variable.
  • Include Binary Data by Value: In an outbound response message, replace xop:Include elements with Base64-encoded text versions of corresponding binary data when setting up the $body message context variable.
Now we call this business service from within the proxy service.
Of course we have to map the document attachment to the bas64Binary element within the business service.
We add a Replace (Replace Node Contents) of the $body variable after the Assign.
If you run this within the test console with a Word attachment (Content-Type: application/word), you get the following invocation tree.
You see a binary-content reference, so you do not actually see what goes over the HTTP transport. Therefore you can use tcpmon which is a HTPP monitoring tool.
Run the tool and set it up by listening on port 8090. Click Add Monitor.

You also need to change the endpoint of the business service so that the message is sent to tcpmon.
Now run the test console again with an attachment. Now you probably get the following error.
It says that mixing attachments with XOP/MTOM is not allowed. This is due to the fact that we did not change the $attachments variable. You have to delete the attachments so we add a Delete after the Replace.
If you now run the test console again with an attachment the tcpmon tool we show you the actual http call and it will look something like this.
You can see that the Post is a application/xop+xml type and the Doc element contains a inc:Include reference.
The MIMI boundary contains the actual binary data.

Include Binary Data by Reference
Now change the Message Content configuration of the business service to Include Binary Data by Reference and run the test tool again. You will notice that in this case the result is the same.

Connect .NET application with Microsoft SQL database through OSB

I received a mail today from a Blogspot.com reader with the following question:

"Is it possible, to connect a .net application (running on Microsoft SQL 2010), with an Oracle OSB and import data from a SQL-database"

The reason I post this is that other people can also react and so we get more views on it.
My view on it:
  1. Make a WebLogic webservice (using for instance OpenJPA) to get the data from the SQL database.
  2. Expose this webservice through the OSB
  3. Call this service from the .NET application
This has the following advantages:
* No tight coupling between application and SQL database
* Reuse possibility of the data(base) service


Introduction to Cordys BPM (BOP4)

A couple of months ago I had a training in Codys BOP4 fundamentals and this week I developed my first demo bpm process with it.
And I must say i was really impressed by the speed of development and out-of-the box functionality of the product!.
The power of the product is the BPM part, but it also has an integration part.

You can download a VM image here and there you find also a lot of documentation and tutorials.

At the moment I am developing a demo for a customer, integrated with the Oracle OSB.

Hope to blog more about the product soon.