Home > SOA Suite > Write XML files with specific encoding in SOA Suite

Write XML files with specific encoding in SOA Suite

Outbound FTP adapters in Oracle SOA Suite normally use the default character encoding. Usually that means that all XML files are written in UTF-8. What do you do if you need to use something else, for example ISO-8859-1?

The logical solution would be to set an adapter property. In 11.1.1.6 there are three likely candidates: CharacterSet, Encoding and jca.message.encoding. Unfortunately none of them works. CharacterSet and Encoding only apply to attachments and are not even used by the adapter. The documentation states that they are meant for third-party applications that need to process the attachment. The jca.message.encoding is used, but only when the adapter reads files, not when it writes them.

What to do? The solution has been with us for a long time, the adapters in 10g worked in the same way. For native files the encoding can be specified in the schema with the nxsd:encoding attribute. It turns out that this works for normal XML files that have no need for native conversions too.

Simply add the following to the main XSD:


<xsd:schema 
  xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
  nxsd:version="XSD" nxsd:encoding="ISO-8859-1"
  ...>

Problem solved, the adapter will use ISO-8859-1. A bit dirty (in particular when the schema is owned by someone else), but it works.

Advertisements
Categories: SOA Suite
  1. akshay
    2016-10-28 at 09:25

    how can i achieve utf8 with bom in the encoding?

  2. 2016-10-29 at 20:57

    I’m a bit rusty, the post is from 2013 after all. Hopefully things have improved since then. However, with 11.1.1.6 I think you are out of luck. I would go for a quick and dirty workaround. Write the files to a temporary location in UTF-8 without the BOM, then read them with another flow in binary form, add the BOM and write them to the real target. Or you could always use some Java code in place of the outbound adapter. We had quite a bit of that.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: