Skip to Content
0

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

Jan 16 at 04:07 AM

184

avatar image
Former Member

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

Regards,

Nitin

exmbe.png (17.2 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Muniyappan Marasamy Jan 18 at 08:09 AM
0

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

https://blogs.sap.com/2015/03/23/read-input-file-data-as-is-in-single-node-and-pass-to-output-structure/

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Miuni,

thanks for the reference blog but for the interface we are trying to avoid any mappings in ESR as it is just a pass-through interface.

Regards,

Nitin

0

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

 <soapenv:Body>
      <soap:Messagetype>
          text file content test
      </soap:Messagetype>
   </soapenv:Body>

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

<soapenv:Body>
      
       text file content test
      
   </soapenv:Body>

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)
0