CodeIgniter Web Services Client CodeIgniter Web Services Client codeigniter codeigniter

CodeIgniter Web Services Client


It looks as if your webservice is using SOAP (simple object access protocol). This is not REST. You'll want to use PHP's built in Soap extension with the SoapClient class. This way it's easy to post a XML "request" to that page which will return xml results rather than a html view (I assume).

  1. Check Soap the soap extension is loaded on your server
  2. Read about the SoapClient http://php.net/manual/en/class.soapclient.php
  3. See if that webservice offers a WSDL (web service description language) file.
  4. Create an instance of a soap client, using the wsdl and call the function you require.

Simple example from PHP.net

$client = new SoapClient("http://localhost/code/soap.wsdl");$something =  $client->HelloWorld(array());echo $something->HelloWorldResult;


To get a xml response, you do not need Codeigniter. Specifically it provide WSDL. At http://services.insw.go.id/web-services/nsw you can find the example as

String wsdlUrl = "http://services.insw.go.id:80/web-services/nsw?WSDL";

So the WSDL API would be http://services.insw.go.id:80/web-services/nsw?WSDL

Then you can check this page to see how to install soap for your php.

Then you can get a xml response by the following code:

$client = new SoapClient('http://services.insw.go.id:80/web-services/nsw?WSDL');//var_dump($client->__getFunctions()); $response = $client->getListGA();echo $response;

these code do not need Codeigniter.

Note: $client->__getFunctions() will show you all functions that the WSDL support and the parameters the functions need.

Good luck