Skip to content

Using nusoap with CI

Derek Jones edited this page Jul 4, 2012 · 7 revisions

Category:Approaches This is how I used the nusoap client library within CI.

First I download nusoap:

[url]http://sourceforge.net/project/downloading.php?group_id=57663&use_mirror=internap&filename=nusoap-0.7.3.zip&12547277;[/url]

I opened the zip file (nusoap-0.7.3.zip) and copied the lib folder to my [i]application/libraries[/i] folder.

I renamed the lib folder: [quote]application/libraries/[strong]lib[/strong][/quote] to [quote]application/libraries/[strong]nusoap[/strong][/quote]

Now I have a function in my controller called [color=green]soap_test[/color].

Code:

class MyController extends Controller {
     function test_soap(){
         require_once(APPPATH.'libraries/nusoap/nusoap'.EXT); //includes nusoap
         // Same as application/libraries/nusoap/nusoap.php
         $n_params = array('name' => 'My Name', 'email' => '[email protected]');
         $client = new nusoap_client('http://server.com/soap/server.php');
         $result = $client->call('soapMethod', $n_params);
         echo $result;
     }
}

Clone this wiki locally