0

I'm invoking a SOAP web service and some fields must respect specific rules.

I have an object with a DateTime field and i want to use it as: yyyy-MM-dd HH:mm:ss.fff

The problem occurs when milliseconds value is something like 20.

The value sent to web method is something like: 2017-21-06T18:13:50.02 instead of 2017-21-06T18:13:50.020

When i'm debugging my code, the value of milliseconds is definitely .020000 but looking at SOAP envelops the value passed ignore the zeros on the right.

There is any chance to truncate milliseconds value to always use three digits?

  • You say "the problem occurs". What's the problem, exactly? – Jonathan Jun 21 '17 at 17:27
  • Is your service web method receiving this value as a parameter? or are you using a proxy class to consume a web service? how exactly you are passing the value? – Pastor Cortes Jun 21 '17 at 17:29
  • 1
    see the next link: [https://stackoverflow.com/questions/254753/what-is-the-correct-format-to-use-for-date-time-in-an-xml-file](https://stackoverflow.com/questions/254753/what-is-the-correct-format-to-use-for-date-time-in-an-xml-file) Hope this help you – Javier Jimenez Matilla Jun 21 '17 at 17:33
  • @Jonathan I mean, if milliseconds value is 125, the value passed respect the format i want: yyyy-MM-dd HH:mm:ss.fff. If it is, for example, 80, the format used is yyyy-MM-dd HH:mm:ss.ff but i need 3 digits on milliseconds. – SemliWeb Jun 21 '17 at 21:35
  • @PastørCortes I'm using a proxy class to do this – SemliWeb Jun 21 '17 at 21:38
  • @JavierJimenezMatilla Thanks. I'll check this on my side – SemliWeb Jun 21 '17 at 21:38

0 Answers0