SOAP WSDL Generate Code

AwdbWebServiceSoapBinding / getForecastEquationsMultiple

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
Use ChilkatAx-9.5.0-win32.pkg

Procedure Test
    Handle hoXml
    Boolean iSuccess
    String sSoapRequestBody
    String sEndpoint
    String sSoapAction
    String sContentType
    Handle hoHttp
    Variant vResp
    Handle hoResp
    Variant vResponseXml
    Handle hoResponseXml
    Integer iStatusCode
    String sComment
    String sDataSource
    String sElementCd
    String sCoefficient
    String sDataPeriodDays
    String sDataPeriodMonth
    String sDataYearFlag
    String sBeginDate
    Integer iDataPrecision
    String sDuration
    String sEndDate
    String sUnitCd
    String sValue
    Integer iOrdinal
    String sOriginalUnitCd
    String sStationTriplet
    String sStoredUnitCd
    String sUpstreamForecast
    String sFootnotes
    String sForecastCondition
    String sForecastPeriod
    String sForecastType
    String sV_function
    String sFunctionArgument
    String sInterceptConstant
    Integer iKey
    String sMaxOfRecord
    String sMinOfRecord
    String sMonthlyCorrelationCoefficients
    String sMonthlyStderrValues
    String sName
    Integer iDay
    Integer iMonth
    String sPublished
    String sTransformErrorsOnly
    String sTemp1
    Boolean bTemp1

    Get Create (RefClass(cComChilkatXml)) To hoXml
    If (Not(IsComObjectCreated(hoXml))) Begin
        Send CreateComObject of hoXml
    End
    Set ComTag Of hoXml To "soapenv:Envelope"
    Get ComAddAttribute Of hoXml "xmlns:awd" "http://www.wcc.nrcs.usda.gov/ns/awdbWebService" To iSuccess
    Get ComAddAttribute Of hoXml "xmlns:soapenv" "http://schemas.xmlsoap.org/soap/envelope/" To iSuccess
    Send ComUpdateChildContent To hoXml "soapenv:Header" ""
    Send ComUpdateChildContent To hoXml "soapenv:Body|awd:getForecastEquationsMultiple|awd:stationTriplets" "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. 
    Set ComEmitXmlDecl Of hoXml To False
    Get ComGetXml Of hoXml To sSoapRequestBody

    Move "https://wcc.sc.egov.usda.gov/awdbWebService/services" To sEndpoint
    Move "" To sSoapAction
    //  For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"
    Move "text/xml" To sContentType

    Get Create (RefClass(cComChilkatHttp)) To hoHttp
    If (Not(IsComObjectCreated(hoHttp))) Begin
        Send CreateComObject of hoHttp
    End

    Send ComClearHeaders To hoHttp
    Send ComSetRequestHeader To hoHttp "Content-Type" sContentType
    Send ComSetRequestHeader To hoHttp "SOAPAction" sSoapAction

    Get ComPostXml Of hoHttp sEndpoint sSoapRequestBody "utf-8" To vResp
    If (IsComObject(vResp)) Begin
        Get Create (RefClass(cComChilkatHttpResponse)) To hoResp
        Set pvComObject Of hoResp To vResp
    End
    Get ComLastMethodSuccess Of hoHttp To bTemp1
    If (bTemp1 = False) Begin
        Get ComLastErrorText Of hoHttp To sTemp1
        Showln sTemp1
        Showln "Failed to send SOAP request."
        Procedure_Return
    End

    // Get the XML response body.
    Get Create (RefClass(cComChilkatXml)) To hoResponseXml
    If (Not(IsComObjectCreated(hoResponseXml))) Begin
        Send CreateComObject of hoResponseXml
    End
    Get pvComObject of hoResponseXml to vResponseXml
    Get ComGetBodyXml Of hoResp vResponseXml To iSuccess

    Get ComStatusCode Of hoResp To iStatusCode
    Showln "response status code: " iStatusCode

    Send Destroy of hoResp

    // If the status code does not indicate succcess, then show the response XML,
    // which probably contains error information.
    If (iStatusCode <> 200) Begin
        Get ComGetXml Of hoResponseXml To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    Get ComGetXml Of hoResponseXml To sTemp1
    Showln sTemp1

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

    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:comment" To sComment
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:dataSource" To sDataSource
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:elementCd" To sElementCd
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:coefficient" To sCoefficient
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:dataPeriodDays" To sDataPeriodDays
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:dataPeriodMonth" To sDataPeriodMonth
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:dataYearFlag" To sDataYearFlag
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:stationElement|*:beginDate" To sBeginDate
    Get ComGetChildIntValue Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:stationElement|*:dataPrecision" To iDataPrecision
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:stationElement|*:duration" To sDuration
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:stationElement|*:elementCd" To sElementCd
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:stationElement|*:endDate" To sEndDate
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:stationElement|*:heightDepth|*:unitCd" To sUnitCd
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:stationElement|*:heightDepth|*:value" To sValue
    Get ComGetChildIntValue Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:stationElement|*:ordinal" To iOrdinal
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:stationElement|*:originalUnitCd" To sOriginalUnitCd
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:stationElement|*:stationTriplet" To sStationTriplet
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:stationElement|*:storedUnitCd" To sStoredUnitCd
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:unitCd" To sUnitCd
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:upstreamForecast" To sUpstreamForecast
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:footnotes" To sFootnotes
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:forecastCondition" To sForecastCondition
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:forecastPeriod" To sForecastPeriod
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:forecastType" To sForecastType
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:function" To sV_function
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:functionArgument" To sFunctionArgument
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:interceptConstant" To sInterceptConstant
    Get ComGetChildIntValue Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:key" To iKey
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:maxOfRecord" To sMaxOfRecord
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:minOfRecord" To sMinOfRecord
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:monthlyCorrelationCoefficients" To sMonthlyCorrelationCoefficients
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:monthlyStderrValues" To sMonthlyStderrValues
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:name" To sName
    Get ComGetChildIntValue Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:publicationMonthsAndDays|*:day" To iDay
    Get ComGetChildIntValue Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:publicationMonthsAndDays|*:month" To iMonth
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:published" To sPublished
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:stationTriplet" To sStationTriplet
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:transformErrorsOnly" To sTransformErrorsOnly
    Get ComGetChildContent Of hoResponseXml "*:Body|*:getForecastEquationsMultipleResponse|*:return|*:unitCd" To sUnitCd


End_Procedure
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:getForecastEquationsMultiple>
            <awd:stationTriplets>string</awd:stationTriplets>
        </awd:getForecastEquationsMultiple>
    </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:getForecastEquationsMultipleResponse>
            <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:getForecastEquationsMultipleResponse>
    </soapenv:Body>
</soapenv:Envelope>