A-Select web service
The A-Select web service is a web service implementation of the A-Select Server 1.5 protocol.
Supported standards
The A-Select web service supports the following standards:
- Web Service Description Language (WSDL), version 1.1 and 2.0
- Simple Object Access Protocol (SOAP), version 1.1 and 1.2
Usage
The first step in using the service is to obtain the WSDL file which describes the service its interface. This file can be retrieved by accessing the following URL of the OpenASelect Server:
https://[host name and port]/openaselect/services/aselect-ws?wsdl
The interface is based on the A-Select protocol with the following differences:
- The authenticate response is simplified by returning the constructed redirect URL as one parameter.
- The verify_credentials request is renamed to verifyCredentials.
- The service may force the app_id parameter in the verify credentials call (when configured, omitting this parameter results in an invalid request error).
The WSDL information can be used to perform the following method calls in the programming language of your choice:
- authenticate
- verifyCredentials
Code example
The following code snippets demonstrate the usage of the OpenASelect Webservice in PHP.
1 Create a web service client:
$oaWSDLURL = "https://localhost/openaselect/services/aselect-ws?wsdl"; $client = new SoapClient($oaWSDLURL, array("trace" => 1, "exceptions" => 0));
2 Send the authenticate call and redirect user:
//Send authenticate $params = array( 'a-select-server' => "oa", 'app_id' => "app1", 'app_url' => "https://localhost/app1/", 'forced_logon' => false, ); $response = $client->authenticate($params); if($response->as_url != null) { //redirect to OA Server header("HTTP/1.1 307 Temporary Redirect"); header("Location: " . $response->as_url); exit(); } else { //Error handling... }
3 Retrieve the credentials and session id from request parameters and send the verify call:
//Retrieve $rid and $credentials from user request... //send verifyCredentials $params = array( 'a-select-server' => "oa", 'app_id' => "app1", 'rid' => $rid, 'aselect_credentials' => $credentials, ); $response = $client->verifyCredentials($params); $result = $response->result_code; switch($result) { case "0000": { //Okay... break; } case "0040": { //User cancelled... break; } default: { //Error handling... } }
