cancel
Showing results for 
Search instead for 
Did you mean: 

PI file to soap

former_member214137
Participant
0 Kudos

Hi,

I have a file to soap scenario where I have to map the entire contents of the file to a single field in the soap request.

How do I map the entire contents of a file to a single node?

Thanks for the quick responses. I'm not sure if they answer my question so let me add some further detail.

I have an outbound text file and the contents is structured, but I don't know for this exercise if that is relevant. I need to map the entire contents of an outbound text file to a specific node in the inbound soap call.

e.g contents of text file is "VGhpcy     BpcyBhIHRlc     3QgZmlsZQ" the contents of the corresponding soap node needs to be

<fileContent>VGhpcy     BpcyBhIHRlc     3QgZmlsZQ</fileContent>

regards

Julian

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

you can use CDATA as per my blog:

http://scn.sap.com/people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-...

doing a concat will be too difficult as you may have too many fields and "return as XML" option will not work as your XML will have a wrong structure and SOAP may not be able to handle that - so please use the CDATA to do it properly

Regards,

Michal Krawczyk

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

we do have similar requirement of sending whole EDi file in one field of SOAP request.

we read the whole text file into single field using sender FCC and passed it to the target field.

i hope in the target WSDL you have a specific field for it.

Suresh

former_member214137
Participant
0 Kudos

Hi Suresh,

I think your suggestion will work as I have been given the same advise by a colleague after raising this post.

To everyone else thanks, I think my initial description may have mislead.

thanks

Julian

former_member214137
Participant
0 Kudos

Hi Suresh,

How did you read the entire file contents into a single target field using FCC?

Reading this post http://scn.sap.com/message/8544862#8544862 reading to a single xml node is not possible. I am hoping you can prove them wrong.

regards

Julian

Former Member
0 Kudos

Hi Julian,

My Sender side MT looks like below.

record set - filecontent

                     - Content

FCC RecordSet structure - filecontent,1

   filecontent.fieldnames - content

  filecontent.fixedfieldlength - 999999999

ignorerecordsetname - true.

let us give a try.

Suresh

former_member214137
Participant
0 Kudos

Hi Suresh,

Thanks for the feedback. I still can't get it to work. Would you mind looking at this information and let me know if you can see anything obvious? I am working on 7.1.

Thanks in advance

Julian

Message Mapping

Content conversion

Input file

hello world line 1

line 2

line 3

Output file

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

<ns0:soap_mt xmlns:ns0="urn:julian_test">

<fileType>File type value</fileType>

<Filename>File name value</Filename>

<content>hello world line 1</content></ns0:soap_mt>

Inbound Payload

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

- <ns:file_mt xmlns:ns="urn:julian_test">

- <content_in>

<line_item>hello world line 1</line_item>

</content_in>

- <content_in>

<line_item>line 2</line_item>

</content_in>

- <content_in>

<line_item>line 3</line_item>

</content_in>

</ns:file_mt>

Former Member
0 Kudos

Hi Julian,

I have a similar scenario FILE to SOAP, in which I need to map complete content of flat file into a single xml node in the target structure.

I have used sender File Adapter(FCC), and maintained FCC parameters as used by you and Suresh.

But I am also getting XML as multiple lines of the same node.

My flat file have more than one lines, and what I observed is that it is creating one file content node for every line in the flat file.

What I want is the complete file(all lines) should go in one single XML field.

Please share how you overcome this problem.

former_member214137
Participant
0 Kudos

Hi Bharat,

To be honest we dropped the SOAP adapter in favour of using the new SAP SFTP adapter.

To acheive the requirement of mapping the data I used the XML2Plain transormation.

Sorry I couldn't be of any further help.

Best of luck.

Julian

Former Member
0 Kudos

Can anyone help me with above requirement ?

Former Member
0 Kudos

Hi,

If you want to pass entire source xml in a field, then there is a standard way you can do this. Map root node of your source message to the target field and set "Return as XML".

-Amol

Former Member
0 Kudos

as per my  understand, that is very simple by using Concat field .

field1 + field2 +concat+....................................-> target field

or

udf:

mapping: for ex:

source side : u adda source fields and target side add one request field

Message was edited by: solasu bhavanisankar