CourseSales.com Web Services - SOAP (deprecated)

Monday, Sep 23, 2013

The SOAP integration is deprecated, please use REST instead

Authentication

Before you can consume SOAP services you must create a user:

  1. Log into CourseSales.com.

  2. Select Setup on the top row of the Ribbon

  3. Select the large Logins icon

  4. A user with the username soap is usually created when a CourseSales.com account is first set up - see if you can find this user, and click the Edit icon. If there is no soap user then click New on the Ribbon to create a new user. (Note, if you end up with two soap users you may have problems later).

  5. Make sure the user has a valid username, that a password has been set (you will need this password later), and that the user has Status of Active. Also make sure the CourseSales.com Internal Type is Soap.

  6. Save the record.

WSDL

The CourseSales.com WSDL can reached at:

https://[yoursubdomain].coursesales.com/soap/index?wsdl=1

You are not required to login to access the WSDL.

Service Call

Configure your SOAP client to use SOAP 1.2. We recommend you enable compression.

The location / URI is:

https://[yoursubdomain].coursesales.com/soap/index

The function you should call is processRequest.

processRequest accepts an array as its only parameter, and the function returns an array.

You must specify login details in the request, by adding them to the lowest level of the array:

eg in PHP this would be:

$parameters = array();
$parameters['LoginUsername'] = 'yourSoapUsername';
$parameters['LoginPassword'] = 'yourSoapPassword';

Worked example for PHP using the WSDL

$soapParameters = array();

$soap = new SoapClient( 'https://[yoursubdomain].coursesales.com/soap/index?wsdl=1', $soapParameters );

$parameters = array();
$parameters['LoginUsername'] = 'yourSoapUsername';
$parameters['LoginPassword'] = 'yourSoapPassword';

return $soap->processRequest( $parameters );

Worked example for PHP without using the WSDL

$soapParameters = array ( );
$soapParameters[ 'location' ] = 'https://[yoursubdomain].coursesales.com/soap/index';
$soapParameters[ 'uri' ] = 'https://[yoursubdomain].coursesales.com/soap/index';
$soapParameters[ 'compression' ] = SOAP_COMPRESSION_ACCEPT;
$soapParameters[ 'trace' ] = true;
$soapParameters[ 'soap_version' ] = SOAP_1_2;

$soap = new SoapClient( null, $soapParameters );

$parameters = array();
$parameters['LoginUsername'] = 'yourSoapUsername';
$parameters['LoginPassword'] = 'yourSoapPassword';

return $soap->processRequest( $parameters );