-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can i control the DateTime format sent to the UAPI ? (WCF serializer ) #203
Comments
Hi dardar4, CreateDate is a optional attribute and even if you do not send this attribute, the request will work absolutely fine. To get around the WCF Serialization issue, you can try using this workaround. Thanks. |
Hi @vivekjyotipramanik How can I not send this attribute? also, regarding the link you posted - I've read it already in my search for an answer. thanks Amir |
Hi dardar4, Instead of just assigning the complete object, I would rather prefer to send only the required attributes of the objects, by assigning each field separately. In this way, the paylod will be lighter as well and In this way, you can only take the required fields and chose to ignore optional attributes. Please find below an example. Thanks. public class Object{ Object obj1 = new Object("Test1", "Test2"); Instead of, Object obj2 = obj1 I would do, Object ob2 = new Object{ |
Hi, I understand what you trying to say but since I need to send the same object I'm getting in the SeatMapRsp (the entire OptionalService) it seems very inefficient to manually copy all elements in from 1 object to the same one, only to avoid a single DateTime member. however, I think I found another solution. I noticed that there is also a boolean member that is called CreateDateSpecified and if I set it to false this member is being ignored and not transferred to the UAPI Edit: OR avoiding the CreateDate at all
the later one is more "elegant" in my opinion thanks Amir |
Hi dardar4, I would prefer against copying complete object, as by copying only needed and required field, we can make the payload of request xml lighter and smaller. As per opinion as well, the CreateDateSpecified=false is more elegant approach. Thanks. |
Hi team.
I'm facing a technical issue when implementing a solution to the UAPI using .net framework.
just to be clear - we have a working application (again, in .net c#) that uses the UAPI and it is working well except one issue.
We are using your WSDL (uAPI_WSDLschema_Release-V19.2.0.12) in order to create a service reference in visual studio 2017
this service reference is creating a reference.cs file with all the data members needed to call the UAPI service.
Our problem is with the AirMerchandisingFulfillment service.
one of the elements in the requests is called CreateDate (which can be found at AirMerchandisingFulfillmentReq\OptionalServices\OptionalService\CreateDate) and it's of type DateTime
in the reference.cs file there is a class:
public partial class OptionalService : object, System.ComponentModel.INotifyPropertyChanged
and one of its members is the CreateDate:
So far all is good.
When I build the request I use the same values returned to me in the SeatMapRsp.
I took a snapshot of the CreateDate member in the request
you can see that in the debug mode the CreateDate milliseconds part is "520"
BUT, and this is the issue, When I send this the UAPI it seems the .Net WCF serializer is trimming the last zero from the milliseconds, if possible and when I inspect the RAW data that is being transferred to the UAPI it seems like this:
i.e. instead of sending "2020-04-13T09:59:22.520+03:00" it is sending "2020-04-13T09:59:22.52+03:00"
this is an issue since the UAPI has some kind of validation that check the format of the DateTime and this will cause a failure.
Have your team faced this issue before? maybe other developers also used .net to implement the UAPI and already resolved this issue?
plz advise ASAP
there is also an open case in "MyTravelport" (CS0649249) but I thought this is a more technical place to address this issue
thanks
Amir
The text was updated successfully, but these errors were encountered: