Saturday, September 22, 2012

In my previous post I explained how you can poll/read file in OSB. In this post I will explain you how to write file  in OSB.

Follow below step to write file in OSB.

Step 1.) Create new OSB project and Business Service.
  • First Create a session and then click on "Project Explorer".
Create New project
  • Add new project with the name "WriteFile".
Write File Project
  • Now click on newly created project to add new folder.
Add Folder
  • Add new folder inside "WriteFile" project with name "businessService".
business Service Folder
  • Now click on "businessService" folder to create business service and choose "Business Service" as "Resource Type".
Choose Resource Type

Step 2.) Fill details in Business Service.
  • Enter Business service name and choose "Service Type" as "Messaging Service". Click on "Next" button.
Name Business Service
  • Choose "Request Message Type"  based on what type of file you want to write.In my case it is text file so I will choose "Text". Choose "Response Message Type" as "None" as we don't need any response after writing the file.
Choose Message Type

  • Choose "file" protocol from drop down list.
file Protocol
  • Provide the "Endpoint URI" and click on "Add" button.
              file:///{Dirve Id}/filedir/

  • Provide File Transport Protocol details. Click "Next".
Fill File Name

  • Accept all default values and save Business Service. Now your Business Service is ready to write text file.

Go through my previous post which explains how you can read/ poll file in Oracle Service bus.

                               Read/Poll  file in OSB


  1. Hi,

    Very well explained.
    The above mentioned steps would create the file each time the business service is triggered.
    Could you please mention if there is any way to write in to file without creating it again and again ?

    1. You can create Adapter in Jdeveloper and choose append option and use that adapter JCA, WSDL and XSD file in OSB.

      Vivek Garg