[eluser]Unknown[/eluser]
I’ve created a sort of pseudo-library for the NuSoap PHP Library… It basically works as a NuSoap loader.
File structure:
application
|
|--libraries
|
|--Nusoap_core.php
|--Nusoap.php
Where Nusoap_core.php is the original Soap Library from Sourceforge, and Nusoap is my library class that looks like this:
Code:
<?php
//exit if direct access attempted
if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* NuSoap Loader for the Code Igniter Framework
*
* Currently Only Supports a client in Proxy mode.
*
* Usage: (from inside any CI controller or model)
* $this->load->library('Nusoap');
* $proxy = $this->nusoap->getProxy('wsdl_url');
*
* @author slynn1324
* Last Modified : 06-27-2007
*/
class Nusoap
{
/**
* @name Nusoap
* @return Nusoap
*
* Constructor, loads the nusoap_core package.
* Note: Nusoap_core.php is a copy of nusoap.php,v 1.108 2007/06/22 19:38:44
* from Sourceforge CVS
*
*
*/
function Nusoap()
{
/* Import The Base Nusoap Package */
require_once('Nusoap_core.php');
}
/**
* @name getProxy
* @param $wsdl_url - URL of Web Service wsdl
* @return NuSoap Proxy
*
* Returns a proxy for the Web Service at the specified wsdl url
*/
function getProxy($wsdl_url)
{
$soapClient = new nusoap_client($wsdl_url, 'wsdl');
return $soapClient->getProxy();
}
}
?>
This is just a simple library at this point that will only return a proxy to the web service with the given wsdl location, however, it should be very easy to expand.