cancel
Showing results for 
Search instead for 
Did you mean: 

rfc look up in udf result with CDATA

ralf_zimmerningkat3
Participant
0 Kudos

I have use an rfc lookup in a udf and got the response as a String like this:

<?xml version="1.0" encoding="UTF-8"?>
<ES_CENTRALDATAPERSON>
    <FIRSTNAME>Birte</FIRSTNAME>
    <LASTNAME>Test</LASTNAME>
    <BIRTHNAME/>
    <MIDDLENAME/>
    <SECONDNAME/>
    <TITLE_ACA1/>
    <TITLE_ACA2/>
    <TITLE_SPPL/>
    <pre><code>
    <pre><code>
    <NICKNAME/>
    <INITIALS/>
    <NAMEFORMAT/>
    <NAMCOUNTRY/>
    <NAMCOUNTRYISO/>
    <SEX>1</SEX>
    <BIRTHPLACE/>
    <BIRTHDATE>1980-01-01</BIRTHDATE>
    <DEATHDATE>0000-00-00</DEATHDATE>
    <MARITALSTATUS>1</MARITALSTATUS>
    <CORRESPONDLANGUAGE/>
    <CORRESPONDLANGUAGEISO/>
    <FULLNAME>Birte Test</FULLNAME>
    <EMPLOYER/>
    <OCCUPATION/>
    <NATIONALITY>DE</NATIONALITY>
    <NATIONALITYISO>DE</NATIONALITYISO>
    <COUNTRYORIGIN/>
</ES_CENTRALDATAPERSON>

mapping the result to a targed field show this with

<Personendaten>

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

<ES_CENTRALDATAPERSON>

<FIRSTNAME>Birte</FIRSTNAME>

<LASTNAME>Test</LASTNAME>

<BIRTHNAME></BIRTHNAME>

<MIDDLENAME></MIDDLENAME>

<SECONDNAME></SECONDNAME>

<TITLE_ACA1></TITLE_ACA1>

<TITLE_ACA2></TITLE_ACA2>

<TITLE_SPPL></TITLE_SPPL>

<PREFIX1></PREFIX1><PREFIX2>

</PREFIX2><NICKNAME>

</NICKNAME><INITIALS>

</INITIALS><NAMEFORMAT></NAMEFORMAT><NAMCOUNTRY></NAMCOUNTRY><NAMCOUNTRYISO></NAMCOUNTRYISO><SEX>1</SEX><BIRTHPLACE></BIRTHPLACE><BIRTHDATE>1980-01-01</BIRTHDATE><DEATHDATE>0000-00-00</DEATHDATE><MARITALSTATUS>1</MARITALSTATUS><CORRESPONDLANGUAGE></CORRESPONDLANGUAGE><CORRESPONDLANGUAGEISO></CORRESPONDLANGUAGEISO><FULLNAME>Birte Test</FULLNAME><EMPLOYER></EMPLOYER><OCCUPATION></OCCUPATION><NATIONALITY>DE</NATIONALITY><NATIONALITYISO>DE</NATIONALITYISO><COUNTRYORIGIN></COUNTRYORIGIN></ES_CENTRALDATAPERSON>]]>

</Personendaten>

code}

due to the &quot etc the the string is tagged with CDATA by the pi an i can not mapp the string to the target field

the first result ist the same as i will get from a grafic rfc lookup but mapping to target field dose not work.

how can i get the same response like in grafic rfc lookup ?

regards ralf

Edited by: Ralf Zimmerningkat on Nov 21, 2011 9:45 AM

Edited by: Ralf Zimmerningkat on Nov 21, 2011 9:46 AM

Accepted Solutions (0)

Answers (1)

Answers (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

due to the &quot etc the the string is tagged with CDATA by the pi an i can not mapp the string to the target field

You can use DOM/SAX Parsing for this. So a solution would be to place your RFC Lookup in a class and then have a logic for using DOM/SAX parsing the output. Export the class as a .jar file and then import as imported archive. Now in your UDF, you can call this class. Make sure to take only the fields you need for mapping. See example below:

Hope this helps,

Mark

Edited by: Mark Dihiansan on Nov 21, 2011 10:22 AM

ralf_zimmerningkat3
Participant
0 Kudos

Hi the problen is that i want to receive a structure from rfc lookup and not only a single value . in grafic rfc lookup you can receive a structure like above shown an mapp it to the top target element.

and the entiere structure will be mapped to the targed fields .

with the doom parser i will only get a single value!

anupam_ghosh2
Active Contributor
0 Kudos

Hi Raif,

you wrote "with the doom parser i will only get a single value!"

I can say with DOM parser you can extract any number of values you want in your target from source XML.

In case you need the java mapping code for this, I would request you to post these information

1. Exact source XML

2. Required Target XML.

3. Version of PI you are working with.

regards

Anupam

ralf_zimmerningkat3
Participant
0 Kudos

Hi Anupam

i could not copy the code in this forum because xml will not shown in the right way

i have send you a mail

Edited by: Ralf Zimmerningkat on Nov 21, 2011 2:52 PM

Edited by: Ralf Zimmerningkat on Nov 21, 2011 2:55 PM