LOCAL loXml
LOCAL lcSoapRequestBody
LOCAL lcEndpoint
LOCAL lcSoapAction
LOCAL lcContentType
LOCAL loHttp
LOCAL loResp
LOCAL loResponseXml
LOCAL lnStatusCode
LOCAL lnCount
LOCAL lnPageNumber
LOCAL lnPageSize
LOCAL lcCode
LOCAL lcDataManagerCode
LOCAL lcHasActiveRegistration
LOCAL lcIsLegacyData
LOCAL lcLegalPersonName
LOCAL lcRegistrationStatus
LOCAL lcTradingName
LOCAL lcDateTime
LOCAL lnOffsetMinutes
loXml = CreateObject('Chilkat_9_5_0.Xml')
loXml.Tag = "soapenv:Envelope"
loXml.AddAttribute("xmlns:soapenv","http://schemas.xmlsoap.org/soap/envelope/")
loXml.AddAttribute("xmlns:tra","http://training.gov.au/services/12/")
loXml.AddAttribute("xmlns:sys","http://schemas.datacontract.org/2004/07/System")
loXml.AddAttribute("xmlns:arr","http://schemas.microsoft.com/2003/10/Serialization/Arrays")
loXml.UpdateChildContent("soapenv:Header","")
loXml.UpdateChildContentInt("soapenv:Body|tra:SearchByModifiedDate|tra:request|tra:PageNumber",1042)
loXml.UpdateChildContentInt("soapenv:Body|tra:SearchByModifiedDate|tra:request|tra:PageSize",1042)
loXml.UpdateChildContent("soapenv:Body|tra:SearchByModifiedDate|tra:request|tra:DataManagerFilter|arr:string","string")
loXml.UpdateChildContent("soapenv:Body|tra:SearchByModifiedDate|tra:request|tra:EndDate|sys:DateTime","dateTime")
loXml.UpdateChildContentInt("soapenv:Body|tra:SearchByModifiedDate|tra:request|tra:EndDate|sys:OffsetMinutes",442)
loXml.UpdateChildContent("soapenv:Body|tra:SearchByModifiedDate|tra:request|tra:IncludeLegacyData","true")
loXml.UpdateChildContent("soapenv:Body|tra:SearchByModifiedDate|tra:request|tra:StartDate|sys:DateTime","dateTime")
loXml.UpdateChildContentInt("soapenv:Body|tra:SearchByModifiedDate|tra:request|tra:StartDate|sys:OffsetMinutes",442)
* In a SOAP HTTP request, including the XML declaration (<?xml version="1.0" encoding="UTF-8"?>) in the XML body is generally not required.
loXml.EmitXmlDecl = 0
lcSoapRequestBody = loXml.GetXml()
lcEndpoint = "https://ws.staging.training.gov.au/Deewr.Tga.WebServices/OrganisationServiceV12.svc/Organisation"
lcSoapAction = "http://training.gov.au/services/12/IOrganisationService/SearchByModifiedDate"* For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"
lcContentType = "text/xml"
loHttp = CreateObject('Chilkat_9_5_0.Http')
loHttp.ClearHeaders()
loHttp.SetRequestHeader("Content-Type",lcContentType)
loHttp.SetRequestHeader("SOAPAction",lcSoapAction)
loResp = loHttp.PostXml(lcEndpoint,lcSoapRequestBody,"utf-8")
IF (loHttp.LastMethodSuccess = 0) THEN
? loHttp.LastErrorText
? "Failed to send SOAP request."RELEASE loXml
RELEASE loHttp
CANCELENDIF* Get the XML response body.
loResponseXml = CreateObject('Chilkat_9_5_0.Xml')
loResp.GetBodyXml(loResponseXml)
lnStatusCode = loResp.StatusCode
? "response status code: " + STR(lnStatusCode)
RELEASE loResp
* If the status code does not indicate succcess, then show the response XML,
* which probably contains error information.IF (lnStatusCode <> 200) THEN
? loResponseXml.GetXml()
RELEASE loXml
RELEASE loHttp
RELEASE loResponseXml
CANCELENDIF
? loResponseXml.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).
lnCount = loResponseXml.GetChildIntValue("*:Body|*:SearchByModifiedDateResponse|*:SearchByModifiedDateResult|*:Count")
lnPageNumber = loResponseXml.GetChildIntValue("*:Body|*:SearchByModifiedDateResponse|*:SearchByModifiedDateResult|*:PageNumber")
lnPageSize = loResponseXml.GetChildIntValue("*:Body|*:SearchByModifiedDateResponse|*:SearchByModifiedDateResult|*:PageSize")
lcCode = loResponseXml.GetChildContent("*:Body|*:SearchByModifiedDateResponse|*:SearchByModifiedDateResult|*:Results|*:OrganisationSearchResultItem|*:Code")
lcDataManagerCode = loResponseXml.GetChildContent("*:Body|*:SearchByModifiedDateResponse|*:SearchByModifiedDateResult|*:Results|*:OrganisationSearchResultItem|*:DataManagerCode")
lcHasActiveRegistration = loResponseXml.GetChildContent("*:Body|*:SearchByModifiedDateResponse|*:SearchByModifiedDateResult|*:Results|*:OrganisationSearchResultItem|*:HasActiveRegistration")
lcIsLegacyData = loResponseXml.GetChildContent("*:Body|*:SearchByModifiedDateResponse|*:SearchByModifiedDateResult|*:Results|*:OrganisationSearchResultItem|*:IsLegacyData")
lcLegalPersonName = loResponseXml.GetChildContent("*:Body|*:SearchByModifiedDateResponse|*:SearchByModifiedDateResult|*:Results|*:OrganisationSearchResultItem|*:LegalPersonName")
lcRegistrationStatus = loResponseXml.GetChildContent("*:Body|*:SearchByModifiedDateResponse|*:SearchByModifiedDateResult|*:Results|*:OrganisationSearchResultItem|*:RegistrationStatus")
lcTradingName = loResponseXml.GetChildContent("*:Body|*:SearchByModifiedDateResponse|*:SearchByModifiedDateResult|*:Results|*:OrganisationSearchResultItem|*:TradingName")
lcDateTime = loResponseXml.GetChildContent("*:Body|*:SearchByModifiedDateResponse|*:SearchByModifiedDateResult|*:Results|*:OrganisationSearchResultItem|*:UpdatedDate|*:DateTime")
lnOffsetMinutes = loResponseXml.GetChildIntValue("*:Body|*:SearchByModifiedDateResponse|*:SearchByModifiedDateResult|*:Results|*:OrganisationSearchResultItem|*:UpdatedDate|*:OffsetMinutes")
RELEASE loXml
RELEASE loHttp
RELEASE loResponseXml