on 11-21-2011 8:43 AM
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 " 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
Hello,
due to the " 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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
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
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.