Skip to Content
avatar image
Former Member

how to convert non XML (Entire plain text) file to XML (in Single XML tag) from PO 7.4 to PO 7.5

Hi Experts,

how to convert non XML (Entire plain text) file to XML (in Single XML tag) from PO 7.4 to PO 7.5? As Scenario I have is to send non XML file to 3rd party but I have 2 PI System in between

ECC (non-XML File -> (FTP) PO 7.4 (SOAP Receiver) -> (SOAP Sender) PO 7.5 (SFTP) -> Third Party

I tried without converting non XML to XML and it says content is not allowed in prolog, so I guess I need to convert the non- XML to XML (under 1 XML tag) and send it from PO 7.4 to PO 7.5 and then again convert it back to non-XML before sending it to Third Party.

Currently I am trying to use Message Transform Bean with following Module Configuration in SOAP Receiver adapter

fieldSeparator and endSeparator used is '0x1a' is EOF - end of file but does not produce any tag in XML, if I use 'nl' new line then XML is generated but every line is put under new tag, However what we need is all the text data in one XML tag. Please help!

Kindly suggest the configuration on Adapter module to transform the text file to XML and also configuration for XML to text



exmbe.png (17.2 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jan 18, 2018 at 08:09 AM

    use java map in PO 7.4 to create xml message. just add one field and put whole text in it. pass it to soap receiver.

    check this blog and modify it as per your requirement

    Add comment
    10|10000 characters needed characters exceeded

    • I tried your scenario. picking txt and sending via soap does not work. at least for me. because system expects soap message with root tag, missing root tag seems to be breaking the soap protocal rule not sure.

      if you have message like below,it works

                text file content test

      but below one does not work, that is where it is throwing error "content is not allowed in prolog"

             text file content test

      But if you can change from SOAP to REST, then it is possible, it worked for me.

      1.File to REST(Points to PI sender rest channel)

      2. REST to File

      It picks text file and successfully able to send it to receiver rest channel.

      keep the interface pattern stateless xi3.0 compatible and receiver rest adapter data format as json. Also i kept data format as xml in the sender rest adapter.

      This the REST to File scenario test result.

      rest.jpg (26.1 kB)