OrganisationServiceBasicHttpEndpoint / Add
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
-- Important: See this note about {{-https://cknotes.com/sql-sp_oamethod-string-length-return-value-limitations/|||string length limitations for strings returned by sp_OAMethod calls-}}.
--
CREATE PROCEDURE ChilkatSample
AS
BEGIN
DECLARE @hr int
DECLARE @iTmp0 int
-- Important: Do not use nvarchar(max). See the {{-https://www.example-code.com/sql/default.asp|||warning about using nvarchar(max)-}}.
DECLARE @sTmp0 nvarchar(4000)
DECLARE @xml int
EXEC @hr = sp_OACreate 'Chilkat_9_5_0.Xml', @xml OUT
IF @hr <> 0
BEGIN
PRINT 'Failed to create ActiveX component'
RETURN
END
EXEC sp_OASetProperty @xml, 'Tag', 'soapenv:Envelope'
DECLARE @success int
EXEC sp_OAMethod @xml, 'AddAttribute', @success OUT, 'xmlns:soapenv', 'http://schemas.xmlsoap.org/soap/envelope/'
EXEC sp_OAMethod @xml, 'AddAttribute', @success OUT, 'xmlns:tra', 'http://training.gov.au/services/12/'
EXEC sp_OAMethod @xml, 'AddAttribute', @success OUT, 'xmlns:sys', 'http://schemas.datacontract.org/2004/07/System'
EXEC sp_OAMethod @xml, 'AddAttribute', @success OUT, 'xmlns:arr', 'http://schemas.microsoft.com/2003/10/Serialization/Arrays'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Header', ''
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Codes|tra:OrganisationCode|tra:ActionOnEntity', 'None'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Codes|tra:OrganisationCode|tra:EndDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Codes|tra:OrganisationCode|tra:StartDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Codes|tra:OrganisationCode|tra:Code', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Contacts|tra:Contact|tra:ActionOnEntity', 'None'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Contacts|tra:Contact|tra:EndDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Contacts|tra:Contact|tra:StartDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Contacts|tra:Contact|tra:Email', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Contacts|tra:Contact|tra:Fax', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Contacts|tra:Contact|tra:FirstName', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Contacts|tra:Contact|tra:GroupName', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Contacts|tra:Contact|tra:JobTitle', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Contacts|tra:Contact|tra:LastName', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Contacts|tra:Contact|tra:Mobile', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Contacts|tra:Contact|tra:OrganisationName', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Contacts|tra:Contact|tra:Phone', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Contacts|tra:Contact|tra:PostalAddress|tra:CountryCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Contacts|tra:Contact|tra:PostalAddress|tra:Latitude', '99.0'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Contacts|tra:Contact|tra:PostalAddress|tra:Line1', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Contacts|tra:Contact|tra:PostalAddress|tra:Line2', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Contacts|tra:Contact|tra:PostalAddress|tra:Longitude', '99.0'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Contacts|tra:Contact|tra:PostalAddress|tra:Postcode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Contacts|tra:Contact|tra:PostalAddress|tra:StateCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Contacts|tra:Contact|tra:PostalAddress|tra:StateOverseas', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Contacts|tra:Contact|tra:PostalAddress|tra:Suburb', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Contacts|tra:Contact|tra:RoleCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Contacts|tra:Contact|tra:Title', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Contacts|tra:Contact|tra:TypeCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:CreatedDate|sys:DateTime', 'dateTime'
EXEC sp_OAMethod @xml, 'UpdateChildContentInt', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:CreatedDate|sys:OffsetMinutes', 442
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:DataManagers|tra:DataManagerAssignment|tra:ActionOnEntity', 'None'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:DataManagers|tra:DataManagerAssignment|tra:EndDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:DataManagers|tra:DataManagerAssignment|tra:StartDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:DataManagers|tra:DataManagerAssignment|tra:Code', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:IsLegacyData', 'true'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Locations|tra:OrganisationLocation|tra:ActionOnEntity', 'None'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Locations|tra:OrganisationLocation|tra:EndDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Locations|tra:OrganisationLocation|tra:StartDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Locations|tra:OrganisationLocation|tra:Address|tra:CountryCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Locations|tra:OrganisationLocation|tra:Address|tra:Latitude', '99.0'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Locations|tra:OrganisationLocation|tra:Address|tra:Line1', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Locations|tra:OrganisationLocation|tra:Address|tra:Line2', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Locations|tra:OrganisationLocation|tra:Address|tra:Longitude', '99.0'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Locations|tra:OrganisationLocation|tra:Address|tra:Postcode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Locations|tra:OrganisationLocation|tra:Address|tra:StateCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Locations|tra:OrganisationLocation|tra:Address|tra:StateOverseas', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Locations|tra:OrganisationLocation|tra:Address|tra:Suburb', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Locations|tra:OrganisationLocation|tra:OrganisationLocationId', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:ActionOnEntity', 'None'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:EndDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:StartDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:Address|tra:CountryCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:Address|tra:Latitude', '99.0'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:Address|tra:Line1', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:Address|tra:Line2', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:Address|tra:Longitude', '99.0'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:Address|tra:Postcode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:Address|tra:StateCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:Address|tra:StateOverseas', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:Address|tra:Suburb', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:PostalAddresses|tra:OrganisationPostalAddress|tra:OrganisationPostalAddressId', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:ActionOnEntity', 'None'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:EndDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:StartDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:Address|tra:CountryCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:Address|tra:Latitude', '99.0'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:Address|tra:Line1', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:Address|tra:Line2', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:Address|tra:Longitude', '99.0'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:Address|tra:Postcode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:Address|tra:StateCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:Address|tra:StateOverseas', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:Address|tra:Suburb', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:PrincipalAddresses|tra:OrganisationPrincipalAddress|tra:OrganisationPrincipalAddressId', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:ResponsibleLegalPersons|tra:ResponsibleLegalPerson|tra:ActionOnEntity', 'None'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:ResponsibleLegalPersons|tra:ResponsibleLegalPerson|tra:EndDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:ResponsibleLegalPersons|tra:ResponsibleLegalPerson|tra:StartDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:ResponsibleLegalPersons|tra:ResponsibleLegalPerson|tra:Abns|arr:string', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:ResponsibleLegalPersons|tra:ResponsibleLegalPerson|tra:Acn', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:ResponsibleLegalPersons|tra:ResponsibleLegalPerson|tra:Name', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Roles|tra:Role|tra:ActionOnEntity', 'None'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Roles|tra:Role|tra:EndDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Roles|tra:Role|tra:StartDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Roles|tra:Role|tra:Abbreviation', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContentInt', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Roles|tra:Role|tra:Code', 1042
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Roles|tra:Role|tra:Description', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:TradingNames|tra:TradingName|tra:ActionOnEntity', 'None'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:TradingNames|tra:TradingName|tra:EndDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:TradingNames|tra:TradingName|tra:StartDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:TradingNames|tra:TradingName|tra:Name', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:UpdatedDate|sys:DateTime', 'dateTime'
EXEC sp_OAMethod @xml, 'UpdateChildContentInt', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:UpdatedDate|sys:OffsetMinutes', 442
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Urls|tra:Url|tra:ActionOnEntity', 'None'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Urls|tra:Url|tra:EndDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Urls|tra:Url|tra:StartDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Urls|tra:Url|tra:Link', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Classifications|tra:Classification|tra:ActionOnEntity', 'None'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Classifications|tra:Classification|tra:EndDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Classifications|tra:Classification|tra:StartDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Classifications|tra:Classification|tra:PurposeCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Classifications|tra:Classification|tra:SchemeCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Classifications|tra:Classification|tra:ValueCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:CricosCodes|tra:RtoCricosCode|tra:ActionOnEntity', 'None'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:CricosCodes|tra:RtoCricosCode|tra:EndDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:CricosCodes|tra:RtoCricosCode|tra:StartDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:CricosCodes|tra:RtoCricosCode|tra:Cricos_x0020_Code', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:DeliveryLocations|tra:RtoDeliveryLocation|tra:ActionOnEntity', 'None'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:DeliveryLocations|tra:RtoDeliveryLocation|tra:EndDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:DeliveryLocations|tra:RtoDeliveryLocation|tra:StartDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:DeliveryLocations|tra:RtoDeliveryLocation|tra:Address|tra:CountryCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:DeliveryLocations|tra:RtoDeliveryLocation|tra:Address|tra:Latitude', '99.0'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:DeliveryLocations|tra:RtoDeliveryLocation|tra:Address|tra:Line1', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:DeliveryLocations|tra:RtoDeliveryLocation|tra:Address|tra:Line2', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:DeliveryLocations|tra:RtoDeliveryLocation|tra:Address|tra:Longitude', '99.0'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:DeliveryLocations|tra:RtoDeliveryLocation|tra:Address|tra:Postcode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:DeliveryLocations|tra:RtoDeliveryLocation|tra:Address|tra:StateCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:DeliveryLocations|tra:RtoDeliveryLocation|tra:Address|tra:StateOverseas', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:DeliveryLocations|tra:RtoDeliveryLocation|tra:Address|tra:Suburb', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:DeliveryLocations|tra:RtoDeliveryLocation|tra:DeliveryLocationName', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:DeliveryLocations|tra:RtoDeliveryLocation|tra:RtoDeliveryLocationId', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:DeliveryNotifications|tra:DeliveryNotification|tra:ActionOnEntity', 'None'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:DeliveryNotifications|tra:DeliveryNotification|tra:DateOfChange', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:DeliveryNotifications|tra:DeliveryNotification|tra:GeographicAreas|tra:DeliveryNotificationGeographicArea|tra:CountryCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:DeliveryNotifications|tra:DeliveryNotification|tra:GeographicAreas|tra:DeliveryNotificationGeographicArea|tra:StateCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:DeliveryNotifications|tra:DeliveryNotification|tra:IsCessation', 'true'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:DeliveryNotifications|tra:DeliveryNotification|tra:NotificationDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:DeliveryNotifications|tra:DeliveryNotification|tra:Scopes|tra:DeliveryNotificationScope|tra:Code', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:DeliveryNotifications|tra:DeliveryNotification|tra:Scopes|tra:DeliveryNotificationScope|tra:TrainingComponentType', 'list of enumerated string values'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegistrationManagers|tra:RegistrationManagerAssignment|tra:ActionOnEntity', 'None'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegistrationManagers|tra:RegistrationManagerAssignment|tra:EndDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegistrationManagers|tra:RegistrationManagerAssignment|tra:StartDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegistrationManagers|tra:RegistrationManagerAssignment|tra:Code', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegistrationPeriods|tra:RegistrationPeriod|tra:ActionOnEntity', 'None'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegistrationPeriods|tra:RegistrationPeriod|tra:EndDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegistrationPeriods|tra:RegistrationPeriod|tra:StartDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegistrationPeriods|tra:RegistrationPeriod|tra:EndReasonCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegistrationPeriods|tra:RegistrationPeriod|tra:EndReasonComments', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegistrationPeriods|tra:RegistrationPeriod|tra:Exerciser', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegistrationPeriods|tra:RegistrationPeriod|tra:LegalAuthority', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegistrationPeriods|tra:RegistrationPeriod|tra:RegistrationApplicationRenew|tra:DateOfRejection', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegistrationPeriods|tra:RegistrationPeriod|tra:RegistrationApplicationRenew|tra:IsApplicationToRenew', 'true'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegistrationPeriods|tra:RegistrationPeriod|tra:RegistrationApplicationRenew|tra:RtoRegistrationOutcomeOfApplication', 'UnderConsideration'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegistrationStatus', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:ActionOnEntity', 'None'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:EndDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:StartDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:AdditionalDetails', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:Code', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:DecisionDetails', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:DecisionDetailsMarkedUp', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:DecisionLevelCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:DecisionMadeUnder', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:DecisionMadeUnderUrl', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:DecisionMadeUnderUrlText', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:DecisionMakerCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:DecisionStatusCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:DecisionTypeCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:EffectiveDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:IsHistoric', 'true'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:Reference', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:RegulatoryDecision', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:RegulatoryDecisionEvents|tra:RtoRegulatoryDecisionEvent|tra:AttachmentUrl', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:RegulatoryDecisionEvents|tra:RtoRegulatoryDecisionEvent|tra:AttachmentUrlText', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:RegulatoryDecisionEvents|tra:RtoRegulatoryDecisionEvent|tra:DecisionMakerCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:RegulatoryDecisionEvents|tra:RtoRegulatoryDecisionEvent|tra:EventDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:RegulatoryDecisionEvents|tra:RtoRegulatoryDecisionEvent|tra:EventDetails', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:RegulatoryDecisionEvents|tra:RtoRegulatoryDecisionEvent|tra:EventStatusCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:RegulatoryDecisionEvents|tra:RtoRegulatoryDecisionEvent|tra:IsHistoric', 'true'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:RegulatoryDecisionMapping|tra:RtoRegulatoryDecisionMapping|tra:Code', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:RegulatoryDecisionMapping|tra:RtoRegulatoryDecisionMapping|tra:Description', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:RegulatoryDecisionMapping|tra:RtoRegulatoryDecisionMapping|tra:MapFromRelationshipCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:RegulatoryDecisionMapping|tra:RtoRegulatoryDecisionMapping|tra:MapToRelationshipCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:RegulatoryDecisionMapping|tra:RtoRegulatoryDecisionMapping|tra:MapsToCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:ReverseRegulatoryDecisionMapping|tra:RtoRegulatoryDecisionMapping|tra:Code', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:ReverseRegulatoryDecisionMapping|tra:RtoRegulatoryDecisionMapping|tra:Description', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:ReverseRegulatoryDecisionMapping|tra:RtoRegulatoryDecisionMapping|tra:MapFromRelationshipCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:ReverseRegulatoryDecisionMapping|tra:RtoRegulatoryDecisionMapping|tra:MapToRelationshipCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:ReverseRegulatoryDecisionMapping|tra:RtoRegulatoryDecisionMapping|tra:MapsToCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RegulatoryDecisions|tra:RtoRegulatoryDecision|tra:ReviewStatusCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Restrictions|tra:RtoRestriction|tra:ActionOnEntity', 'None'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Restrictions|tra:RtoRestriction|tra:EndDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Restrictions|tra:RtoRestriction|tra:StartDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Restrictions|tra:RtoRestriction|tra:Code', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Restrictions|tra:RtoRestriction|tra:Restriction', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Restrictions|tra:RtoRestriction|tra:RestrictionTypeCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Restrictions|tra:RtoRestriction|tra:ShowRestriction', 'true'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RtoHigherEducations|tra:RtoHigherEducation|tra:ActionOnEntity', 'None'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RtoHigherEducations|tra:RtoHigherEducation|tra:EndDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RtoHigherEducations|tra:RtoHigherEducation|tra:StartDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RtoHigherEducations|tra:RtoHigherEducation|tra:IsHigherEducation', 'true'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RtoSchoolProviders|tra:RtoSchoolProvider|tra:ActionOnEntity', 'None'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RtoSchoolProviders|tra:RtoSchoolProvider|tra:EndDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RtoSchoolProviders|tra:RtoSchoolProvider|tra:StartDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:RtoSchoolProviders|tra:RtoSchoolProvider|tra:IsSchoolProvider', 'true'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Scopes|tra:Scope|tra:ActionOnEntity', 'None'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Scopes|tra:Scope|tra:EndDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Scopes|tra:Scope|tra:StartDate', 'date'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Scopes|tra:Scope|tra:ExtentCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Scopes|tra:Scope|tra:IsImplicit', 'true'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Scopes|tra:Scope|tra:IsRefused', 'true'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Scopes|tra:Scope|tra:NrtCode', 'string'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Scopes|tra:Scope|tra:ScopeDecisionType', 'Granted'
EXEC sp_OAMethod @xml, 'UpdateChildContent', NULL, 'soapenv:Body|tra:Add|tra:rto|tra:Scopes|tra:Scope|tra:TrainingComponentType', 'list of enumerated string values'
-- In a SOAP HTTP request, including the XML declaration (<?xml version="1.0" encoding="UTF-8"?>) in the XML body is generally not required.
EXEC sp_OASetProperty @xml, 'EmitXmlDecl', 0
DECLARE @soapRequestBody nvarchar(4000)
EXEC sp_OAMethod @xml, 'GetXml', @soapRequestBody OUT
DECLARE @endpoint nvarchar(4000)
SELECT @endpoint = 'https://ws.staging.training.gov.au/Deewr.Tga.WebServices/OrganisationServiceV12.svc/Organisation'
DECLARE @soapAction nvarchar(4000)
SELECT @soapAction = 'http://training.gov.au/services/12/IOrganisationService/Add'
-- For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"
DECLARE @contentType nvarchar(4000)
SELECT @contentType = 'text/xml'
DECLARE @http int
EXEC @hr = sp_OACreate 'Chilkat_9_5_0.Http', @http OUT
EXEC sp_OAMethod @http, 'ClearHeaders', NULL
EXEC sp_OAMethod @http, 'SetRequestHeader', NULL, 'Content-Type', @contentType
EXEC sp_OAMethod @http, 'SetRequestHeader', NULL, 'SOAPAction', @soapAction
DECLARE @resp int
EXEC sp_OAMethod @http, 'PostXml', @resp OUT, @endpoint, @soapRequestBody, 'utf-8'
EXEC sp_OAGetProperty @http, 'LastMethodSuccess', @iTmp0 OUT
IF @iTmp0 = 0
BEGIN
EXEC sp_OAGetProperty @http, 'LastErrorText', @sTmp0 OUT
PRINT @sTmp0
PRINT 'Failed to send SOAP request.'
EXEC @hr = sp_OADestroy @xml
EXEC @hr = sp_OADestroy @http
RETURN
END
-- Get the XML response body.
DECLARE @responseXml int
EXEC @hr = sp_OACreate 'Chilkat_9_5_0.Xml', @responseXml OUT
EXEC sp_OAMethod @resp, 'GetBodyXml', @success OUT, @responseXml
DECLARE @statusCode int
EXEC sp_OAGetProperty @resp, 'StatusCode', @statusCode OUT
PRINT 'response status code: ' + @statusCode
EXEC @hr = sp_OADestroy @resp
-- If the status code does not indicate succcess, then show the response XML,
-- which probably contains error information.
IF @statusCode <> 200
BEGIN
EXEC sp_OAMethod @responseXml, 'GetXml', @sTmp0 OUT
PRINT @sTmp0
EXEC @hr = sp_OADestroy @xml
EXEC @hr = sp_OADestroy @http
EXEC @hr = sp_OADestroy @responseXml
RETURN
END
EXEC sp_OAMethod @responseXml, 'GetXml', @sTmp0 OUT
PRINT @sTmp0
-- 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).
EXEC @hr = sp_OADestroy @xml
EXEC @hr = sp_OADestroy @http
EXEC @hr = sp_OADestroy @responseXml
END
GO