简体   繁体   English

如何在PHP和Java WebService之间进行交互

[英]How to interact between php and java webservice

I have tried to create Restful Web service using java and netbeans. 我试图使用java和netbeans创建Restful Web服务。 I have run 'Test RESTful web service' and everything are ok. 我已经运行“测试RESTful Web服务”,一切都OK。 But i want to access, the webservice that i have made, using php or codeigniter, how to retrieve content or put content. 但是我想使用php或codeigniter访问我制作的Web服务,如何检索内容或放置内容。 I have problem with this. 我有这个问题。 I have try like this in my controler. 我已经在控制器中尝试了这种方法。

 file_get_contents('http://localhost:8080/akunKu/resources/db.akun.akkelompokakun'); 

yes it show content, but where i should put parameter. 是的,它显示内容,但是我应该在哪里放置参数。 Thanks. 谢谢。

Use the cURL extension.. usually available on all professional web hosts. 使用cURL扩展名..通常可在所有专业网络主机上使用。

Or use NuSphere's NuSoap classes (http://www.nusphere.com/php_script/nusoap.htm) 或使用NuSphere的NuSoap类(http://www.nusphere.com/php_script/nusoap.htm)

2nd one is even more easier I believe. 我相信第二个要容易得多。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM