PHP/Java Bridge. How to connect from php server to desktop App -


i'm testing php/java bridge connection. , have simple example yet. php file is:

require_once("http://localhost:8087/javabridge/java/java.inc"); $world = new java("helloworld"); echo $world->hello(array("from php")); 

and java file:

import javax.swing.joptionpane;  public class helloworld {   public static final string javabridge_port="8087";   static final php.java.bridge.javabridgerunner runner =      php.java.bridge.javabridgerunner.getinstance(javabridge_port);    public static void main(string args[]) throws exception {     runner.waitfor();     system.exit(0);   }   public void hello(string args[]) throws exception {     joptionpane.showmessagedialog(null, "hello " + args[0]);   } } 

everything works fine on 1 pc. have implement connection php server java desktop application on server not on localhost, "localhost:8087/javabridge/java/java.inc" won't work. in future java app print on printer data php website. need call java function remotely. should desktop app because write usb connection in future. please me, thanks.

you can't use require_once include files host.

if option available, lot of websites @ risk.

why don't use way, here points may help:

  1. make java calls php.
  2. write result file in destination server.
  3. make server reads file.

if don't that, please read web service, may have need.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -