Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

LookUp Exception in Java Mapping PI 7.3

Hi Experts,

This is an IDOC to Web Service Scenario where in we are using Message mapping and Java Mapping.

We are using Java Mapping for Calling the soap adapter which gets the session id from 3rd party. Then we build the custom soap header using this session id in java mapping. This payload is sent through another soap channel which is configures in the ID reciever communication channel.

We are getting the below error in Operation Mapping:

  • com.sap.aii.mapping.lookup.LookupException: Exception during processing the payload. Error when calling an adapter by using the communication channel SOAP_GetSessionId_NewReceiver (Party: , Service: SFDC, Object ID: d722599711af3766af5b40493aa27e37) XI AF API call failed. Module exception: 'java.lang.NullPointerException: while trying to invoke the method com.sap.aii.af.service.cpa.Binding.getObjectId() of an object loaded from local variable 'binding''. Cause Exception: 'while trying to invoke the method com.sap.aii.af.service.cpa.Binding.getObjectId() of an object loaded from local variable 'binding''.

We are using the below piece of code:

   /* method is to login to SFDC with the username and password to get the sessionId from the response*/

      private void getSessionIdFromSFDC(String username, String password)

      {

           // AbstractTrace atTrace = null;

            //atTrace = (AbstractTrace) map.get(StreamTransformationConstants.MAPPING_TRACE);

            try

            {

             getTrace().addDebugMessage("******* My trace starts here for getSessionIdFromSFDC *******");

                  Channel channel = LookupService.getChannel("SFDC","SOAP_GetSessionId_NewReceiver");

                  getTrace().addDebugMessage("channel="+channel);

                  SystemAccessor accessor = null;

                  accessor = LookupService.getSystemAccessor(channel);

                  getTrace().addDebugMessage("accessor"+accessor.toString());

                  getTrace().addDebugMessage("******* create login xml  *******");

                  String loginxml = "<login xmlns=\"urn:enterprise.soap.sforce.com\"> <username>"

                        + username

                        + "</username> <password>"

                        + password

                        + "</password> </login>";

                  getTrace().addDebugMessage("******* login xml created  *******");

                  getTrace().addDebugMessage("LogInXML"+loginxml);

                  InputStream inputStream = new ByteArrayInputStream(loginxml.getBytes());

                  getTrace().addDebugMessage("inputStream"+inputStream);

                  Payload payload = LookupService.getXmlPayload(inputStream);

                  getTrace().addDebugMessage("payload"+payload);

                  getTrace().addDebugMessage("payload"+payload.toString());

                  Payload SOAPOutPayload = null;

                  getTrace().addDebugMessage("******* Call accessor  *******");

                  SOAPOutPayload = accessor.call(payload);

                  getTrace().addDebugMessage("******* get SOAPOutPayload  *******"+ SOAPOutPayload);

                  getTrace().addDebugMessage("******* get content  *******");

                  InputStream inp = SOAPOutPayload.getContent();

                  getTrace().addDebugMessage("******* get DOM instance *******");

                  DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();

                  DocumentBuilder builder = factory.newDocumentBuilder();

                  Document document = builder.parse(inp);

                  NodeList sessionId1 = document.getElementsByTagName("sessionId");

                  Node node = sessionId1.item(0);

                  if (node != null)

                  {

                        node = node.getFirstChild();

                        if (node != null)

                        {

                         getTrace().addDebugMessage("******* get session id  *******");

                              sessionId = node.getNodeValue();

                        }

                  }

            }

            catch(Exception e)

            {getTrace().addDebugMessage("******* Excepitionraised *******"+e.toString());

                  e.printStackTrace();}

      }

Looks like We are getting the error while executing the line

SOAPOutPayload = accessor.call(payload);

as all the trace before this line is printed.

Please help as this is very urgent.

Thanks.

Pooja

Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question