Getting Started

Access to the TalentLink web services is restricted to TalentLink clients.  When the service is activated for you, you will be provided with the following :

  • Username
  • Password
  • API Key
  • The URL to the web service

You will need all four items for every request that you make.

The roles and rights that have been assigned to the user account determine which data and functions are accessible. The API key restricts access to a single bundle.

In the examples below, the following assumptions have been made :

  • UserName : THubUser
  • Password : Password1234
  • API Key :  dabc4dvptajdnrhwnqsf6dnz
  • URL :

Obviously you will need to substitute the example values with your own.

Making a SOAP Request

The URL for a SOAP request is in the format[BundleName]/SOAP/[ServiceName]?api_key=[Your api key].

Therefore to make a request to the Position web service within the HRIS bundle, the full URL would be

Each SOAP request uses WS-Security, meaning that the SOAP header should look like :

  <wsse:Security xmlns:wsse="">
  <wsse:UsernameToken wsu:Id="UsernameToken-3" xmlns:wsu="">
  <wsse:Password Type="">Password1234</wsse:Password>

If you are developing using Visual Studio, you may encounter problems if you add a service reference. Visual Studio automatically adds some headers which are incompatible with WS-Security. The code samples below in VB.Net and C# are a solution for this problem.

The method that you wish to call, along with any parameters, goes into the body of the message. To call the getPositionById method which takes a parameter of "id", the SOAP body would look like :


The full request therefore would be :

  <soap:Envelope xmlns:soap="" xmlns:ws="">
  <wsse:Security xmlns:wsse="">
  <wsse:UsernameToken wsu:Id="UsernameToken-3" xmlns:wsu="">
  <wsse:Password Type="">Password1234</wsse:Password>

Code Samples


  Private Sub PostToTalentHub(m_URL as String)

  'Create a request object
  Dim request As Net.HttpWebRequest = Net.WebRequest.Create(m_Url)
  request.ContentType = "text/xml;charset=""utf-8"""
  request.Method = "POST"
  request.Headers.Add("SOAPAction", """""")
  request.Headers.Add(HttpRequestHeader.AcceptEncoding, "gzip,deflate")

  Dim m_PostMsg As String = ""
  ' This is where you need to build the SOAP message
  'm_PostMsg = "<soap:Envelope " etc. ........

  Dim objStream As New System.IO.StreamWriter(request.GetRequestStream(), System.Text.Encoding.UTF8)
  objStream = Nothing

  Dim objHTTPRes As HttpWebResponse
  objHTTPRes = request.GetResponse()
  Dim SourceStream As IO.Stream = objHTTPRes.GetResponseStream()

  'It's up to you how you save the response
  'You could save it as an XML document
  Dim objXML As New System.Xml.XmlDocument()

  'Or you could save it to a String
  Dim ret As String
  Dim sr As System.IO.StreamReader = New IO.StreamReader(SourceStream)
  ret = sr.ReadToEnd

  End Sub



  private void PostToTalentHub(string m_URL)
  //Create a request object
  System.Net.HttpWebRequest request = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(m_URL);
  request.ContentType = "text/xml;charset=\"utf-8\"";
  request.Method = "POST";
  request.Headers.Add("SOAPAction", "\"\"");
  //request.Headers.Add(HttpRequestHeader.AcceptEncoding, "gzip,deflate");
  request.AutomaticDecompression = DecompressionMethods.GZip
  string m_PostMsg = "";
  // This is where you need to build the SOAP message
  //m_PostMsg = "<soap:Envelope " etc. ........

  System.IO.StreamWriter objStream = new System.IO.StreamWriter(request.GetRequestStream(), System.Text.Encoding.UTF8);
  objStream = null;

  HttpWebResponse objHTTPRes = default(HttpWebResponse);
  objHTTPRes = (HttpWebResponse)request.GetResponse();
  System.IO.Stream SourceStream = objHTTPRes.GetResponseStream();

  //It's up to you how you save the response
  //You could save it as an XML document
  System.Xml.XmlDocument objXML = new System.Xml.XmlDocument();

  //Or you could save it to a String
  string ret = null;
  System.IO.StreamReader sr = new System.IO.StreamReader(SourceStream);
  ret = sr.ReadToEnd();




  class TLK_SOAP
  private $_apiKey = 'API KEY'; // API Key
  private $_wsEndPoint = ""; // end point for WS
  private $_wsUsername = "UserName"; // username for WS
  private $_wsPassword = "PWD"; // password for WS
  private $_wsSecurityNS = "";
  public $ws = null; // holder of web service for future calls

  function __construct(array $config)
  $soap_Username = new SoapVar($this->_wsUsername, XSD_STRING, NULL, $this->_wsSecurityNS, NULL, $this->_wsSecurityNS);
  $soap_Password = new SoapVar($this->_wsPassword, XSD_STRING, NULL, $this->_wsSecurityNS, NULL, $this->_wsSecurityNS);
  $soap_Auth = new WSSEAuth($soap_Username, $soap_Password);
  $soapVar_Auth = new SoapVar($soap_Auth, SOAP_ENC_OBJECT, NULL, $this->_wsSecurityNS, 'UsernameToken', $this->_wsSecurityNS);
  $soap_Auth_Token = new WSSEToken($soapVar_Auth);
  $soapVar_Auth_Token = new SoapVar($soap_Auth_Token, SOAP_ENC_OBJECT, NULL, $this->_wsSecurityNS, 'UsernameToken', $this->_wsSecurityNS);
  $soapVar_Security = new SoapVar($soapVar_Auth_Token, SOAP_ENC_OBJECT, NULL, $this->_wsSecurityNS, 'Security', $this->_wsSecurityNS);
  $soapVar_Header = new SoapHeader($this->_wsSecurityNS, 'Security', $soapVar_Security, true, "TlkPrincipal");
  $this->ws = @new SoapClient($this->_wsEndPoint . '?wsdl');
  $this->ws->__setLocation($this->_wsEndPoint . '?api_key=' . $this->_apiKey);
  catch (Exception $e)
  echo $e->getMessage();

  // additional classes to facilitate WSSE addition to standard SOAP for PHP
  class WSSEAuth
  private $Username;
  private $Password;

  function __construct($username, $password)
  $this->Username = $username;
  $this->Password = $password;

  class WSSEToken
  private $UsernameToken;

  function __construct ($token)
  $this->UsernameToken = $token;


Useful Tools for Testing

SOAP Ui - A free tool for testing calls to SOAP web services. (