{
  safe: (val) => (val != null ? '' + val : ''),
  soap_action: (iface, method) => 'http://tempuri.org/YSI.Interfaces.WebServices/ysi' + iface + '/' + method,
  endpoint_url: (base, iface) => base + iface + '.asmx',
  auth_xml: (username, password, server_name, database, interface_entity, interface_license) =>
    '<UserName>' + username + '</UserName>' +
    '<Password>' + password + '</Password>' +
    '<ServerName>' + server_name + '</ServerName>' +
    '<Database>' + database + '</Database>' +
    '<Platform>SQL Server</Platform>' +
    '<InterfaceEntity>' + interface_entity + '</InterfaceEntity>' +
    '<InterfaceLicense>' + interface_license + '</InterfaceLicense>',
  envelope: (iface, method, auth_xml, params_xml) =>
    '<?xml version="1.0" encoding="UTF-8"?>' +
    '<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://tempuri.org/YSI.Interfaces.WebServices/ysi' + iface + '" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">' +
    '<env:Body>' +
    '<wsdl:' + method + '>' +
    auth_xml +
    params_xml +
    '</wsdl:' + method + '>' +
    '</env:Body>' +
    '</env:Envelope>'
}
