cancel
Showing results for 
Search instead for 
Did you mean: 

sending and receiving data to and from a TCP IP socket!

Former Member
0 Kudos

Hi Experts,

We are searching for the best solution of PI integration with a legacy system which receives and send data only through sockets.

After going through some of the blogs where we can connect to a sockets using java api, I was wondering, which is the best way to do it.

1. Java proxy

2. Adapter module

3. Java mapping

Our requirements are like:

For inbound : legacy system will write the data through socket and Pi need to read the data from socket and send it to R3 via idoc.

For outbound: R3 will generate idocs and Pi will convert the idoc into flat files and send it to socket(port).

Any suggestions will be helpful!

Thanks

Navneet.

Accepted Solutions (0)

Answers (1)

Answers (1)

anupam_ghosh2
Active Contributor
0 Kudos

Hi Navneet,

                     Please check this blog http://scn.sap.com/people/saravanakumar.kuppusamy2/blog/2005/12/15/socket-integration-with-xi

Please kindly rate the blog if you find it useful. Now coming to your question , from you description it appears that the case is a async scenario

ECC--proxy---Pi---java mapping-----> write to socket----->send back response to ECC that the data was written properly or there was an error. Thus although sceanrio is async still converting it to sync, so that ECC knows if the socket writing was successful or not.

For the scenario when the legacy system tries to write to Pi server. Then we need a java/c code to write a  server program. This program runs all the time in the PI server. The server code will wait for request from legacy system on a specific port. Once a request comes it creates a file in a specific directory. There is a file to proxy/idoc scenario a sender file channel reads the file and sends the content to ECC. Thus only server code needs to be written for this.

In case you need further reference omn how to write the server code please check the folowing link

http://systembash.com/content/a-simple-java-tcp-server-and-tcp-client/

Let me know if you need further help on the scenario.

Regards

Anupam