Quantcast
Channel: SCN: Message List - Software Support and Maintenance
Viewing all articles
Browse latest Browse all 2823

Message staying in Delivering state - SOCKET in SAP PI Mapping

$
0
0

Hi All,

Please help me in solving this situation.

 

Interface in brief:

PROXY SAP PI (SOCKET in mapping) PROXY

 

Proxy sents three fields - Data, Host, Port and Socket UDF will check for that data in the corresponding host and port and returns only the data, if available, to target proxy.

UDF has all the three fields as input and output one field.

 

Issue in brief:

Here we observed a weird behavior.

The socket is able to connect to the target client server only went their IP is similar to SAP PI. Like, PI java server is on 3.xxx and the socket lookup is successful when ever client IP starts with 3.xxx and fails for IP 10.xxx. There is no error infact, the messages status is delivering.

 

We are clueless as we dont have any error logs. We had multiple discussion with Network team but no proper solution.

 

Please provide your suggestions in improvising the socket code or any other suggestions to idenfify the issue cause. Here am including the code:

 

              String responseMessage = "";

              InputStream in = null;

              OutputStream out = null;

              Socket socket = null;

              StringBuffer s = new StringBuffer();

            

 

     int ch;

     try

              {

                     int sz = requestMessage.length();

                      

                     if (sz < 1)

                     {

                       return null;

                     }

                    

                     socket = new Socket (instance, port);

                     socket.setSoLinger(true, 500);

                    

                     in = new BufferedInputStream(socket.getInputStream(), 10000);

                     out = new BufferedOutputStream(socket.getOutputStream(), 10000);

                    

                     out.write(requestMessage.getBytes(), 0, sz);

                     out.flush();

                      

                     while ((ch = in.read()) != -1)

                     {

                           s.append((char)ch);

                           if ( ch <= 0 ) break;

                     }

                    

                     responseMessage =  s.toString();

                      

                     in.close();

                     out.close();

                     socket.close();

                    

                     return responseMessage;

              }

              catch(IOException e)

              {

                                                       //     return "Exception while reading from server";

System.out.println("Exception while reading from server");

e.printStackTrace();

}

         

             

return null;

 

Thanks & Regards,

Naveen Kumar M


Viewing all articles
Browse latest Browse all 2823

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>