boondocksaint20
MIS
I have a VB.net application that I am pulling a webservice XML, and then reading it into an adapter that will push the records into a Sql Server database with the same schema as the database table it is writing to. My code works on well formed XML, the only problem is that the XML from this one Webservice does not write the elements that are nulls.
For instance, if element1 = 1, element2 = null and element3 = 3 it looks like this:
<elementtest>
<element1>1</element1>
<element3>3</element3>
</elementtest>
-----------------------------
as opposed to this:
<elementtest>
<element1>1</element1>
<element2></element2>
<element3>3</element3>
</elementtest>
----------------------------
I have a schema in a .xsd file that lists all of the complex types. Is there a way, once the XML file has been pulled from the webservice, to either edit it by filling in the elements that have nulls (as opposed to them just not being there), or to have it validated as it is pulled from the webservice? The problem is that once it tries to write to the database as it is iterating through the XML, if an element is missing, it throws an error bc it thinks element3 is really column number 2 instead of column number 3.
Thanks in advance.
For instance, if element1 = 1, element2 = null and element3 = 3 it looks like this:
<elementtest>
<element1>1</element1>
<element3>3</element3>
</elementtest>
-----------------------------
as opposed to this:
<elementtest>
<element1>1</element1>
<element2></element2>
<element3>3</element3>
</elementtest>
----------------------------
I have a schema in a .xsd file that lists all of the complex types. Is there a way, once the XML file has been pulled from the webservice, to either edit it by filling in the elements that have nulls (as opposed to them just not being there), or to have it validated as it is pulled from the webservice? The problem is that once it tries to write to the database as it is iterating through the XML, if an element is missing, it throws an error bc it thinks element3 is really column number 2 instead of column number 3.
Thanks in advance.