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.
You need to invoke getNodeValue on the Element node's Text child. It should work in JDK1.4.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I know the answer right away. Your PI version is 7.0 and it supports only JDK 1.4 version. Whereas your NWDS uses jdk 1.6 version. Jdk 1.6 version org.w3c.dom.Node contains getTextContent() method whereas it is not available in jdk 1.4 version org.w32.dom.Node
Details are as belows ...
Jdk 1.6 version
http://docs.oracle.com/javase/6/docs/api/org/w3c/dom/Node.html
Jdk 1.4 version
http://docs.oracle.com/javase/1.4.2/docs/api/org/w3c/dom/Document.html
summary you have to use only the method that is available in Jdk 1.4 version. Refer the above document. Thatswhy you get method not resolve error.
Hope that helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
7 | |
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.