K
Kentamanos
I'm creating a webservice that basically takes multiple batches with
financial transactions in them.
Due to the various options available in each transaction (lots of optional
sections, etc.), I figured that making the list of batches an XmlElement
parameter would be easier than a custom collection type class and trying to
work out the XML serialization/de-serialization.
I created a schema to be used on the server side to do some validation of
the input. Some additional validation (beyond the scope of what a schema can
do) will be also be done on this XML input.
One issue I'm running into with this approach is returning validation errors
that are meaningul. When the client loads an XML document into the
XmlDocument class, it loses all the formatting from the original file (if
it's not happening internally at that point, it's happening when it's
serialized and de-serialized in any event).
So the webservice receives an XmlElement without the original formatting.
When I have schema validation errors for instance that I might want to
inform the client about, the errors won't refer to the original line numbers
at all (in fact, I think the entire document will be on one line).
Is there any remedy to this problem? Should I pass this as a string and
create an XmlDocument on the fly if I want to maintain the formatting?
Thanks in advance for any input, and please let me know if I need to further
explain anything.
-Kent Bowling
financial transactions in them.
Due to the various options available in each transaction (lots of optional
sections, etc.), I figured that making the list of batches an XmlElement
parameter would be easier than a custom collection type class and trying to
work out the XML serialization/de-serialization.
I created a schema to be used on the server side to do some validation of
the input. Some additional validation (beyond the scope of what a schema can
do) will be also be done on this XML input.
One issue I'm running into with this approach is returning validation errors
that are meaningul. When the client loads an XML document into the
XmlDocument class, it loses all the formatting from the original file (if
it's not happening internally at that point, it's happening when it's
serialized and de-serialized in any event).
So the webservice receives an XmlElement without the original formatting.
When I have schema validation errors for instance that I might want to
inform the client about, the errors won't refer to the original line numbers
at all (in fact, I think the entire document will be on one line).
Is there any remedy to this problem? Should I pass this as a string and
create an XmlDocument on the fly if I want to maintain the formatting?
Thanks in advance for any input, and please let me know if I need to further
explain anything.
-Kent Bowling