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 xml As New Chilkat.Xml
xml.Tag = "soapenv:Envelope"
Dim success As Boolean
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 = False
Dim soapRequestBody As String
soapRequestBody = xml.GetXml()

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

Dim http As New Chilkat.Http

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

Dim resp As Chilkat.HttpResponse
resp = http.PostXml(endpoint,soapRequestBody,"utf-8")
If (http.LastMethodSuccess = False) Then
    System.DebugLog(http.LastErrorText)
    System.DebugLog("Failed to send SOAP request.")
    Return
End If

// Get the XML response body.
Dim responseXml As New Chilkat.Xml
success = resp.GetBodyXml(responseXml)

Dim statusCode As Int32
statusCode = resp.StatusCode
System.DebugLog("response status code: " + Str(statusCode))

// If the status code does not indicate succcess, then show the response XML,
// which probably contains error information.
If (statusCode <> 200) Then
    System.DebugLog(responseXml.GetXml())
    Return
End If

System.DebugLog(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).

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