View Single Post
Old 03-22-2013, 02:54 AM  
blackmonsters
Making PHP work
 
blackmonsters's Avatar
 
Industry Role:
Join Date: Nov 2002
Location: 🌎🌅🌈🌇
Posts: 20,620
The best heads up I can give you is :

"Don't use SOAP unless you are washing your ass".

But until then, use this class I wrote :

PHP Code:
class soapsender {

  function 
send($params) {

    require_once(
'nusoap-0.9.5/lib/nusoap.php');

    
$this_php_version phpversion();

try {


    if ( (
$this_php_version >= "5.1") && ($this_php_version "5.2") ) {
        
// PHP version: 5.1.6 works 

        /**********************************************************************
            Use nusoap-0.9.5 for php version less then 5.2
        **********************************************************************/
        


        
ini_set("soap.wsdl_cache_enabled""0");
        
$soapclient = new SoapClient('http://domain.com/wsdl',true);
        
$soapclient->response_timeout 600// Set read timeout to 10 minutes
    
        
$result $soapclient->call('send', array('request' => $params));


    } 
//endif

    
if ( ($this_php_version >= "5.2") && ($this_php_version "5.3") ) {

        
// PHP version: 5.2.17 works

        
ini_set("soap.wsdl_cache_enabled""0");

        
$client = new SoapClient("http://domain.com/wsdl");
        
$result $client->send($params);




    } 
//endif


    
if ($this_php_version >= "5.3")  {

        
ini_set("soap.wsdl_cache_enabled""0");

        
$client = new SoapClient('http://domain.com/wsdl',
        array(
'default_socket_timeout'=>'600'));

        
$result $client -> __soapCall('send', array('request' => $params));

    }



 } catch (
SoapFault $exception) {

    return 
"error";      

  }


    return 
$result;


   } 
//end function





Call the class like this :

PHP Code:
$params = array('stuff'=>$stuff,'morestuff'=>$morestuff);

$soapsender = new soapsender();
$result $soapsender->send($params); 
* Download the nusoap file first : http://sourceforge.net/projects/nuso.../nusoap/0.9.5/


That's all the time I can spend on this though.
blackmonsters is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote