If you are not able to generate UTF-8 BOM document using previous methods, then follow below.
1. Create Java Task Service and add below code to it
import java.io.ByteArrayInputStream;import java.io.ByteArrayInputStream;import java.io.InputStream;import java.io.OutputStream;import java.io.SequenceInputStream;import com.sterlingcommerce.woodstock.workflow.Document;import com.sterlingcommerce.woodstock.workflow.WorkFlowContext;byte[] bom = {(byte)239, (byte)187, (byte)191};Document doc = wfc.getPrimaryDocument();InputStream isDoc = doc.getBodyInputStream();InputStream seqStream = new SequenceInputStream(new ByteArrayInputStream(bom), isDoc);int read;byte[] bytes = new byte[1024];Document newDoc = wfc.newDocument();;OutputStream os = newDoc.getOutputStream(); while ((read = seqStream.read(bytes)) != -1) { os.write(bytes, 0, read); }wfc.putPrimaryDocument(newDoc);os.flush();os.close(); seqStream.close();isDoc.close();return "000";
2. In your BP, encode document with UTF-8 using Encoding Conversion service
3. call the Javatask service you created in step-1
4. When you run the BP, Javatask will generate new PrimaryDocument that has BOM in it
-Dhiraj Patil
------------------------------
Dhiraj Patil
------------------------------
Original Message:
Sent: Tue May 05, 2020 01:48 PM
From: Carrie Easterling
Subject: Encoding UTF-8 with BOM (Byte Order Mark)
We tried using Encoding Conversion Service in B2Bi, but couldn't figure out proper value for output_encoding setting, in order to produce UTF-8 with BOM.
My GPM (Graphical Process Modeler) won't load, so I can't look in GPM for options on output_encoding values.
And I haven't been able to find any documentation that shows options for output_encoding values.
Can you suggest what to try as output_encoding value?
This communication is intended to be received only by the individual[s] or entity[s] to whom or to which it is addressed, and contains information which is confidential, privileged and subject to copyright. Any unauthorized use, copying, review or disclosure is prohibited. Please notify the sender immediately if you have received this communication in error [by calling collect, if necessary] so that we can arrange for its return at our expense. Thank you in advance for your anticipated assistance and cooperation.
Cette communication est destinée uniquement à la personne ou à la personne morale à qui elle est adressée. Elle contient de l'information confidentielle, protégée par le secret professionnel et sujette à des droits d'auteurs. Toute utilisation, reproduction, consultation ou divulgation non autorisées sont interdites. Nous vous prions d'aviser immédiatement l'expéditeur si vous avez reçu cette communication par erreur (en appelant à frais virés, si nécessaire), afin que nous puissions prendre des dispositions pour en assurer le renvoi à nos frais. Nous vous remercions à l'avance de votre coopération.
Original Message------
As per my understanding they want to change the encoding format of file they have received before pushing it out of B2Bi.
There is Encoding Conversion Service which acts on the input file and coverts from input format to output format
Also customer can refer whether this service 'XML Encoder service' an option which they can use before doing any XML translation.
------------------------------
Rashmi Acharya
------------------------------
#SupplyChain
#B2BIntegration