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 3240628
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:06:25+00:00 2026-05-17T18:06:25+00:00

I’m trying to call a web service from .NET 3.5 using WCF. The error

  • 0

I’m trying to call a web service from .NET 3.5 using WCF. The error I’m getting currently is

An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail.

InnerException: {"Value -2147483648 for millisOfSecond must be in the range [0,999]"}

I’ve narrowed it down to two date values I’m sending. When I create the request through soapUI, and send the date values in this format:

2010-07-19T00:00:00.000Z

everything works fine, but when I call the service from .NET, it sends the dates in this format

2010-07-19T00:00:00

and it results in the error above. If I send the incorrect date in soapUI, I get the same error message. Note that these dates are required fields, so if I send nothing it puts a default date of 0001-01-01T00:00:00 in, which is still obviously in the wrong format.

How can I control how the date is sent to the web service?

  • 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-05-17T18:06:26+00:00Added an answer on May 17, 2026 at 6:06 pm

    Not sure if there’s an easier way for this (haven’t found it, yet, if it exists) – but one method of doing this would be to introduce a string field that properly formats your date, and then avoid serializing the date field directly, but instead serialize the formatted string:

    public partial class YourDataClass
    {
    
        public DateTime YourDate { get; set; }
    
        [DataMember(Name="YourDate")]
        public string FormattedDate
        {
            get { return string.Format("{0:yyyy-MM-ddTHH:mm:ss.fffZ}", YourDate);
            set { ; }
        }
    }
    

    With this, the DateTime field YourDate won’t be serialized (no [DataMember] attribute on it – assuming you’re using the DataContract serializer in WCF), while the formatted date string will be serialized as YourDate in the proper format.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to loop through a bunch of documents I have to put
I have a bunch of posts stored in text files formatted in yaml/textile (from
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm making a simple page using Google Maps API 3. My first. One marker
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have some data like this: 1 2 3 4 5 9 2 6

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.