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
xml: HCkXml;
soapRequestBody: PWideChar;
endpoint: PWideChar;
soapAction: PWideChar;
contentType: PWideChar;
http: HCkHttp;
resp: HCkHttpResponse;
responseXml: HCkXml;
statusCode: Integer;
comment: PWideChar;
dataSource: PWideChar;
elementCd: PWideChar;
coefficient: PWideChar;
dataPeriodDays: PWideChar;
dataPeriodMonth: PWideChar;
dataYearFlag: PWideChar;
beginDate: PWideChar;
dataPrecision: Integer;
duration: PWideChar;
endDate: PWideChar;
unitCd: PWideChar;
value: PWideChar;
ordinal: Integer;
originalUnitCd: PWideChar;
stationTriplet: PWideChar;
storedUnitCd: PWideChar;
upstreamForecast: PWideChar;
footnotes: PWideChar;
forecastCondition: PWideChar;
forecastPeriod: PWideChar;
forecastType: PWideChar;
v_function: PWideChar;
functionArgument: PWideChar;
interceptConstant: PWideChar;
key: Integer;
maxOfRecord: PWideChar;
minOfRecord: PWideChar;
monthlyCorrelationCoefficients: PWideChar;
monthlyStderrValues: PWideChar;
name: PWideChar;
day: Integer;
month: Integer;
published: PWideChar;
transformErrorsOnly: PWideChar;
begin
xml := CkXml_Create();
CkXml_putTag(xml,'soapenv:Envelope');
CkXml_AddAttribute(xml,'xmlns:awd','http://www.wcc.nrcs.usda.gov/ns/awdbWebService');
CkXml_AddAttribute(xml,'xmlns:soapenv','http://schemas.xmlsoap.org/soap/envelope/');
CkXml_UpdateChildContent(xml,'soapenv:Header','');
CkXml_UpdateChildContent(xml,'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.
CkXml_putEmitXmlDecl(xml,False);
soapRequestBody := CkXml__getXml(xml);
endpoint := 'https://wcc.sc.egov.usda.gov/awdbWebService/services';
soapAction := '';
// For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"
contentType := 'text/xml';
http := CkHttp_Create();
CkHttp_ClearHeaders(http);
CkHttp_SetRequestHeader(http,'Content-Type',contentType);
CkHttp_SetRequestHeader(http,'SOAPAction',soapAction);
resp := CkHttp_PostXml(http,endpoint,soapRequestBody,'utf-8');
if (CkHttp_getLastMethodSuccess(http) = False) then
begin
Memo1.Lines.Add(CkHttp__lastErrorText(http));
Memo1.Lines.Add('Failed to send SOAP request.');
Exit;
end;
// Get the XML response body.
responseXml := CkXml_Create();
CkHttpResponse_GetBodyXml(resp,responseXml);
statusCode := CkHttpResponse_getStatusCode(resp);
Memo1.Lines.Add('response status code: ' + IntToStr(statusCode));
CkHttpResponse_Dispose(resp);
// If the status code does not indicate succcess, then show the response XML,
// which probably contains error information.
if (statusCode <> 200) then
begin
Memo1.Lines.Add(CkXml__getXml(responseXml));
Exit;
end;
Memo1.Lines.Add(CkXml__getXml(responseXml));
// 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).
comment := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:comment');
dataSource := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:dataSource');
elementCd := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:elementCd');
coefficient := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:coefficient');
dataPeriodDays := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:dataPeriodDays');
dataPeriodMonth := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:dataPeriodMonth');
dataYearFlag := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:dataYearFlag');
beginDate := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:stationElement|*:beginDate');
dataPrecision := CkXml_GetChildIntValue(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:stationElement|*:dataPrecision');
duration := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:stationElement|*:duration');
elementCd := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:stationElement|*:elementCd');
endDate := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:stationElement|*:endDate');
unitCd := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:stationElement|*:heightDepth|*:unitCd');
value := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:stationElement|*:heightDepth|*:value');
ordinal := CkXml_GetChildIntValue(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:stationElement|*:ordinal');
originalUnitCd := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:stationElement|*:originalUnitCd');
stationTriplet := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:stationElement|*:stationTriplet');
storedUnitCd := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:stationElement|*:storedUnitCd');
unitCd := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:unitCd');
upstreamForecast := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:equationTerms|*:upstreamForecast');
footnotes := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:footnotes');
forecastCondition := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:forecastCondition');
forecastPeriod := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:forecastPeriod');
forecastType := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:forecastType');
v_function := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:function');
functionArgument := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:functionArgument');
interceptConstant := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:interceptConstant');
key := CkXml_GetChildIntValue(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:key');
maxOfRecord := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:maxOfRecord');
minOfRecord := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:minOfRecord');
monthlyCorrelationCoefficients := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:monthlyCorrelationCoefficients');
monthlyStderrValues := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:monthlyStderrValues');
name := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:name');
day := CkXml_GetChildIntValue(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:publicationMonthsAndDays|*:day');
month := CkXml_GetChildIntValue(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:publicationMonthsAndDays|*:month');
published := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:published');
stationTriplet := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:stationTriplet');
transformErrorsOnly := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:transformErrorsOnly');
unitCd := CkXml__getChildContent(responseXml,'*:Body|*:getForecastEquationsMultipleResponse|*:return|*:unitCd');
CkXml_Dispose(xml);
CkHttp_Dispose(http);
CkXml_Dispose(responseXml);
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>