on 10-19-2012 4:07 PM
Hi Experts,
In SAP PI 7.0 I write a UDF for RFC lookup. In this function it is giving error as below:
cannot resolve symbol
symbol : method getTextContent () location: interface org.w3c.dom.Element returnValue = eElement.getTextContent();
When I use getNodeValue() it is returning null value.
the structure of the output rfc xml is simple:
<?xml version="1.0" encoding="UTF-8" ?>
# <ns0:Z_R_RFCXIPO xmlns:ns0="urn:sap-com:document:sap:rfc:functions">
<O_OUTPUT>12</O_OUTPUT>
</ns0:Z_R_RFCXIPO>
The code which I have written is
Document docResponse = null;
String returnValue = null;
NodeList nList = null;
Node node = null;
try {
docResponse = builder.parse(in);
if (docResponse == null)
trace.addWarning("docResponse is null");
nList = docResponse.getElementsByTagName("O_OUTPUT");
// Element eElement = (Element) nList.item(0);
node = nList.item(0);
returnValue = node.getTextContent();
trace.addInfo("output: "+ returnValue);
}catch (Exception e) {
trace.addWarning("Error when parsing RFC Response - " + e.getMessage());
}
I am unable to understand why the error. When I run this in NWDS it is running fine.
What can be the error ? Any version problem?
Thanks,
Aniruddha
Hi Aniruddha,
Please check this blog
Author is using node.getNodeValue(); function to retrieve specific value. You need to do the same.
Regards
Anupam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.