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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:14:49+00:00 2026-06-15T16:14:49+00:00

I am integrating with a web service (i dont have control to this web

  • 0

I am integrating with a web service (i dont have control to this web service) using wsdl provided. While calling a method, i need to pass DateTime in request. The request needs to contain datetime in UTC format (with Z in the end). The request contains below field,

[System.Xml.Serialization.XmlElementAttribute(DataType="date", Order=0)]
public System.DateTime date
{
   get
    {
       return this.dateField;
     }
    set
    {
    this.dateField = value;
  }

Please note the xsd datatype is a date.

I construct the request to pass DateTime as Utc,

request.date = DateTime.SpecifyKind(DateTime.Parse(DateTime.Now.ToUniversalTime().ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fff'Z'")), DateTimeKind.Utc);

The problem i have is even though i pass DateTime as Utc, the soap request appears without the time zone. For eg, the request gets generated as shown below,

           <GetRequest xmlns=" http://soa.company.com/services/example/v2"> 
              <date>2001-01-01</date> 
           </GetRequest>

My expectation is to get,

           <GetRequest xmlns=" http://soa.company.com/services/example/v2"> 
              <date>2001-01-01Z</date> 
           </GetRequest>

I think this is due to roundtrip during datetime serialization. Has anybody faced this kind of issue?

  • 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-15T16:14:50+00:00Added an answer on June 15, 2026 at 4:14 pm

    Ok , Finally solved this.Link Force XmlSerializer to serialize DateTime as 'YYYY-MM-DD hh:mm:ss' was very useful. I added a string attribute similar to the one described in the link above and that seems to have fixed the issue.

    /// <remarks/>
    [System.Xml.Serialization.XmlIgnore]
    public System.DateTime date
    {
        get
        {
            return this.dateField;
        }
        set
        {
            this.dateField = value;
        }
    }
    
    /// <remarks/>
    
    [System.Xml.Serialization.XmlElementAttribute("date", Order = 0)]
    public System.String somedate
    {
        get { return this.date.ToString("yyyy'-'MM'-'dd'Z'"); }
        set { this.date = System.DateTime.Parse(value); }
    
    }
    

    However, modifying generated proxy is definitely not the preferred way.

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

Sidebar

Related Questions

I have an issue using xsd dataTime with regard to integrating a web client
I am integrating with a webservice who have provided a wsdl file to access
In our web-application we manage our continuous integration using TeamCity. So far we have
I'm developing web app using Spring Integration to route my messages, but I have
I am integrating web service that will use an HTTP-POST to request and retrieve
My application I have an application design that looks like this: web application layer
I have a simple service with a single operational contract method called Sum [OperationContact]
I have a Grails service that sends out e-mails using a 3rd-party service by
I have been trying to connect to some web services using WCF but I
I am working on a Spring web application where I have a need to

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.