3

We implemented a third-party API using a WSDL it provided us.

The implementation is in C# using Visual studio built-in service reference util (it takes WSDL file and create a service reference file with all services and classes)

in the reference.cs file there is a member named "CreateDate" which is of type DateTime.

The problem is that the third party API is sending us this member data with milliseconds in the format of 3 places after the dot, but when I try to send this data back to the web service the WSDL framework is deleting the last zero from the millisecond's member

for example:

the 3rd party API is sending "CreateDate="2020-03-26T07:49:05.640+00:00" the .net framework is serializing this data into c# classes. so far so good. we save this class so we can send it later to the web service we build the requests to the web service with the DateTime which is valid at this point (see debugger screenshot)

enter image description here

when I "catch" the RAW request that is being passed the value of the date-time is invalid (see screenshot)

(since I can't use fiddler for technical issues the way I catch these requests is by implementing a MessageInspector class and use a debugger to inspect the System.ServiceModel.Channels.Message before it's sent to the web service)

enter image description here

when I send this data I get an error from the web service since they have validation on that field.

somewhere, after my control, the .net serializer (I guess) is transforming a DateTime class into a string\stream with different value

any suggestion will help

thanks

Dardar
  • 624
  • 3
  • 13
  • 30
  • *.net framework will delete the last zero if this is a multiple of 10* this is not possible, or at least I cannot reproduce this. 640 milliseconds != 64 milliseconds and .net will not in any case shorten the field like that. I'd suggest, 1) take a screenshot of what you see in debugger and update the question. 2) Inspect the WCF response using fiddler and confirm the create date is correct. – weichch Apr 13 '20 at 04:31
  • @weichch thx a lot for the feedback. I've edited the question since I got some things wrong and added screenshots – Dardar Apr 13 '20 at 07:59

0 Answers0