0

I'm trying to connect to a 3rd party server that requires a TCP/IP socket connection and uses JSON-RPC to communicate. I need to use ColdFusion 9 and am wondering if the built in event gateways in CF are the way forward?

All the examples I have found so far are event listeners but I can't find any help or examples to show me how to communicate with the 3rd party server I need to communicate with. Does anyone know of any libraries or examples I can look at to achieve the above. Should I be looking at utilising Java?

Shaun Perry
  • 159
  • 1
  • 2
  • 12
  • 1
    You might want to add a little more detail on your use-case. Are you looking to only MAKE requests, or to receive connections from this 3rd party service? Are you looking to make synchronous calls to the service (i.e. are you expecting to take a browser-based request to your own app, make a request to the 3rd party service, then send something based on the results back to the browser in the response)? – barnyr Oct 28 '14 at 11:34
  • I would be looking to do MAKE requests to request information from the API. I would be looking to do as you suggested, I would like the user to be able to request info from the 3rd party service and then display or interact with it in the browser. – Shaun Perry Oct 28 '14 at 12:59
  • 1
    In which case, I suspect Event gateways are not the way to go, as they're mainly concerned with other sources of event, other than page requests. I've taken a quick looksee at Java projects for JSON-RPC and most concentrate on client-server communications (where client is the browser) rather than server-server comms (as you're trying to do). Would it be possible to have the client make the request and process the results? Some of the difficulties in dealing with socket comms in CF are discussed here: http://stackoverflow.com/questions/8828363/simple-tcp-ip-socket-communication-using-coldfusion – barnyr Oct 28 '14 at 13:11
  • 1
    If you cannot process things in the client, I would look at implementing something in Java which makes the connection, sends the request, waits for the response, processes that and returns it to the CF code. You'll have to handle timeouts too. I think that would be completely do-able. – barnyr Oct 28 '14 at 13:13
  • Thanks Barnyr, it does sound like using a java JSON-RPC or something similar might be the way forward. I appreciate your advice. – Shaun Perry Oct 28 '14 at 13:31

0 Answers0