Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8390449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:59:24+00:00 2026-06-09T18:59:24+00:00

I am trying to access daily weather from the National Digital Forecast Database (

  • 0

I am trying to access daily weather from the National Digital Forecast Database (NDFD) using a SOAP request. The SOAP URL is

http://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.php

and the Soap action for NDFDgenByDay() is

http://graphical.weather.gov/xml/DWMLgen/wsdl/ndfdXML.wsdl#NDFDgenByDay. 

When I send the request, the xml I receive indicates that an error has occurred, and I believe it has to do with my HTTP headers. The error response is shown below.

 <?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope SOAP-    ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body><SOAP-ENV:Fault><faultcode xsi:type="xsd:string">SERVER</faultcode>    <faultactor xsi:type="xsd:string"></faultactor><faultstring xsi:type="xsd:string">format needs to be either 24 hourly or 12 hourly</faultstring><detail xsi:type="xsd:string">input     format was &quot;&quot;</detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

This error objects to the “format” value, but as shown below, my xml complies.

I am sending the request in iOS/Obj-C as shown below:

    NSString *path = [[NSBundle mainBundle] pathForResource:@"soapRequest" ofType:@"xml"];
    NSString *soapContent = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:NULL];

    NSURL *url = [NSURL URLWithString:kWeatherSOAP_URL];
    NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url];
    NSString *msgLength = [NSString stringWithFormat:@"%d", [soapContent length]];

    [theRequest addValue: @"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
    [theRequest addValue:@"NDFDgenByDay" forHTTPHeaderField:@"Name"];
    [theRequest addValue:@"ndfdXMLBinding" forHTTPHeaderField:@"Binding"];
    [theRequest addValue:@"http://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.php" forHTTPHeaderField:@"Endpoint"];
    [theRequest addValue: @"http://graphical.weather.gov/xml/DWMLgen/wsdl/ndfdXML.wsdl#NDFDgenByDay" forHTTPHeaderField:@"SoapAction"];
    [theRequest addValue:@"rpc" forHTTPHeaderField:@"Style"];
    [theRequest addValue: msgLength forHTTPHeaderField:@"Content-Length"];
    [theRequest setHTTPMethod:@"POST"];
    [theRequest setHTTPBody: [soapContent dataUsingEncoding:NSUTF8StringEncoding]];

    NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];

    if (theConnection)
        receivedData = [NSMutableData data];
    else
        NSLog(@"theConnection is NULL");

Where soapRequest.xml looks like

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
    <ns6244:NDFDgenByDay xmlns:ns6244="uri:DWMLgenByDay">
        <latitude xsi:type="xsd:string">38.99</latitude>
        <longitude xsi:type="xsd:string">-77.01</longitude>
        <startDate xsi:type="xsd:string">2012-03-12</startDate>
        <numDays xsi:type="xsd:string">7</numDays>
        <format xsi:type="xsd:string">24 hourly</format>
    </ns6244:NDFDgenByDay>
</SOAP-ENV:Body>

I am semi-confident that soapRequest.xml is correct because it is posted as sample code on the NDFD website. However, I do not know the correct way to set the HTTP headers. If anyone is familiar with this or knows what the problem is, please help me out.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T18:59:25+00:00Added an answer on June 9, 2026 at 6:59 pm

    I got your program working by changing the soapRequest.xml to the ff:

    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
        <SOAP-ENV:Body>
            <ns6244:NDFDgenByDay xmlns:ns6244="uri:DWMLgenByDay">
                <latitude xsi:type="xsd:decimal">38.99</latitude>
                <longitude xsi:type="xsd:decimal">-77.01</longitude>
                <startDate xsi:type="xsd:date">2012-08-07</startDate>
                <numDays xsi:type="xsd:integer">7</numDays>
                <Unit xsi:type="xsd:string">m</Unit>
                <format xsi:type="xsd:string">24 hourly</format>
            </ns6244:NDFDgenByDay>
        </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to access all the data from database listOfFolder table folder and
Trying to access locally http://mysite.dev/gii but I'm getting: Gii Unable to resolve the request
Trying to access an old c++ dll from c# using Dll Import. Been searching
trying to access http://forum.worldoftanks.eu/index.php?app=members using apache HttpClient but keep getting 403. Can anyone help
Trying to access a Servlet from a button on HTML page //Html Page FORM
When trying to access the database, I am unable to access the column. I
Im trying to access a Sql CE 2005 database on a windows mobile device
Hi I'm trying to access a WCF service which returns a JSON Array using
I'm trying to access the resources of a derived abstract class (from PhoneApplicationPage) in
I am using the pgbackups addon from Heroku and trying to figure out what

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.