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:

  • 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 of an object loaded from local variable 'binding''. Cause Exception: 'while trying to invoke the method 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);



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

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


                  SystemAccessor accessor = null;

                  accessor = LookupService.getSystemAccessor(channel);


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

                  String loginxml = "<login xmlns=\"\"> <username>"

                        + username

                        + "</username> <password>"

                        + password

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

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


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


                  Payload payload = LookupService.getXmlPayload(inputStream);



                  Payload SOAPOutPayload = null;

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

                  SOAPOutPayload =;

                  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());



Looks like We are getting the error while executing the line

SOAPOutPayload =;

as all the trace before this line is printed.

Please help as this is very urgent.



Former Member

Helpful Answer

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