0

I am facing an issue where wcf response contains datetime stamp as

1978-05-20T11:12:00+2:00

I want to retrieve the response as the same like 1978-05-20T11:12:00.

Please note, this offset (+02:00 in the above example) value might change for different response. So value might be

1978-05-20T11:12:00+2:00

1978-05-20T11:12:00+5:00

1978-05-20T11:12:00+6:00

CuriousBenjamin
  • 709
  • 1
  • 9
  • 26

1 Answers1

0

Here is what I did to fix this...

update the wsdl file from

<xs:element name="start" type="xs:date"/>

to

<xs:element name="start" type="xs:string"/>

and generated the proxy.. now the returned value with using this proxy was like 1978-05-20T11:12:00+2:00 in start field. they I used string function to extract just the desired part.

Alternatively, proxy file can be updated from

[XmlAttribute( type = "Date", ElementName = "start" )]  
    public DateTime start {  
..

    }

to

[XmlAttribute( type = "string", ElementName = "start" )]  
    public string start {  
...

    } 
CuriousBenjamin
  • 709
  • 1
  • 9
  • 26