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
var os = require('os');
if (os.platform() == 'win32') {  
    if (os.arch() == 'ia32') {
        var chilkat = require('@chilkat/ck-node21-win-ia32');
    } else {
        var chilkat = require('@chilkat/ck-node21-win64'); 
    }
} else if (os.platform() == 'linux') {
    if (os.arch() == 'arm') {
        var chilkat = require('@chilkat/ck-node21-arm');
    } else if (os.arch() == 'x86') {
        var chilkat = require('@chilkat/ck-node21-linux32');
    } else {
        var chilkat = require('@chilkat/ck-node21-linux64');
    }
} else if (os.platform() == 'darwin') {
    if (os.arch() == 'arm64') {
        var chilkat = require('@chilkat/ck-node21-mac-m1');
    } else {
        var chilkat = require('@chilkat/ck-node21-macosx');
    }
}


function chilkatExample() {

    var xml = new chilkat.Xml();
    xml.Tag = "soapenv:Envelope";
    xml.AddAttribute("xmlns:awd","http://www.wcc.nrcs.usda.gov/ns/awdbWebService");
    xml.AddAttribute("xmlns:soapenv","http://schemas.xmlsoap.org/soap/envelope/");
    xml.UpdateChildContent("soapenv:Header","");
    xml.UpdateChildContent("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. 
    xml.EmitXmlDecl = false;
    var soapRequestBody = xml.GetXml();

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

    var http = new chilkat.Http();

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

    // resp: HttpResponse
    var resp = http.PostXml(endpoint,soapRequestBody,"utf-8");
    if (http.LastMethodSuccess == false) {
        console.log(http.LastErrorText);
        console.log("Failed to send SOAP request.");
        return;
    }

    // Get the XML response body.
    var responseXml = new chilkat.Xml();
    resp.GetBodyXml(responseXml);

    var statusCode = resp.StatusCode;
    console.log("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) {
        console.log(responseXml.GetXml());
        return;
    }

    console.log(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).

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

}

chilkatExample();
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>