Detailed PHP samples are available as part of the Sample Client Install . Requirements will vary depending upon the integration approach. (SOAP Extensions, NuSoap).

There are several ways of integrating Web service calls from PHP.

Soap Extensions

In order to use Concord Outbound Fax Delivery Web services using Soap Extensions, you will need to enable the following PHP extensions

  • php_soap

  • php_openssl

Using soap extensions Code

 Copy imageCopy
<?php

// This sample is using the built in SoapClient library available in PHP5.
// See http://www.php.net/manual/en/class.soapclient.php for more details

$userid = "UserIdHere"; // Username supplied to you by Concord
$password = "PinHere"; // Password supplied to you by Concord
$recipientname = "Test"; // Recipient of the fax
$faxnumber = "FaxNumberHere"; // Full Fax number to fax to . NA numbers should start with a '1'
$faxfilename = "Default.tif"; // Fax file to fax

// SoapClient variable
$soapClient;

// URL of WSDL File
$wsdl_url = "https://ws.concordfax.com/fax/v5/faxws.wsdl";


// Create SoapClient options
$options = array(
                'trace' => TRUE, 
                'exceptions' => TRUE,
                'cache_wsdl' => WSDL_CACHE_BOTH
                );


print "Requesting SimpleSendFax for FaxNumber: $faxnumber\n";
print "\n\n";
flush();

try
{
        print "Creating instance of SoapClient\n\n";
        flush();
        $soapClient = new SoapClient($wsdl_url, $options);
}
catch(Exception $ex)
{
        print "Error while setting up constructor\n\n";
        print_r($ex);
        return;
}

try
{        
        print "Calling SimpleSendFax\n\n";
        flush();
        $fax_res = $soapClient->SimpleSendFax
        (
                array
                (
                        'UserID' => $userid,
                        'strPIN' => $password,
                        'RecipientName' => $recipientname,
                        'FaxNumber' => $faxnumber,
                        'TIFFJobFile' => file_get_contents($faxfilename)
                )
        );                                                                                                                                                                                                                    

        print "--- Returned Information ---\n\n";

        //Method call result
        // 0 = Failed 1 = Success
        print "\nWeb Service Return Code: $fax_res->return \n";
}
catch(Exception $ex)
{
        print "Error while issuing SimpleSendFax\n\n";
        print_r($ex);
        return;
}

?>

See Also