Home  >  Article  >  Java  >  PHPRPC for Java Spring的事例

PHPRPC for Java Spring的事例

PHP中文网
PHP中文网Original
2017-05-26 14:32:443098browse

  PHPRPC for Java Spring的例子
1.需要在web.xml中配置

2. 配置spring

第二步配置好后,在地址栏中键入"localhost:8080/项目名/phprpc/appservice.jspx"就得到类似下图的结果。如果现实,配置成功

前两步成功后,我们看看该如何使用:

 // 调用时的写法
        PHPRPC_Client client = 
new
 PHPRPC_Client("http://localhost:8090/项目名称/phprpc/appservice.jspx");
        ApplicationServer appServer = (ApplicationServer) client.useService(ApplicationServer.
class
);
        appServer.register(username, passw
ord
);   //

要调用的方法

和不用spring的写法一摸一样,只是路径是配出来的。

 我亲自试了试,没有问题!!
 大家如有问题,可以一起讨论一下 PHPRPC for Java Spring的事例  

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact [email protected]