cancel
Showing results for 
Search instead for 
Did you mean: 

RFC lookup error in SAP PI 7.0

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

anupam_ghosh2
Active Contributor
0 Kudos

Hi Aniruddha,

                     Please check this blog

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/70d90a91-3cf4-2a10-d189-bfd37d9c3...

Author is using node.getNodeValue();  function to retrieve specific value. You need to do the same.

Regards

Anupam

Answers (2)

Answers (2)

nabendu_sen
Active Contributor
0 Kudos

You need to invoke getNodeValue on the Element node's Text child. It should work in JDK1.4.

baskar_gopalakrishnan2
Active Contributor
0 Kudos

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.