cancel
Showing results for 
Search instead for 
Did you mean: 

Soap Lookup from UDF

Former Member
0 Kudos

    Dear Experts,

         I have a file to RFC Scenario in PI 7.0. where i have to call a webservice (passing 2 parameters) from mapping and

         get the values from webservice.

         Now for testing purpose i am using a webservice (add function).

         According to a thread i have created a UDF and while executing its working fine but not getting the output.

         Please see the Screen shot

            

         

                 UDF

AbstractTrace trace = container.getTrace();
String add = "";
   try {
             Channel channel =      LookupService.getChannel("BS_SOAPLOOKUP","CC_SoapLook_receiver");
SystemAccessor accessor = LookupService.getSystemAccessor(channel);
String SOAPxml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><ns0:SendDataToStorage xmlns:ns0=\"http://Test.Service.SchemaIn\"> <NUMBER1>"
+num1
+ "</NUMBER1><NUMBER2>"
+num2
+ "</NUMBER2></ns0:SendDataToStorage>";
InputStream inputStream =new ByteArrayInputStream(SOAPxml.getBytes());
   XmlPayload payload = LookupService.getXmlPayload(inputStream);
    Payload SOAPOutPayload = null;
  SOAPOutPayload = accessor.call(payload);
  InputStream inp = SOAPOutPayload.getContent();
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(inp);
NodeList list = document.getElementsByTagName("Response");
Node node = list.item(0);
if (node != null) {
node = node.getFirstChild();
if (node != null) {
add = node.getNodeValue();
}
}
} catch (Exception e) {
                   trace.addWarning("Error" + e);
               }
return add;


 
   I have created a receiver CC and Dummy Receiver Agreement.

      In the CC Monitoring showing some processing errors.

  Please suggest

Regards,

Anirban

Accepted Solutions (0)

Answers (4)

Answers (4)

monicabhosale
Active Participant
0 Kudos

Hi Anirban,

  Am facing same issue, am not getting anything in response but when i use same channel in synchronous call am getting response back from soap receiver channel.

  Can you please help me here ,how did you resolved your issue?

  With Many Thanks.

Monica

Former Member
0 Kudos

Dear Experts,

      Soap Receiver CC is working fine.

      But getting no O/P in message mapping.

      Please help me.

Regards,

Anirban

former_member184681
Active Contributor
0 Kudos

Hi Anirban,

First of all, did you check if the web service works correctly when called from an external tool like SOAP UI? If yes, then add some logic to your UDF to write processing details to log and then test again. Currently your code only supports a "happy flow". In case one of the checks e.g. if not null, is not true, your code doesn't return any value.

Regards,

Greg

Former Member
0 Kudos

Hi Greg,

    The webservice is working fine getting response fthrough soapUI.

   

    Please help me to write processing details for log.

Regards,

Anirban

Former Member
0 Kudos

Hi Anirban

We don't need any receiver agreement for calling SOAP look up. Only communication channel is needed.

Please check the SOAP channel in RWB and show us the error message you are getting in the channel.

Former Member
0 Kudos

Hi Indra,

   in cc showing this:

   

      CC    Processing Errors In the Last 24 Hours

     12/13/13 12:08:18 PM    252eaa20-63c1-11e3-9d4f-0003ba54e285   call completed

     12/13/13 12:08:18 PM    252eaa20-63c1-11e3-9d4f-0003ba54e285   request entering

   Regards,

Anirban

Former Member
0 Kudos

Hi Anirban

Please take a screen shot of the channel log from RWB and then paste it here.

The log you have pasted has nothing in it.

Former Member
0 Kudos

  Hi Indra,

      Channel is working fine now. No errors

      But while testing in Message Mapping getting no Output.

Regards,

Anirban

monikandan_p
Active Participant
0 Kudos

HI Aniban,

    kindly have a look on this below blog for your issue.

http://scn.sap.com/community/pi-and-soa-middleware/blog/2006/11/20/webservice-calls-from-a-user-defi...

Best Regards,

Monikandan.

Former Member
0 Kudos

Hi Moni,

   Thank you for your Reply.

    I also followed that link you mentioned.