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
#include <CkXml.h>
#include <CkHttp.h>
#include <CkHttpResponse.h>

void ChilkatSample(void)
    {
    CkXml xml;
    xml.put_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.put_EmitXmlDecl(false);
    const char *soapRequestBody = xml.getXml();

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

    CkHttp http;

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

    CkHttpResponse *resp = http.PostXml(endpoint,soapRequestBody,"utf-8");
    if (http.get_LastMethodSuccess() == false) {
        std::cout << http.lastErrorText() << "\r\n";
        std::cout << "Failed to send SOAP request." << "\r\n";
        return;
    }

    // Get the XML response body.
    CkXml responseXml;
    resp->GetBodyXml(responseXml);

    int statusCode = resp->get_StatusCode();
    std::cout << "response status code: " << statusCode << "\r\n";

    delete resp;

    // If the status code does not indicate succcess, then show the response XML,
    // which probably contains error information.
    if (statusCode != 200) {
        std::cout << responseXml.getXml() << "\r\n";
        return;
    }

    std::cout << responseXml.getXml() << "\r\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).

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