SOAP WSDL Generate Code

AwdbWebServiceSoapBinding / getForecastEquations

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
Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set outFile = fso.CreateTextFile("output.txt", True)

set xml = CreateObject("Chilkat_9_5_0.Xml")
xml.Tag = "soapenv:Envelope"
success = xml.AddAttribute("xmlns:awd","http://www.wcc.nrcs.usda.gov/ns/awdbWebService")
success = xml.AddAttribute("xmlns:soapenv","http://schemas.xmlsoap.org/soap/envelope/")
xml.UpdateChildContent "soapenv:Header",""
xml.UpdateChildContent "soapenv:Body|awd:getForecastEquations|awd:stationTriplet","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 = 0
soapRequestBody = xml.GetXml()

endpoint = "https://wcc.sc.egov.usda.gov/awdbWebService/services"
soapAction = ""
'  For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"
contentType = "text/xml"

set http = CreateObject("Chilkat_9_5_0.Http")

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

' resp is a Chilkat_9_5_0.HttpResponse
Set resp = http.PostXml(endpoint,soapRequestBody,"utf-8")
If (http.LastMethodSuccess = 0) Then
    outFile.WriteLine(http.LastErrorText)
    outFile.WriteLine("Failed to send SOAP request.")
    WScript.Quit
End If

' Get the XML response body.
set responseXml = CreateObject("Chilkat_9_5_0.Xml")
success = resp.GetBodyXml(responseXml)

statusCode = resp.StatusCode
outFile.WriteLine("response status code: " & statusCode)

' If the status code does not indicate succcess, then show the response XML,
' which probably contains error information.
If (statusCode <> 200) Then
    outFile.WriteLine(responseXml.GetXml())
    WScript.Quit
End If

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

comment = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:comment")
dataSource = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:dataSource")
elementCd = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:elementCd")
coefficient = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:equationTerms|*:coefficient")
dataPeriodDays = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:equationTerms|*:dataPeriodDays")
dataPeriodMonth = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:equationTerms|*:dataPeriodMonth")
dataYearFlag = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:equationTerms|*:dataYearFlag")
beginDate = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:equationTerms|*:stationElement|*:beginDate")
dataPrecision = responseXml.GetChildIntValue("*:Body|*:getForecastEquationsResponse|*:return|*:equationTerms|*:stationElement|*:dataPrecision")
duration = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:equationTerms|*:stationElement|*:duration")
elementCd = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:equationTerms|*:stationElement|*:elementCd")
endDate = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:equationTerms|*:stationElement|*:endDate")
unitCd = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:equationTerms|*:stationElement|*:heightDepth|*:unitCd")
value = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:equationTerms|*:stationElement|*:heightDepth|*:value")
ordinal = responseXml.GetChildIntValue("*:Body|*:getForecastEquationsResponse|*:return|*:equationTerms|*:stationElement|*:ordinal")
originalUnitCd = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:equationTerms|*:stationElement|*:originalUnitCd")
stationTriplet = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:equationTerms|*:stationElement|*:stationTriplet")
storedUnitCd = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:equationTerms|*:stationElement|*:storedUnitCd")
unitCd = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:equationTerms|*:unitCd")
upstreamForecast = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:equationTerms|*:upstreamForecast")
footnotes = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:footnotes")
forecastCondition = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:forecastCondition")
forecastPeriod = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:forecastPeriod")
forecastType = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:forecastType")
v_function = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:function")
functionArgument = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:functionArgument")
interceptConstant = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:interceptConstant")
key = responseXml.GetChildIntValue("*:Body|*:getForecastEquationsResponse|*:return|*:key")
maxOfRecord = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:maxOfRecord")
minOfRecord = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:minOfRecord")
monthlyCorrelationCoefficients = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:monthlyCorrelationCoefficients")
monthlyStderrValues = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:monthlyStderrValues")
name = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:name")
day = responseXml.GetChildIntValue("*:Body|*:getForecastEquationsResponse|*:return|*:publicationMonthsAndDays|*:day")
month = responseXml.GetChildIntValue("*:Body|*:getForecastEquationsResponse|*:return|*:publicationMonthsAndDays|*:month")
published = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:published")
stationTriplet = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:stationTriplet")
transformErrorsOnly = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:transformErrorsOnly")
unitCd = responseXml.GetChildContent("*:Body|*:getForecastEquationsResponse|*:return|*:unitCd")

outFile.Close
Request XML
<soapenv:Envelope xmlns:awd="http://www.wcc.nrcs.usda.gov/ns/awdbWebService" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Header/>
    <soapenv:Body>
        <awd:getForecastEquations>
            <awd:stationTriplet>string</awd:stationTriplet>
        </awd:getForecastEquations>
    </soapenv:Body>
</soapenv:Envelope>
Response XML
<soapenv:Envelope xmlns:awd="http://www.wcc.nrcs.usda.gov/ns/awdbWebService" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Header/>
    <soapenv:Body>
        <awd:getForecastEquationsResponse>
            <awd:return>
                <awd:comment>string</awd:comment>
                <awd:dataSource>string</awd:dataSource>
                <awd:elementCd>string</awd:elementCd>
                <awd:equationTerms>
                    <awd:coefficient>99.0</awd:coefficient>
                    <awd:dataPeriodDays>string</awd:dataPeriodDays>
                    <awd:dataPeriodMonth>string</awd:dataPeriodMonth>
                    <awd:dataYearFlag>string</awd:dataYearFlag>
                    <awd:stationElement>
                        <awd:beginDate>string</awd:beginDate>
                        <awd:dataPrecision>1042</awd:dataPrecision>
                        <awd:duration>DAILY</awd:duration>
                        <awd:elementCd>string</awd:elementCd>
                        <awd:endDate>string</awd:endDate>
                        <awd:heightDepth>
                            <awd:unitCd>string</awd:unitCd>
                            <awd:value>99.0</awd:value>
                        </awd:heightDepth>
                        <awd:ordinal>1042</awd:ordinal>
                        <awd:originalUnitCd>string</awd:originalUnitCd>
                        <awd:stationTriplet>string</awd:stationTriplet>
                        <awd:storedUnitCd>string</awd:storedUnitCd>
                    </awd:stationElement>
                    <awd:unitCd>string</awd:unitCd>
                    <awd:upstreamForecast>true</awd:upstreamForecast>
                </awd:equationTerms>
                <awd:footnotes>string</awd:footnotes>
                <awd:forecastCondition>string</awd:forecastCondition>
                <awd:forecastPeriod>string</awd:forecastPeriod>
                <awd:forecastType>string</awd:forecastType>
                <awd:function>string</awd:function>
                <awd:functionArgument>99.0</awd:functionArgument>
                <awd:interceptConstant>99.0</awd:interceptConstant>
                <awd:key>1042</awd:key>
                <awd:maxOfRecord>99.0</awd:maxOfRecord>
                <awd:minOfRecord>99.0</awd:minOfRecord>
                <awd:monthlyCorrelationCoefficients>99.0</awd:monthlyCorrelationCoefficients>
                <awd:monthlyStderrValues>99.0</awd:monthlyStderrValues>
                <awd:name>string</awd:name>
                <awd:publicationMonthsAndDays>
                    <awd:day>1042</awd:day>
                    <awd:month>1042</awd:month>
                </awd:publicationMonthsAndDays>
                <awd:published>true</awd:published>
                <awd:stationTriplet>string</awd:stationTriplet>
                <awd:transformErrorsOnly>true</awd:transformErrorsOnly>
                <awd:unitCd>string</awd:unitCd>
            </awd:return>
        </awd:getForecastEquationsResponse>
    </soapenv:Body>
</soapenv:Envelope>