If you have access to a server where you can run Java, can you even run all this?
Otherwise, as you understand, you can simply create a component with a remote function and perform this work in accordance with:
<cfcomponent output="false"> <cffunction name="runMyJava" returntype="String" output="false" access="remote"> <cfargument name="MyArg" type="String" /> <cfset var MyObj = createObject('java','whatever') /> <cfreturn MyObj.doJavaMagic( Arguments.MyArg ) /> </cffunction> </cfcomponent>
Then on your other server you will have something like ...
<cfset MyWebService = createObject('webservice','https://myotherserver/mycomponent.cfc?wsdl')/> <cfset MyString = MyWebService.runMyJava( MyString ) />
Please note that https is used in this example - because you presumably want to protect data from spanning over the Internet in plain text.
It may also be wise to restrict the IP server to a server, so you can connect to it or use other appropriate methods to protect it.
Peter Boughton
source share