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
#import <CkoXml.h>
#import <NSString.h>
#import <CkoHttp.h>
#import <CkoHttpResponse.h>

CkoXml *xml = [[CkoXml alloc] init];
xml.Tag = @"soapenv:Envelope";
[xml AddAttribute: @"xmlns:awd" value: @"http://www.wcc.nrcs.usda.gov/ns/awdbWebService"];
[xml AddAttribute: @"xmlns:soapenv" value: @"http://schemas.xmlsoap.org/soap/envelope/"];
[xml UpdateChildContent: @"soapenv:Header" value: @""];
[xml UpdateChildContent: @"soapenv:Body|awd:getForecastEquationsMultiple|awd:stationTriplets" value: @"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 = NO;
NSString *soapRequestBody = [xml GetXml];

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

CkoHttp *http = [[CkoHttp alloc] init];

[http ClearHeaders];
[http SetRequestHeader: @"Content-Type" value: contentType];
[http SetRequestHeader: @"SOAPAction" value: soapAction];

CkoHttpResponse *resp = [http PostXml: endpoint xmlDoc: soapRequestBody charset: @"utf-8"];
if (http.LastMethodSuccess == NO) {
    NSLog(@"%@",http.LastErrorText);
    NSLog(@"%@",@"Failed to send SOAP request.");
    return;
}

// Get the XML response body.
CkoXml *responseXml = [[CkoXml alloc] init];
[resp GetBodyXml: responseXml];

int statusCode = [resp.StatusCode intValue];
NSLog(@"%@%d",@"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) {
    NSLog(@"%@",[responseXml GetXml]);
    return;
}

NSLog(@"%@",[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).

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