SOAP WSDL Generate Code

OrganisationServiceWsHttpEndpoint / SearchByScope

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
require 'chilkat'

xml = Chilkat::CkXml.new()
xml.put_Tag("soap:Envelope")
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.UpdateChildContentInt("soap:Body|tra:SearchByScope|tra:request|tra:PageNumber",1042)
xml.UpdateChildContentInt("soap:Body|tra:SearchByScope|tra:request|tra:PageSize",1042)
xml.UpdateChildContent("soap:Body|tra:SearchByScope|tra:request|tra:Filter","string")
xml.UpdateChildContent("soap:Body|tra:SearchByScope|tra:request|tra:IncludeImplicitScope","true")
xml.UpdateChildContent("soap:Body|tra:SearchByScope|tra:request|tra:IncludeLegacyData","true")
xml.UpdateChildContent("soap:Body|tra:SearchByScope|tra:request|tra:RegistrationManagers|arr:string","string")
xml.UpdateChildContent("soap:Body|tra:SearchByScope|tra:request|tra:SearchTrainingPackageContents","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.put_EmitXmlDecl(false)
soapRequestBody = xml.getXml()

endpoint = "https://ws.staging.training.gov.au/Deewr.Tga.WebServices/OrganisationServiceV12.svc/Organisation12"
soapAction = "http://training.gov.au/services/12/IOrganisationService/SearchByScope"
#  For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"
contentType = "text/xml"

http = Chilkat::CkHttp.new()

http.ClearHeaders()
http.SetRequestHeader("Content-Type",contentType)
http.SetRequestHeader("SOAPAction",soapAction)

# resp is a CkHttpResponse
resp = http.PostXml(endpoint,soapRequestBody,"utf-8")
if (http.get_LastMethodSuccess() == false)
    print http.lastErrorText() + "\n";
    print "Failed to send SOAP request." + "\n";
    exit
end

# Get the XML response body.
responseXml = Chilkat::CkXml.new()
resp.GetBodyXml(responseXml)

statusCode = resp.get_StatusCode()
print "response status code: " + statusCode.to_s() + "\n";

# If the status code does not indicate succcess, then show the response XML,
# which probably contains error information.
if (statusCode != 200)
    print responseXml.getXml() + "\n";
    exit
end

print responseXml.getXml() + "\n";

# 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).

Count = responseXml.GetChildIntValue("*:Body|*:SearchByScopeResponse|*:SearchByScopeResult|*:Count")
PageNumber = responseXml.GetChildIntValue("*:Body|*:SearchByScopeResponse|*:SearchByScopeResult|*:PageNumber")
PageSize = responseXml.GetChildIntValue("*:Body|*:SearchByScopeResponse|*:SearchByScopeResult|*:PageSize")
Code = responseXml.getChildContent("*:Body|*:SearchByScopeResponse|*:SearchByScopeResult|*:Results|*:OrganisationSearchResultItem|*:Code")
DataManagerCode = responseXml.getChildContent("*:Body|*:SearchByScopeResponse|*:SearchByScopeResult|*:Results|*:OrganisationSearchResultItem|*:DataManagerCode")
HasActiveRegistration = responseXml.getChildContent("*:Body|*:SearchByScopeResponse|*:SearchByScopeResult|*:Results|*:OrganisationSearchResultItem|*:HasActiveRegistration")
IsLegacyData = responseXml.getChildContent("*:Body|*:SearchByScopeResponse|*:SearchByScopeResult|*:Results|*:OrganisationSearchResultItem|*:IsLegacyData")
LegalPersonName = responseXml.getChildContent("*:Body|*:SearchByScopeResponse|*:SearchByScopeResult|*:Results|*:OrganisationSearchResultItem|*:LegalPersonName")
RegistrationStatus = responseXml.getChildContent("*:Body|*:SearchByScopeResponse|*:SearchByScopeResult|*:Results|*:OrganisationSearchResultItem|*:RegistrationStatus")
TradingName = responseXml.getChildContent("*:Body|*:SearchByScopeResponse|*:SearchByScopeResult|*:Results|*:OrganisationSearchResultItem|*:TradingName")
DateTime = responseXml.getChildContent("*:Body|*:SearchByScopeResponse|*:SearchByScopeResult|*:Results|*:OrganisationSearchResultItem|*:UpdatedDate|*:DateTime")
OffsetMinutes = responseXml.GetChildIntValue("*:Body|*:SearchByScopeResponse|*:SearchByScopeResult|*:Results|*:OrganisationSearchResultItem|*:UpdatedDate|*:OffsetMinutes")
Request XML
<soap:Envelope xmlns:tra="http://training.gov.au/services/12/" xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <soap:Header/>
    <soap:Body>
        <tra:SearchByScope>
            <tra:request>
                <tra:PageNumber>1042</tra:PageNumber>
                <tra:PageSize>1042</tra:PageSize>
                <tra:Filter>string</tra:Filter>
                <tra:IncludeImplicitScope>true</tra:IncludeImplicitScope>
                <tra:IncludeLegacyData>true</tra:IncludeLegacyData>
                <tra:RegistrationManagers>
                    <arr:string>string</arr:string>
                </tra:RegistrationManagers>
                <tra:SearchTrainingPackageContents>true</tra:SearchTrainingPackageContents>
            </tra:request>
        </tra:SearchByScope>
    </soap:Body>
</soap:Envelope>
Response XML
<soap:Envelope xmlns:sys="http://schemas.datacontract.org/2004/07/System" xmlns:tra="http://training.gov.au/services/12/" xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Header/>
    <soap:Body>
        <tra:SearchByScopeResponse>
            <tra:SearchByScopeResult>
                <tra:Count>1042</tra:Count>
                <tra:PageNumber>1042</tra:PageNumber>
                <tra:PageSize>1042</tra:PageSize>
                <tra:Results>
                    <tra:OrganisationSearchResultItem>
                        <tra:Code>string</tra:Code>
                        <tra:DataManagerCode>string</tra:DataManagerCode>
                        <tra:HasActiveRegistration>true</tra:HasActiveRegistration>
                        <tra:IsLegacyData>true</tra:IsLegacyData>
                        <tra:LegalPersonName>string</tra:LegalPersonName>
                        <tra:RegistrationStatus>string</tra:RegistrationStatus>
                        <tra:TradingName>string</tra:TradingName>
                        <tra:UpdatedDate>
                            <sys:DateTime>dateTime</sys:DateTime>
                            <sys:OffsetMinutes>442</sys:OffsetMinutes>
                        </tra:UpdatedDate>
                    </tra:OrganisationSearchResultItem>
                </tra:Results>
            </tra:SearchByScopeResult>
        </tra:SearchByScopeResponse>
    </soap:Body>
</soap:Envelope>