Closed dteske25 closed 4 years ago
I see that could definitely help out with your case, however I think I see just a few problems
StepQueryResponseBase
.XmlDeserializationEvents
, and the XML get deserialized all properly. So what is the original problem here? Because without this event, it works properly to me with the EmployeeRet you provided in EmployeeQueryResponseTests
Really appreciate the quick feedback!
EmployeePayrollInfo
node are just set to their default, specifically the UseTimeDataToCreatePaychecks
property. I removed the assertion that validated that it got set properly, which is why the test is now passing. I figured it wasn't worth bloating the test with the custom logic I'll need to do eventually to handle those events and get that data out.
I'll have another set of eyes looking at this.
However, I am not understanding your test; with or without the events, the UseTimeDataToCreatePaychecks and UseTimeDataToCreatePaychecksSpecified are the same values. -> NotSet
The test was simply showing that while some data is still coming through, the OnUnknownElement event handler is being called. I've added specific handling for my scenario, I just figured that wasn't something that belonged in the test.
I will be merging today, but I will revert the WebConnector part. It doesn't work, the entry point comes from QbManager.cs
.
People can still be overriding the ReceiveXMLAsync
if they want I guess.
Merged and pushed. I did some cleanup as well. Version of QbXml is 2.3.0, will be on Nuget shortly.
Sounds good, really appreciate all the feedback and the quick responses!
@dteske25 Thank you for contributing! Good luck with your project!
In relation to #47, this was all that I was able to come up with to help resolve my issues while not impacting the overall schema validation that's already in place.
By allowing the deserialization events to be passed, consumers of the package can easily implement their own error handling for issues that occur during deserialization, rather than quietly assigning null.
https://docs.microsoft.com/en-us/dotnet/api/system.xml.serialization.xmldeserializationevents?view=netframework-4.7.2