Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 1 Jahr, 11 Monaten
Letzter Beitrag:
vor 1 Jahr, 11 Monaten
Beteiligte Autoren:
Fabrice Harari, Ericus

[WB21] XMD Documents

Startbeitrag von Ericus am 27.07.2016 17:56


I use a buffer variable to send data to a webservice where the buffer is loaded into an xmlDocument like this:

VendorData is xmlDocument = XMLOpen(stRetMessage.Payload,fromString)

The problem is this. Not necessarily all the fields are sent through to the web service, which is fine. However, when the VendorData is loaded as above and you want to update the Vendor table, it automatically sees all the fields in die xmlDocument although there is no value.

For instance, if the fields Adress, City and Zipcode was not sent in the buffer those fields are still present in the xmldocument with null values. The existing fields in the table is then replaced with the null values.

How can I check which fields was sent in the buffer and make sure only those fields are updated? The alternative is that the buffer being sent must always contain all the field values for the record regardless of whether they were changed or not.

Thanks in advance

Ericus Steyn


Hi Ericus,

how do you even know that the field content was not REALLY changed to NULL?
It seems to me that the only way would be to process the xml file by code and check if the tags for each field are present or not.

Best regards

von Fabrice Harari - am 27.07.2016 18:18
Hi Fabrice

That is what I'm saying. When you do tbe XML Open all the tags are present and all of then are null. Then they are populated by the buffer contents.

But you don't know whether the null was in the buffer or is just an empty tag of the XML document.



von Ericus - am 27.07.2016 20:27
Hi Ericus,

and what I'm saying is do NOT do an xmlOpen... use the regular text functions to check if tags are present in the xml or not (or just check it out with a text editor)...

This way you'll be sure whether the webservice is sending you all the tags with null inside or if it's the xmlOpen.
If it's the webservuice, the only solution is to modify the webservi e or ignore the null afterwards by code...

If it's the xmlOpen, then don't use XMLOpen, use extractstring, left, middle, right...

Best regards

von Fabrice Harari - am 28.07.2016 11:51
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.