Chilkat.Xml xml = newChilkat.Xml();
xml.Tag = "soap:Envelope";
xml.AddAttribute("xmlns:sys","http://schemas.datacontract.org/2004/07/System");
xml.AddAttribute("xmlns:tra","http://training.gov.au/services/12/");
xml.AddAttribute("xmlns:soap","http://www.w3.org/2003/05/soap-envelope");
xml.AddAttribute("xmlns:arr","http://schemas.microsoft.com/2003/10/Serialization/Arrays");
xml.UpdateChildContent("soap:Header","");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Codes|tra:OrganisationCode|tra:ActionOnEntity","None");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Codes|tra:OrganisationCode|tra:EndDate","date");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Codes|tra:OrganisationCode|tra:StartDate","date");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Codes|tra:OrganisationCode|tra:Code","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:ActionOnEntity","None");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:EndDate","date");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:StartDate","date");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:Email","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:Fax","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:FirstName","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:GroupName","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:JobTitle","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:LastName","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:Mobile","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:OrganisationName","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:Phone","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:PostalAddress|tra:CountryCode","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:PostalAddress|tra:Latitude","99.0");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:PostalAddress|tra:Line1","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:PostalAddress|tra:Line2","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:PostalAddress|tra:Longitude","99.0");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:PostalAddress|tra:Postcode","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:PostalAddress|tra:StateCode","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:PostalAddress|tra:StateOverseas","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:PostalAddress|tra:Suburb","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:RoleCode","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:Title","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Contacts|tra:Contact|tra:TypeCode","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:CreatedDate|sys:DateTime","dateTime");
xml.UpdateChildContentInt("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:CreatedDate|sys:OffsetMinutes",442);
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:DataManagers|tra:DataManagerAssignment|tra:ActionOnEntity","None");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:DataManagers|tra:DataManagerAssignment|tra:EndDate","date");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:DataManagers|tra:DataManagerAssignment|tra:StartDate","date");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:DataManagers|tra:DataManagerAssignment|tra:Code","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:IsLegacyData","true");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Locations|tra:OrganisationLocation|tra:ActionOnEntity","None");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Locations|tra:OrganisationLocation|tra:EndDate","date");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Locations|tra:OrganisationLocation|tra:StartDate","date");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Locations|tra:OrganisationLocation|tra:Address|tra:CountryCode","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Locations|tra:OrganisationLocation|tra:Address|tra:Latitude","99.0");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Locations|tra:OrganisationLocation|tra:Address|tra:Line1","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Locations|tra:OrganisationLocation|tra:Address|tra:Line2","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Locations|tra:OrganisationLocation|tra:Address|tra:Longitude","99.0");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Locations|tra:OrganisationLocation|tra:Address|tra:Postcode","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Locations|tra:OrganisationLocation|tra:Address|tra:StateCode","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Locations|tra:OrganisationLocation|tra:Address|tra:StateOverseas","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Locations|tra:OrganisationLocation|tra:Address|tra:Suburb","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Locations|tra:OrganisationLocation|tra:OrganisationLocationId","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:ActionOnEntity","None");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:EndDate","date");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:StartDate","date");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:Address|tra:CountryCode","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:Address|tra:Latitude","99.0");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:Address|tra:Line1","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:Address|tra:Line2","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:Address|tra:Longitude","99.0");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:Address|tra:Postcode","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:Address|tra:StateCode","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:Address|tra:StateOverseas","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:Address|tra:Suburb","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:OrganisationPostalAddressId","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:ActionOnEntity","None");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:EndDate","date");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:StartDate","date");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:Address|tra:CountryCode","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:Address|tra:Latitude","99.0");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:Address|tra:Line1","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:Address|tra:Line2","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:Address|tra:Longitude","99.0");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:Address|tra:Postcode","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:Address|tra:StateCode","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:Address|tra:StateOverseas","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:Address|tra:Suburb","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:OrganisationPrincipalAddressId","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:ResponsibleLegalPersons|tra:ResponsibleLegalPerson|tra:ActionOnEntity","None");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:ResponsibleLegalPersons|tra:ResponsibleLegalPerson|tra:EndDate","date");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:ResponsibleLegalPersons|tra:ResponsibleLegalPerson|tra:StartDate","date");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:ResponsibleLegalPersons|tra:ResponsibleLegalPerson|tra:Abns|arr:string","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:ResponsibleLegalPersons|tra:ResponsibleLegalPerson|tra:Acn","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:ResponsibleLegalPersons|tra:ResponsibleLegalPerson|tra:Name","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Roles|tra:Role|tra:ActionOnEntity","None");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Roles|tra:Role|tra:EndDate","date");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Roles|tra:Role|tra:StartDate","date");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Roles|tra:Role|tra:Abbreviation","string");
xml.UpdateChildContentInt("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Roles|tra:Role|tra:Code",1042);
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Roles|tra:Role|tra:Description","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:TradingNames|tra:TradingName|tra:ActionOnEntity","None");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:TradingNames|tra:TradingName|tra:EndDate","date");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:TradingNames|tra:TradingName|tra:StartDate","date");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:TradingNames|tra:TradingName|tra:Name","string");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:UpdatedDate|sys:DateTime","dateTime");
xml.UpdateChildContentInt("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:UpdatedDate|sys:OffsetMinutes",442);
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Urls|tra:Url|tra:ActionOnEntity","None");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Urls|tra:Url|tra:EndDate","date");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Urls|tra:Url|tra:StartDate","date");
xml.UpdateChildContent("soap:Body|tra:AddOrganisation|tra:rtoDto|tra:Urls|tra:Url|tra:Link","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;
string soapRequestBody = xml.GetXml();
string endpoint = "https://ws.staging.training.gov.au/Deewr.Tga.WebServices/OrganisationServiceV12.svc/Organisation12";
string soapAction = "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"string contentType = "text/xml";
Chilkat.Http http = newChilkat.Http();
http.ClearHeaders();
http.SetRequestHeader("Content-Type",contentType);
http.SetRequestHeader("SOAPAction",soapAction);
Chilkat.HttpResponse resp = http.PostXml(endpoint,soapRequestBody,"utf-8");
if (http.LastMethodSuccess == false) {
Debug.WriteLine(http.LastErrorText);
Debug.WriteLine("Failed to send SOAP request.");
return;
}
// Get the XML response body.Chilkat.Xml responseXml = newChilkat.Xml();
resp.GetBodyXml(responseXml);
int statusCode = resp.StatusCode;
Debug.WriteLine("response status code: " + Convert.ToString(statusCode));
// If the status code does not indicate succcess, then show the response XML,
// which probably contains error information.if (statusCode != 200) {
Debug.WriteLine(responseXml.GetXml());
return;
}
Debug.WriteLine(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).