OrganisationServiceBasicHttpEndpoint / AddOrganisation
ASP AutoIt C C (Unicode) C++ C++ (Unicode) C# DataFlex Delphi Foxpro Go Java Node.js Objective-C Perl PHP Extension PowerBuilder Powershell PureBasic Python CkPython Ruby SQL Server Swift TCL VB.NET VB6 VBScript Xojo
func chilkatTest() {
let xml = CkoXml()
xml.Tag = "soapenv:Envelope"
xml.AddAttribute("xmlns:soapenv", value: "http://schemas.xmlsoap.org/soap/envelope/")
xml.AddAttribute("xmlns:tra", value: "http://training.gov.au/services/12/")
xml.AddAttribute("xmlns:sys", value: "http://schemas.datacontract.org/2004/07/System")
xml.AddAttribute("xmlns:arr", value: "http://schemas.microsoft.com/2003/10/Serialization/Arrays")
xml.UpdateChildContent("soapenv:Header", value: "")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Codes|tra:OrganisationCode|tra:ActionOnEntity", value: "None")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Codes|tra:OrganisationCode|tra:EndDate", value: "date")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Codes|tra:OrganisationCode|tra:StartDate", value: "date")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Codes|tra:OrganisationCode|tra:Code", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:ActionOnEntity", value: "None")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:EndDate", value: "date")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:StartDate", value: "date")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:Email", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:Fax", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:FirstName", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:GroupName", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:JobTitle", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:LastName", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:Mobile", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:OrganisationName", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:Phone", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:PostalAddress|tra:CountryCode", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:PostalAddress|tra:Latitude", value: "99.0")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:PostalAddress|tra:Line1", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:PostalAddress|tra:Line2", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:PostalAddress|tra:Longitude", value: "99.0")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:PostalAddress|tra:Postcode", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:PostalAddress|tra:StateCode", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:PostalAddress|tra:StateOverseas", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:PostalAddress|tra:Suburb", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:RoleCode", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:Title", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:TypeCode", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:CreatedDate|sys:DateTime", value: "dateTime")
xml.UpdateChildContentInt("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:CreatedDate|sys:OffsetMinutes", value: 442)
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:DataManagers|tra:DataManagerAssignment|tra:ActionOnEntity", value: "None")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:DataManagers|tra:DataManagerAssignment|tra:EndDate", value: "date")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:DataManagers|tra:DataManagerAssignment|tra:StartDate", value: "date")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:DataManagers|tra:DataManagerAssignment|tra:Code", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:IsLegacyData", value: "true")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Locations|tra:OrganisationLocation|tra:ActionOnEntity", value: "None")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Locations|tra:OrganisationLocation|tra:EndDate", value: "date")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Locations|tra:OrganisationLocation|tra:StartDate", value: "date")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Locations|tra:OrganisationLocation|tra:Address|tra:CountryCode", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Locations|tra:OrganisationLocation|tra:Address|tra:Latitude", value: "99.0")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Locations|tra:OrganisationLocation|tra:Address|tra:Line1", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Locations|tra:OrganisationLocation|tra:Address|tra:Line2", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Locations|tra:OrganisationLocation|tra:Address|tra:Longitude", value: "99.0")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Locations|tra:OrganisationLocation|tra:Address|tra:Postcode", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Locations|tra:OrganisationLocation|tra:Address|tra:StateCode", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Locations|tra:OrganisationLocation|tra:Address|tra:StateOverseas", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Locations|tra:OrganisationLocation|tra:Address|tra:Suburb", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Locations|tra:OrganisationLocation|tra:OrganisationLocationId", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:ActionOnEntity", value: "None")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:EndDate", value: "date")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:StartDate", value: "date")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:Address|tra:CountryCode", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:Address|tra:Latitude", value: "99.0")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:Address|tra:Line1", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:Address|tra:Line2", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:Address|tra:Longitude", value: "99.0")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:Address|tra:Postcode", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:Address|tra:StateCode", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:Address|tra:StateOverseas", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:Address|tra:Suburb", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:OrganisationPostalAddressId", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:ActionOnEntity", value: "None")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:EndDate", value: "date")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:StartDate", value: "date")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:Address|tra:CountryCode", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:Address|tra:Latitude", value: "99.0")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:Address|tra:Line1", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:Address|tra:Line2", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:Address|tra:Longitude", value: "99.0")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:Address|tra:Postcode", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:Address|tra:StateCode", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:Address|tra:StateOverseas", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:Address|tra:Suburb", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:OrganisationPrincipalAddressId", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:ResponsibleLegalPersons|tra:ResponsibleLegalPerson|tra:ActionOnEntity", value: "None")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:ResponsibleLegalPersons|tra:ResponsibleLegalPerson|tra:EndDate", value: "date")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:ResponsibleLegalPersons|tra:ResponsibleLegalPerson|tra:StartDate", value: "date")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:ResponsibleLegalPersons|tra:ResponsibleLegalPerson|tra:Abns|arr:string", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:ResponsibleLegalPersons|tra:ResponsibleLegalPerson|tra:Acn", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:ResponsibleLegalPersons|tra:ResponsibleLegalPerson|tra:Name", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Roles|tra:Role|tra:ActionOnEntity", value: "None")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Roles|tra:Role|tra:EndDate", value: "date")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Roles|tra:Role|tra:StartDate", value: "date")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Roles|tra:Role|tra:Abbreviation", value: "string")
xml.UpdateChildContentInt("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Roles|tra:Role|tra:Code", value: 1042)
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Roles|tra:Role|tra:Description", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:TradingNames|tra:TradingName|tra:ActionOnEntity", value: "None")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:TradingNames|tra:TradingName|tra:EndDate", value: "date")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:TradingNames|tra:TradingName|tra:StartDate", value: "date")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:TradingNames|tra:TradingName|tra:Name", value: "string")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:UpdatedDate|sys:DateTime", value: "dateTime")
xml.UpdateChildContentInt("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:UpdatedDate|sys:OffsetMinutes", value: 442)
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Urls|tra:Url|tra:ActionOnEntity", value: "None")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Urls|tra:Url|tra:EndDate", value: "date")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Urls|tra:Url|tra:StartDate", value: "date")
xml.UpdateChildContent("soapenv:Body|tra:AddOrganisation|tra:rtoDto|tra:Urls|tra:Url|tra:Link", value: "string")
// 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: String? = xml.GetXml()
var endpoint: String? = "https://ws.staging.training.gov.au/Deewr.Tga.WebServices/OrganisationServiceV12.svc/Organisation"
var soapAction: String? = "http://training.gov.au/services/12/IOrganisationService/AddOrganisation"
// For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"
var contentType: String? = "text/xml"
let http = CkoHttp()
http.ClearHeaders()
http.SetRequestHeader("Content-Type", value: contentType)
http.SetRequestHeader("SOAPAction", value: soapAction)
var resp: CkoHttpResponse? = http.PostXml(endpoint, xmlDoc: soapRequestBody, charset: "utf-8")
if http.LastMethodSuccess == false {
print("\(http.LastErrorText)")
print("Failed to send SOAP request.")
return
}
// Get the XML response body.
let responseXml = CkoXml()
resp!.GetBodyXml(responseXml)
var statusCode: Int = resp!.StatusCode.intValue
print("response status code: \(statusCode)")
resp = nil
// If the status code does not indicate succcess, then show the response XML,
// which probably contains error information.
if statusCode != 200 {
print("\(responseXml.GetXml())")
return
}
print("\(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).
}