Skip to main content

MTOM based OSB Proxy & Business Service/Attachment Handling using Oracle Service Bus (OSB)

This blog is about using soap with attachments and the use of MTOM within the OSB (11g).
A service is created that accepts a soap with attachment and translates it to a service that accepts a binary element. MTOM is used for performance reasons for the second.
* 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 .
Oracle Fusion 11g is an enterprise ready family of integration products from Oracle.  Oracle Service Bus (OSB) 11g  is one of the components in Fusion middleware product.  OSB can do routing, transformation and orchestration of messages. Messages can be of xml or non xml.  Here we are concerned about sending files as attachments along with the messages.  We will discuss how OSB handles attachments and the configurations done for the same.

Types of Attachment handling: Attachment handling can be of two types.

  1. Inline attachment handling
Here the attachment file will be encoded into some format, say base64 format and send it as part of the main xml message
  2. MIME attachment handling
Here the attachment will be send as part of attachment headers along wth the normal xml message. The attachments can be received in multiple formats by OSB, but one of the common format is base64 encoded binary format.
  • Include Binary Data by Reference: (Default) In an outbound response message, replace elements with elements when setting up the $body message context variable.
  • Include Binary Data by Value: In an outbound response message, replace elements with Base64-encoded text versions of corresponding binary data when setting up the context variable.
On the second local proxy service:
Here we have done with proxy part, Now we will test this service by SOAP UI with some attachment.
Here is SOAP UI result:
Now we see how this worked:
In our local proxy where we are receiving message as binary and returning text, so when this local proxy will be called on main proxy, following will happen.

As you see in this image, the variable "attachedBodyRequest" is request variable for local proxy where binary to text conversion is done, and "attachedBodyResponse" is response variable of same. so in the attachedBodyResponse variable local proxy is returning reference binary data.
Point to remember: As you will see in main proxy there is a delete activity whose task is to delete "./ctx:attachment" variable from header as this proxy does not support attachment return in response, so if you will not delete this variable you will get following error.
So for solving this error, add delete activity with following code.
This is done, if you want to upload this file to a folder in server location or you want to use some FTP server, then create a business service and upload it.

Comments

  1. Hi Sandeep, Images seem to be not showing up. can you let me know where i can find them?

    ReplyDelete
    Replies
    1. Images are here,

      https://www.linkedin.com/pulse/mtom-based-osb-proxy-business-serviceattachment-using-pachauri/

      Delete
  2. Thanks a lot very much for the high quality and results-oriented help. I won’t think twice to endorse your blog post to anybody who wants and needs support in this area. same as your blog i found another one Oracle OSB Training .Actually I was looking for the same information on internet for Oracle OSB and came across your blog. I am impressed by the information that you have on this blog. Thanks once more for all the details.

    ReplyDelete

Post a Comment

Popular posts from this blog

Oracle SOA 12C rest adapter with Custom HTTP headers

Most existing web applications are connected through web services, which are commonly known as SOAP services. More and more users are relying on mobile devices for communication, and they’re looking for lighter ways to access enterprise information on the go. REST services are the answer for the mobile device platform, because they get rapid responses and fast access to data. Oracle SOA Suite 12 c  provides a complete set of service infrastructure components for designing, deploying, and managing composite applications. Oracle SOA Suite 12 c  enables services to be created, managed, and orchestrated into composite applications and business processes. Some time we have need to send HTTP headers in REST service, In OSB we use header component and add what ever is needed but in oracle SOA 12C it's little bit different. Let see how we can do it. Create one SOA Application. Create one SOA Sample project inside SOA Application. Go to composite and drag drop REST ...

Solution for BPM standard dashboard & activity guide not working in Oracle SOA 12.2.1.0 C

As earlier i publish a post about different issue of Oracle BPM, After some oracle support i got to fixed them. Issue Blog Here... Issue 3:BPM 12.2.1 process workspace activity guide not working. if you have a normal BPM Process, then this is the issue. In order to have data populated in "Activity Guide" firstly you should create a BPMN Guided Business Process. Below you can find the documentation about activity guide and how to create a Guided Business Process: https://docs.oracle.com/middleware/1221/bpm/bpm-develop/GUID-F765955D-90A5-48D4-8D2A-2F01FBB539E3.htm#BPMPD901 And here is specified: " A Guided Business Process is modeled as an activity guide that is based on a business process. The Activity Guide includes a set of Milestones. A milestone is a contained set of tasks that the end user has to complete. A milestone is complete when the user successfully runs a specific set of tasks in the milestone. " And in the below chapters you will find the ...

Swagger API document from Any WADL & Schema in Oracle SOA

Hi everyone, Hope everyone is doing well these days, Recently i started a project work over how to generate swagger API document for your any REST API, In case if you don't know what is swagger please go and check " https://swagger.io/tools/swagger-editor/ ". It's a great and easy to use tool which will help to create user friendly, human readable form API documentation with extension for generating API client in different languages with capability of testing your API from same. What is swagger editor, Design, describe, and document your API on the first open source editor fully dedicated to OpenAPI-based APIs. The Swagger Editor is great for quickly getting started with the OpenAPI (formerly known as the Swagger Specification) specification, with support for Swagger 2.0 and OpenAPI 3.0.  What benefits you will get by using swagger, Runs Anywhere, The Editor works in any development environment, be it locally or in the web. Smart Feedback, Validate you...