HowTo use of predifined EDIFact Bindings e.g. D01b ...

54 views
Skip to first unread message

Michael RAMBICHLER

unread,
Mar 30, 2023, 3:18:32 AM3/30/23
to Smooks Users
Hi all,


i have successfully create and executed a EDI (txt) to POJO Binding d01b within a camel route but this should not matter know.
Works fine. And I receive my UNEdifactInterchange

D96AInterchangeFactory d96AInterchangeFactory= D96AInterchangeFactory.getInstance();
String ediMessage = exchange.getIn().getBody(String.class);
UNEdifactInterchange interchange = d01bInterchangeFactory.fromUNEdifact(IOUtils.toInputStream(ediMessage, StandardCharsets.UTF_8));
exchange.getIn().setBody(interchange, UNEdifactInterchange41.class);

Smooks smooks = new Smooks();
smooks.setReaderConfig((ReaderConfigurator) new UNEdifactReaderConfigurator("urn:org.milyn.edi.unedifact:d01b-mapping:*"));

But I am stuck to use the same functionality with the new smooks.
Please see my attached smooks config.

I am really looking for an example and help.

My question is How do I use predefined mappings and bindings to receive my EDI in POJO format.
Used dependencies:
<dependency>
<groupId>org.smooks.cartridges.edi</groupId>
<artifactId>edifact-schemas</artifactId>
<classifier>d01b</classifier>
<version>2.0.0-RC1</version>
</dependency>
<dependency>
<groupId>org.smooks.cartridges.edi</groupId>
<artifactId>d01b-edifact-binding</artifactId>
<version>2.0.0-RC1</version>
</dependency>



smooks-config.xml

Claude

unread,
Nov 29, 2023, 10:37:31 AM11/29/23
to Smooks Users
Hi Michael, did you find a way? There's an example of how to turn EDFACT into a POJO here: https://github.com/smooks/smooks-examples/tree/master/edifact-to-java . Smooks 2 now relies on JAXB for turning EDIFACT into POJOs.

Claude
Reply all
Reply to author
Forward
0 new messages