I have never done this before, so I'm completely in the dark. I am using PHP and I need to call a SOAP service running on a remote server that answers the call with a status code. How exactly am I calling? The service runs on a specific ip / port and has a name, namely: http://1.2.3.4:1000/ServiceName?1234 , where 1234 is the parameter that I pass, and for which I expect a response from the service.
Please give me some recommendations, thanks!
Assuming you have allow_url_fopenon (usually true), it might be as simple as ...
allow_url_fopen
$response = file_get_contents('http://1.2.3.4:1000/ServiceName?1234');
For very simple sets of request / response, you can basically do
- "", , , , cookie .., cURL, .
If this is a SOAP / WSDL-based web service, you should study the SoapClient classes as they will basically do the majority for you.
Otherwise, you can use a basic call file_get_contentsto capture the web service response in a string.
file_get_contents
This, obviously, will work only if you execute the request GET, for POSTand additional requirements see cURL .
GET
POST