IBM Support

How-to set per RouteChannel the SourceCharacterEncoding for the WMQFTE Create Transfer Service used internaly by SFG

Technote (troubleshooting)


The WMQFTE Create Transfer Service (see link {A}) used in the integrated SFG Business Process initiates an MQFTE transfer in text mode without specifying the SourceCharacterEncoding.
Thus MQFTE defaults the SourceCharacterEncoding to the default character encoding of the in SI integrated MQFTE agent on the sending SI system (see link {B}). But the character encoding of files to be send may differ from this default.


File having character encoding alien from the default elucidated above may get corrupted during transfer in text mode.


  • The symptoms appear only to SFG Partner having
    - Partner Role: Consumer of Data and
    - Transport Method: WebSphere MQ FTE.
  • Prerequisites to apply the resolving steps:
    - a running SFG - MQFTE integration (see link {C}) and
    - basic knowledge of SI dashboard UI and SFG UI usage and BP source code editing.
  • This How-to is developed on an SI 5.2.4 / SFG 2.2.4 but should also be applicable to other version (maybe take care about slightly different line numbers).

Resolving the problem

Follow these steps:

  1. Modify the BP FileGatewayDeliverWMQFTE (SI dashboard UI: Business Processes > Manager > Search "FileGatewayDeliverWMQFTE" > Source Manager > Edit [latest Version]):
    (Recommendation: copy the complete BP source code to your favorite external text editor and copy it completely back after you are done with the modifications.)
    1. Insert just before <operation name="WebSphereMQ FTE Create Transfer Service"> (around line 100) the following lines:
      (You can omit or un-comment the myDefaultSourceEncoding line if you want the system to use the default character encoding of the MQFTE agent when you do not specify an encoding for a route channel - see link {B}.)
      <assign to="mySeperator">,</assign>
      <assign to="myDefaultSourceEncoding">UTF-8</assign>
      <assign to="myMailbox" from="FG/MailboxPath/text()"/>
      <assign to="mySourceEncoding" from="if(contains(myMailbox,mySeperator), substring-after(myMailbox,mySeperator), myDefaultSourceEncoding/text())"/>
      <assign to="FG/MailboxPath" from="if(contains(myMailbox,mySeperator), substring-before(myMailbox,mySeperator), myMailbox/text())"/>
    2. Insert after <assign to="SourceFileDisposition">DELETE</assign> (about 22 lines later) the following line:
      <assign to="SourceCharacterEncoding" from="mySourceEncoding/text()"/>
    3. (If you've done the modification in an external source editor: clear the input area in the browser window and copy the modified source back.)
      Choose a Description like "Added changeable SourceCharacterEncoding".
    4. Click Next > Next > Next > Next (until input screen "Default Version") and select the topmost "Other Version" (modified just some minutes before).
    5. Click Next > Finish > Return.
  2. Create an Routing Channel Template (SFG UI: Routes > Templates > Create):
    1. Fill the wizard as usual and suitable for your environment except 2 additions:
    2. Provisioning Facts > Add > Fact Name: mySourceEncoding, Display Label: Source Encoding, Description: Enter the encoding of the document that is passed to the MQFTE transfer for this Route Channel
    3. Consumer > Delivery Channel > Pattern for Consumer Mailbox Path: add the following string after your desired mailbox path (without spaces):
    4. Ensure that the first check-box is enabled, so that mailboxes are created on demand if required
    5. Continue defining your consumer file structure and save the routing channel template
  3. Create Route Channels for each Producer using the new Routing Channel Template (from step 2.)
    1. Now you can set for each Route Channel the Source Encoding (take troubleshooting hints into account - see step 4.)
    2. You can verify that your specified encoding has been used in the MQ Explorer > MQFTE > Transfer Log > Right-Click on Transfer > Properties > in section IN PROGRESS: look for the value in the XML tree at transaction/transferSet/item/source/file@encoding.
  4. Troubleshooting hints
    1. If you specify an encoding that is not supported by MQFTE (see link {D}) you'll get an "Error creating transfer" (in the list of delivery events and as Advanced Status of the Service call SFGWMQFTECreateTransfer in the Business Process Details list) as well as this error in the wmqfteservices.log:
      [...] ERROR 000000000000 GLOBAL_SCOPE <CreateTransferImpl-SFGWMQFTECreateTransfer-...> Error creating transfer Error creating transfer
         Caused by: java.nio.charset.UnsupportedCharsetException: XXX

Related information

{A} SI MQ FTE Create Transfer Service
{B} MQ FTE Transferring text files
{C} Integrationg MQ FTE and SI
{D} MQ FTE Available code pages

Document information

More support for: Sterling B2B Integrator

Software version: All

Operating system(s): Platform Independent

Reference #: 1650403

Modified date: 23 September 2013

Translate this page: