Skip to Content
avatar image
Former Member

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 = " enterprise.soap.sforce.com\"> "

                        + 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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Sep 19, 2012 at 01:08 PM

    Hi Pooja

    Please refer to this thread which has solved my issue

    http://scn.sap.com/thread/3239187

    Add comment
    10|10000 characters needed characters exceeded

    • Pooja,

      Can you let me know why you are adding this info? For the SOAP Lookup to work, as long as a Receiver Agreement exists the same should work. On our end we do not add any Operation Name n the mapping to the accessor object.

      accessor.setOperationName("SI_IS_Token");

      accessor.setOperationNamespace("http://bombardier.com/Interface/HRData");

      Try removing this code, and ensure that the SOAP Receiver Adapter SFDC --> SOAP_GetSessionId_NewReceiver in your case is used in a Receiver Agreement.

      The Interface Name and Namespace in the receiver agreement can be anything and the same need not be referenced within your Look Up code.

      Regards,

      Bhavesh

  • Sep 18, 2012 at 11:35 AM

    Hi Pooja

    I am currently developing the exact same scenario and am also failing at the same line of code.  My error is:

    • com.sap.aii.mapping.lookup.LookupException: Exception during processing the payload. Error when calling an adapter by using the communication channel SOAP_Receiver_UserSFLoginRequest (Party: , Service: SALESFORCE_DEV, Object ID: 062db5d582653ffc9d3a7b4f3b7237e1) XI AF API call failed. Module exception: 'com.sap.aii.af.service.cpa.CPAObjectNotFoundException: Couldn't retrieve outbound binding for the given P/S/A values: FP=;TP=;FS=Mapping;TS=SALESFORCE_DEV;AN=;ANS=; in the current context [Unknown]. '. Cause Exception: 'Couldn't retrieve outbound binding for the given P/S/A values: FP=;TP=;FS=Mapping;TS=SALESFORCE_DEV;AN=;ANS=; in the current context [Unknown]. '.

    I would be very interested to know how you solve your issue as I am stuck myself!

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 03, 2013 at 02:53 PM

    Pooja,

    We have 7.31 SP03 and had several issues with performing SOAP Lookups.  We created a ticket with SAP and had to load the latest patches for both the "Adapter Framework" and "Message Component" for our SP03 level.  This resolved our problem.

    I took the code you pasted above and replaced it in our code and it works great.  So the code you have works its not that.  The only other thing it could be would be your communication channel how it was created or cache issue but any cache issues should have been resolved by now since I'm sure you have had several reboots.

    Thanks,

    Steve D

    Add comment
    10|10000 characters needed characters exceeded