Hiyas,
Using VS .net 2003.
Setting up a Webservice that accepts 3rd party vendor designed XML requests
and returns a filled XMLDocument with response data.
Vendor XSDs were serialize into class objects to be used in the program.
EX: Used xsd.exe to turn VendorA_Request.XSD into VendorA_Request.cs
EX: Used xsd.exe to turn VendorA_Response.XSD into VendorA_Response.cs
etc etc..
Program logic is like this:
Webservice accepts an XML request as a string.
Deserialize the string into its appropriate request class object.
Run the request class through business logic and produce result class.
Serialize the result class into response XML document object to be returned.
Webservice returns the XMLDocument.
Problem:
Vendor XML schema verification is failing because the return date format are
incorrect.
Correct date format is
date1="2006-01-01T00:00:00"
My return XML date format is
date1="2006-01-01T00:00:00.0000000-05:00"
Because the XMLDocument object being returned is generated by serializing a
class object, I'm not sure how to get the correct formatting.
After hours of googling:
http://support.microsoft.com/default...b;en-us;811767
But that solution is assuming modification of the date format upon output.
Since the XMLDocument is not being outputted but is returning to the caller,
the solution does not work.
How should I go about correcting the date formatting inside the XMLDocument?
Modify the class datatype from DateTime?
Modify the serilization method to override the default datetime format?
Loop through the XMLDocument and update the date formatting before returning
it?
Use XSLT to produce a new XMLDocument with the correct format?
Any help will be greatly appreciated.
-RJA