Tuesday, May 11, 2010

OSB: how to write something to a file

create  a BS,
type Messaging Service,
Request Message Type = text,
Response Message Type = none,
Transport Protocol. File
end point URI: add your destination directory

The payload will be written to a file with a name like this:

If you want to set the filename (which sounds reasonable) should set the transport headers :
<file:filePath      xmlns:file="http://www.bea.com/wli/sb/transports/file">C:\temp\files\peppolino.txt</file:filePath>

The response document will be empty, and the response metadata will be


Since the input is specified as text, it can be anything, not necessarily XML.

To set the file name, in the Route node use the option "Set Transport Headers for[ Outbound Request ]" and selected Pass all Headers through Pipeline in the calling proxy.


Unknown said...


How to set this file name like reasonable, I didn't get that step, Could you please explain me.


Pierluigi Vernetto said...

hi Suresh, I have added a paragraph to explain how to add the transport header. It's an option in the Route command...

Unknown said...

Hi Pierluigi,

Thanks so much for the response. As per your comment I have done that. But I am expecting abc_YYYYMMDD_Sequence.txt ?? Is it possible in OSB ??

appreciate for your help..


Pierluigi Vernetto said...

Suresh, you can compute dynamically the filename with an XQuery expression, with a Java Callout, or if you are brave enough you could use the Oracle File Adapter (RAR) which implement OOTB this date/sequence functionality

Unknown said...

Hi Pierluigi,

got it. Thanks so much for the reply...