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的写法一摸一样,只是路径是配出来的。
我亲自试了试,没有问题!!
大家如有问题,可以一起讨论一下
立即学习“PHP免费学习笔记(深入)”;
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号