Retrieve Service Information (SOAP)

SOAP API Reference

Retrieve Service Information (SOAP)

 

GetServiceInformation

The GetServiceInformation operation provides information about the services that are available to a specific Service Key. This operation should be automatically invoked during initial application configuration, and manually by an application administrator if/when available services are updated.

 

Operation

ServiceInformation GetServiceInformation(string sessionToken);

 

Parameters

Parameter Data Type Description
sessionToken String The limited-life token used to authenticate to CWS.

 

Return Type

Data Type Description
ServiceInformation Contains information about the features, workflows, and operations associated with all available services for a specific Service Key.

 

Exceptions

CWSFault AuthenticationFault
ExpiredTokenFault CWSServiceInformationUnavailableFault
InvalidTokenFault
For additional details about each fault, refer to Service Information Faults in the CWS Developer API Reference.

 

Code Snippets

public ServiceInformation GetServiceInformation(string sessionToken)
{
  using (var client = new CWSServiceInformationClient(ConfigurationManager.AppSettings["Bindings.StsSoap"]))
  {
    try
    {
      return client.GetServiceInformation(sessionToken);
    }
    catch (FaultException ex)
    {
      SoapFaultHandler.HandleFaultException(ex);
    }
  }
};

 

public function getServiceInformation()
{
  if (! $this->signOn ())
    return false;
  try
  {
    $si = new GetServiceInformation ();
    $si->sessionToken = $this->session_token;
    $response = $this->serviceInfo->GetServiceInformation ( $si );
    if ($response)
    //echo $this->serviceInfo->__getLastResponse();
    //return $response->GetServiceInformationResult->BankcardServices->BankcardService;
    return $response->GetServiceInformationResult;

  }
  catch ( SoapFault $e )
  {
    echo 'SERVER ERROR: Error Retrieving Service Information.
';
    $xmlFault = $this->serviceInfo->__getLastResponse ();
    $errors = handleSvcInfoFault ( $e, $xmlFault );
    echo $errors;
    exit ();
  }
}

// Return only the ServiceId

public function getServiceID()
{
  $response = $this->getServiceInformation ();
  if ($response)
  //return $response->GetServiceInformationResult->BankcardServices->BankcardService->ServiceId;
  return $response->GetServiceInformationResponse;
  return false;
}

 

Back to the top