Connection between WebServices (JAVA - Jersey) With PHP client
Get the solution ↓↓↓Solution:
It does not matter which implementation is used on the server side if you are implementing the client, as long as you are both using the same technology.
In your case, as you haven't said that, but speaking of Jersey, it's about RESTful webservices. Trying to say it in one sentence, with restful webservices you (not necessarily, but usually) request a resource via HTTP, let's say a book at Amazon's webservice by providing an URL to that resource.
So all you basically have to do is executing an HTTP GET operation to said resource and process the format of the answer (e.g. a JSON object).
I don't know what you searched for, but if you google for php and restful werbservice client, you'll certainly find more than you need.
Answer
Solution:
I have the solution! thanks to stackoverfow and much other sites, and a partner, look this:
**curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json; charset=utf-8","Accept:application/json, text/javascript, */*; q=0.01"));**
**$postargs = array('user' => 'user', 'pass' => 'pass');**
**json_encode($postargs);**
This saved my life!!
Thanks guys!
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: constant expression contains invalid operations
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.