Skip to Content
avatar image
Former Member

XML to EDI conversion along with Filename Variable referencing field

Hi all - I have a situation where I am doing an IDOC to edi along with variable substitution in the filename. I would like the IDOC number in the filename.  The way I found to get the IDOC number was going into the payload (if there is another way to get IDOC number to put in the filename I would use that)

I get the error: Message could not be forwarded to the JCA adapter. Reason: javax.resource.ResourceException: The variable substitution can not parse the message xml: Content is not allowed in prolog.

If I remove the variable substitution where I am attempting to get the idoc all works well and I get my output file, thus my assumption is that there is something wrong with my substitution.

I am assuming the XML I am parsing is prior to the edi conversion thus the payload is

<?xml version="1.0" encoding="UTF-8"?>

spiritaero.com:B2B:ANSIX12">

<S_ISA>

  ....

  <D_I12>000278191</D_I12>

My variable substitution is

variable name: idoc

reference: payload:ASC810_003010,1,S_ISA,1,D_I12,1

THoughts on how to fix my situation?

Regards,

Diane

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Sep 18, 2014 at 03:02 AM

    Hi Diane

    AFAIK, variable substitution will not work if the payload is converted to non-XML format at the receiver channel, by way of content conversion or IDoc/EDI conversion modules.

    Due to the conversion, the payload is no longer in XML format, therefore at the point of variable substitution, it is not able to parse it as an XML.

    For such scenarios, I normally use Dynamic Configuration in the message mapping to construct the filename and set it in the Filename attribute.

    Rgds

    Eng Swee

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 29, 2014 at 03:14 PM

    Hi Diane,

    Variable substitution requires you to have the filename as part of your target payload.

    In your scenario, you need to add Idoc number to file name which is in source payload, So lets use dynamic configuration. Just to add more on Eng comments. Below is the process.

    --> Map Idoc number to target field. Example:FileName

    --> In configuration, Go to Adapter Specific Message Attributes --> Check first three options including File Name.

    --> Use run operating system command after message processing, write unix command to add idoc number in file name.

    Below are the reference links.

    Dynamic Configuration vs Variable Substitution - The Ultimate Battle for the File Name

    Dynamic file name and directory in Receiver File Adapter - summary of possibilities - Process Integration - SCN Wiki

    Thanks & Regards,

    A.Neelima.

    Add comment
    10|10000 characters needed characters exceeded