|
Posted by Michael Placentra II on 04/23/07 21:11
Here's a basic idea of how to use NuSOAP:
$ns = 'https://name/space/here!!!';
$nusoap = new soapclient( $ns, true );
$nusoap->soap_defencoding = 'UTF-8';
$nusoap->setHeaders( '<...>...headers here!!!...</...>' );
$response = $nusoap->call( 'command', '<...>...data here!...</...>', $ns );
Then $response will be an associative array of whatever data was
returned. You should also be checking for errors after each action with
a function like this:
function errorCheck( $nusoapObj )
{
if( $soapObj->fault )
{
trigger_error( "{$soapObj->faultstring}: {$soapObj->faultdetail}",
E_USER_ERROR );
}
$clientError = $soapObj->getError();
if( $clientError )
{
trigger_error( $clientError, E_USER_ERROR );
}
}
$nusoap = new soapclient( $ns, true );
errorCheck( $nusoap );
Navigation:
[Reply to this message]
|