And ex-colleague asked me to give a little help on setting the filename which was getting created by his Oracle Service Bus flow.
Create a new business service with file transport and set the correct location of the file with his prefixes.
In this wizard we can only set the prefixes and the location of the file, so no option to set the filename by use of some expression.
For the interface of the proxy service i used the almighty helloworld wsdl, and the content of this request we will put in the file.
The name of the file will have the value of the first argument (‘arg0′) on the ‘hello’ operation (in this case ‘John’ with the prefixes).
<hel:hello xmlns:hel="http://hello.service.xenta.nl/">
<!--Optional:-->
<arg0>John</arg0>
</hel:hello>
In the flow route to the business service (or use the option in the ide to create a proxy service from a business service).

Open the route and the only thing we need in here is the activity ‘Set Transport Headers’.

Since we’re routing to a business service which makes use of the file transport we can make use of the ‘fileName’ property of the ‘file’ part.
If we would have create a business service for some other transport we could also make use of all the other properties to override values in the routing.
Just browse the list, a lot of usefull properties to use.
We select the ‘fileName’ of the ‘file’ part, and at the right we will now be able to use an expression to override the default generated filename by the Oracle Service Bus.
In our case we will select ‘Set Header to’ and use the expression ‘$body/hel:hello/arg0/text()’.
Save the flow and run the proxy service. Using the payload from above the next file will be created ‘c:\test\mytestfileJohn’. Prefix + ‘John’ from the payload.
Popularity: 5% [?]





2 Responses to “Oracle Service Bus, set filename for business service”
Hi Eric,
Thanks for nice article
Mani
thanks