var os = require('os');
if (os.platform() == 'win32') {
if (os.arch() == 'ia32') {
var chilkat = require('@chilkat/ck-node21-win-ia32');
} else {
var chilkat = require('@chilkat/ck-node21-win64');
}
} else if (os.platform() == 'linux') {
if (os.arch() == 'arm') {
var chilkat = require('@chilkat/ck-node21-arm');
} else if (os.arch() == 'x86') {
var chilkat = require('@chilkat/ck-node21-linux32');
} else {
var chilkat = require('@chilkat/ck-node21-linux64');
}
} else if (os.platform() == 'darwin') {
if (os.arch() == 'arm64') {
var chilkat = require('@chilkat/ck-node21-mac-m1');
} else {
var chilkat = require('@chilkat/ck-node21-macosx');
}
}
function chilkatExample() {
var xml = new chilkat.Xml();
xml.Tag = "soapenv:Envelope";
xml.AddAttribute("xmlns:soapenv","http://schemas.xmlsoap.org/soap/envelope/");
xml.AddAttribute("xmlns:tra","http://training.gov.au/services/12/");
xml.UpdateChildContent("soapenv:Header","");
xml.UpdateChildContent("soapenv:Body|tra:GetDetails|tra:request|tra:Code","string");
xml.UpdateChildContent("soapenv:Body|tra:GetDetails|tra:request|tra:IncludeLegacyData","true");
xml.UpdateChildContent("soapenv:Body|tra:GetDetails|tra:request|tra:InformationRequested|tra:ShowCodes","true");
xml.UpdateChildContent("soapenv:Body|tra:GetDetails|tra:request|tra:InformationRequested|tra:ShowContacts","true");
xml.UpdateChildContent("soapenv:Body|tra:GetDetails|tra:request|tra:InformationRequested|tra:ShowDataManagers","true");
xml.UpdateChildContent("soapenv:Body|tra:GetDetails|tra:request|tra:InformationRequested|tra:ShowExplicitScope","true");
xml.UpdateChildContent("soapenv:Body|tra:GetDetails|tra:request|tra:InformationRequested|tra:ShowImplicitScope","true");
xml.UpdateChildContent("soapenv:Body|tra:GetDetails|tra:request|tra:InformationRequested|tra:ShowLocations","true");
xml.UpdateChildContent("soapenv:Body|tra:GetDetails|tra:request|tra:InformationRequested|tra:ShowOrganisatoinRoles","true");
xml.UpdateChildContent("soapenv:Body|tra:GetDetails|tra:request|tra:InformationRequested|tra:ShowPostalAddresses","true");
xml.UpdateChildContent("soapenv:Body|tra:GetDetails|tra:request|tra:InformationRequested|tra:ShowPrincipalAddresses","true");
xml.UpdateChildContent("soapenv:Body|tra:GetDetails|tra:request|tra:InformationRequested|tra:ShowRegistrationManagers","true");
xml.UpdateChildContent("soapenv:Body|tra:GetDetails|tra:request|tra:InformationRequested|tra:ShowRegistrationPeriods","true");
xml.UpdateChildContent("soapenv:Body|tra:GetDetails|tra:request|tra:InformationRequested|tra:ShowRegulatoryDecisions","true");
xml.UpdateChildContent("soapenv:Body|tra:GetDetails|tra:request|tra:InformationRequested|tra:ShowResponsibleLegalPersons","true");
xml.UpdateChildContent("soapenv:Body|tra:GetDetails|tra:request|tra:InformationRequested|tra:ShowRestrictions","true");
xml.UpdateChildContent("soapenv:Body|tra:GetDetails|tra:request|tra:InformationRequested|tra:ShowRtoClassifications","true");
xml.UpdateChildContent("soapenv:Body|tra:GetDetails|tra:request|tra:InformationRequested|tra:ShowRtoCricosCodes","true");
xml.UpdateChildContent("soapenv:Body|tra:GetDetails|tra:request|tra:InformationRequested|tra:ShowRtoDeliveryLocation","true");
xml.UpdateChildContent("soapenv:Body|tra:GetDetails|tra:request|tra:InformationRequested|tra:ShowRtoDeliveryNotification","true");
xml.UpdateChildContent("soapenv:Body|tra:GetDetails|tra:request|tra:InformationRequested|tra:ShowRtoHigherEducation","true");
xml.UpdateChildContent("soapenv:Body|tra:GetDetails|tra:request|tra:InformationRequested|tra:ShowRtoSchoolProvider","true");
xml.UpdateChildContent("soapenv:Body|tra:GetDetails|tra:request|tra:InformationRequested|tra:ShowTradingNames","true");
xml.UpdateChildContent("soapenv:Body|tra:GetDetails|tra:request|tra:InformationRequested|tra:ShowUrls","true");
// In a SOAP HTTP request, including the XML declaration (<?xml version="1.0" encoding="UTF-8"?>) in the XML body is generally not required.
xml.EmitXmlDecl = false;
var soapRequestBody = xml.GetXml();
var endpoint = "https://ws.staging.training.gov.au/Deewr.Tga.WebServices/OrganisationServiceV12.svc/Organisation";
var soapAction = "http://training.gov.au/services/12/IOrganisationService/GetDetails";
// For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"var contentType = "text/xml";
var http = new chilkat.Http();
http.ClearHeaders();
http.SetRequestHeader("Content-Type",contentType);
http.SetRequestHeader("SOAPAction",soapAction);
// resp: HttpResponsevar resp = http.PostXml(endpoint,soapRequestBody,"utf-8");
if (http.LastMethodSuccess == false) {
console.log(http.LastErrorText);
console.log("Failed to send SOAP request.");
return;
}
// Get the XML response body.var responseXml = new chilkat.Xml();
resp.GetBodyXml(responseXml);
var statusCode = resp.StatusCode;
console.log("response status code: " + statusCode);
// If the status code does not indicate succcess, then show the response XML,
// which probably contains error information.if (statusCode !== 200) {
console.log(responseXml.GetXml());
return;
}
console.log(responseXml.GetXml());
// Parse the successful SOAP response XML.// This is a sample of the response XML, but the namespace prefixes will be different.
// We can parse the result using "*" for the namespace prefixes (see below).var ActionOnEntity = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Codes|*:OrganisationCode|*:ActionOnEntity");
var EndDate = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Codes|*:OrganisationCode|*:EndDate");
var StartDate = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Codes|*:OrganisationCode|*:StartDate");
var Code = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Codes|*:OrganisationCode|*:Code");
ActionOnEntity = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Contacts|*:Contact|*:ActionOnEntity");
EndDate = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Contacts|*:Contact|*:EndDate");
StartDate = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Contacts|*:Contact|*:StartDate");
var v_Email = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Contacts|*:Contact|*:Email");
var Fax = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Contacts|*:Contact|*:Fax");
var FirstName = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Contacts|*:Contact|*:FirstName");
var GroupName = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Contacts|*:Contact|*:GroupName");
var JobTitle = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Contacts|*:Contact|*:JobTitle");
var LastName = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Contacts|*:Contact|*:LastName");
var Mobile = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Contacts|*:Contact|*:Mobile");
var OrganisationName = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Contacts|*:Contact|*:OrganisationName");
var Phone = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Contacts|*:Contact|*:Phone");
var CountryCode = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Contacts|*:Contact|*:PostalAddress|*:CountryCode");
var Latitude = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Contacts|*:Contact|*:PostalAddress|*:Latitude");
var Line1 = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Contacts|*:Contact|*:PostalAddress|*:Line1");
var Line2 = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Contacts|*:Contact|*:PostalAddress|*:Line2");
var Longitude = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Contacts|*:Contact|*:PostalAddress|*:Longitude");
var Postcode = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Contacts|*:Contact|*:PostalAddress|*:Postcode");
var StateCode = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Contacts|*:Contact|*:PostalAddress|*:StateCode");
var StateOverseas = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Contacts|*:Contact|*:PostalAddress|*:StateOverseas");
var Suburb = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Contacts|*:Contact|*:PostalAddress|*:Suburb");
var RoleCode = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Contacts|*:Contact|*:RoleCode");
var Title = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Contacts|*:Contact|*:Title");
var TypeCode = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Contacts|*:Contact|*:TypeCode");
var DateTime = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:CreatedDate|*:DateTime");
var OffsetMinutes = responseXml.GetChildIntValue("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:CreatedDate|*:OffsetMinutes");
ActionOnEntity = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:DataManagers|*:DataManagerAssignment|*:ActionOnEntity");
EndDate = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:DataManagers|*:DataManagerAssignment|*:EndDate");
StartDate = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:DataManagers|*:DataManagerAssignment|*:StartDate");
Code = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:DataManagers|*:DataManagerAssignment|*:Code");
var IsLegacyData = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:IsLegacyData");
ActionOnEntity = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Locations|*:OrganisationLocation|*:ActionOnEntity");
EndDate = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Locations|*:OrganisationLocation|*:EndDate");
StartDate = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Locations|*:OrganisationLocation|*:StartDate");
CountryCode = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Locations|*:OrganisationLocation|*:Address|*:CountryCode");
Latitude = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Locations|*:OrganisationLocation|*:Address|*:Latitude");
Line1 = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Locations|*:OrganisationLocation|*:Address|*:Line1");
Line2 = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Locations|*:OrganisationLocation|*:Address|*:Line2");
Longitude = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Locations|*:OrganisationLocation|*:Address|*:Longitude");
Postcode = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Locations|*:OrganisationLocation|*:Address|*:Postcode");
StateCode = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Locations|*:OrganisationLocation|*:Address|*:StateCode");
StateOverseas = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Locations|*:OrganisationLocation|*:Address|*:StateOverseas");
Suburb = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Locations|*:OrganisationLocation|*:Address|*:Suburb");
var OrganisationLocationId = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Locations|*:OrganisationLocation|*:OrganisationLocationId");
ActionOnEntity = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:PostalAddresses|*:OrganisationPostalAddress|*:ActionOnEntity");
EndDate = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:PostalAddresses|*:OrganisationPostalAddress|*:EndDate");
StartDate = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:PostalAddresses|*:OrganisationPostalAddress|*:StartDate");
CountryCode = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:PostalAddresses|*:OrganisationPostalAddress|*:Address|*:CountryCode");
Latitude = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:PostalAddresses|*:OrganisationPostalAddress|*:Address|*:Latitude");
Line1 = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:PostalAddresses|*:OrganisationPostalAddress|*:Address|*:Line1");
Line2 = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:PostalAddresses|*:OrganisationPostalAddress|*:Address|*:Line2");
Longitude = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:PostalAddresses|*:OrganisationPostalAddress|*:Address|*:Longitude");
Postcode = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:PostalAddresses|*:OrganisationPostalAddress|*:Address|*:Postcode");
StateCode = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:PostalAddresses|*:OrganisationPostalAddress|*:Address|*:StateCode");
StateOverseas = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:PostalAddresses|*:OrganisationPostalAddress|*:Address|*:StateOverseas");
Suburb = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:PostalAddresses|*:OrganisationPostalAddress|*:Address|*:Suburb");
var OrganisationPostalAddressId = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:PostalAddresses|*:OrganisationPostalAddress|*:OrganisationPostalAddressId");
ActionOnEntity = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:PrincipalAddresses|*:OrganisationPrincipalAddress|*:ActionOnEntity");
EndDate = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:PrincipalAddresses|*:OrganisationPrincipalAddress|*:EndDate");
StartDate = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:PrincipalAddresses|*:OrganisationPrincipalAddress|*:StartDate");
CountryCode = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:PrincipalAddresses|*:OrganisationPrincipalAddress|*:Address|*:CountryCode");
Latitude = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:PrincipalAddresses|*:OrganisationPrincipalAddress|*:Address|*:Latitude");
Line1 = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:PrincipalAddresses|*:OrganisationPrincipalAddress|*:Address|*:Line1");
Line2 = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:PrincipalAddresses|*:OrganisationPrincipalAddress|*:Address|*:Line2");
Longitude = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:PrincipalAddresses|*:OrganisationPrincipalAddress|*:Address|*:Longitude");
Postcode = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:PrincipalAddresses|*:OrganisationPrincipalAddress|*:Address|*:Postcode");
StateCode = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:PrincipalAddresses|*:OrganisationPrincipalAddress|*:Address|*:StateCode");
StateOverseas = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:PrincipalAddresses|*:OrganisationPrincipalAddress|*:Address|*:StateOverseas");
Suburb = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:PrincipalAddresses|*:OrganisationPrincipalAddress|*:Address|*:Suburb");
var OrganisationPrincipalAddressId = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:PrincipalAddresses|*:OrganisationPrincipalAddress|*:OrganisationPrincipalAddressId");
ActionOnEntity = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:ResponsibleLegalPersons|*:ResponsibleLegalPerson|*:ActionOnEntity");
EndDate = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:ResponsibleLegalPersons|*:ResponsibleLegalPerson|*:EndDate");
StartDate = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:ResponsibleLegalPersons|*:ResponsibleLegalPerson|*:StartDate");
var v_string = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:ResponsibleLegalPersons|*:ResponsibleLegalPerson|*:Abns|*:string");
var Acn = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:ResponsibleLegalPersons|*:ResponsibleLegalPerson|*:Acn");
var Name = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:ResponsibleLegalPersons|*:ResponsibleLegalPerson|*:Name");
ActionOnEntity = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Roles|*:Role|*:ActionOnEntity");
EndDate = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Roles|*:Role|*:EndDate");
StartDate = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Roles|*:Role|*:StartDate");
var Abbreviation = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Roles|*:Role|*:Abbreviation");
var iCode = responseXml.GetChildIntValue("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Roles|*:Role|*:Code");
var Description = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Roles|*:Role|*:Description");
ActionOnEntity = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:TradingNames|*:TradingName|*:ActionOnEntity");
EndDate = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:TradingNames|*:TradingName|*:EndDate");
StartDate = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:TradingNames|*:TradingName|*:StartDate");
Name = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:TradingNames|*:TradingName|*:Name");
DateTime = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:UpdatedDate|*:DateTime");
OffsetMinutes = responseXml.GetChildIntValue("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:UpdatedDate|*:OffsetMinutes");
ActionOnEntity = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Urls|*:Url|*:ActionOnEntity");
EndDate = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Urls|*:Url|*:EndDate");
StartDate = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Urls|*:Url|*:StartDate");
var Link = responseXml.GetChildContent("*:Body|*:GetDetailsResponse|*:GetDetailsResult|*:Urls|*:Url|*:Link");
}
chilkatExample();