1. Roland Smith
  2. PowerBuilder
  3. Thursday, 11 July 2019 13:47 PM UTC

I have a process where data is exported from a datawindow and then another app with the same datawindow imports the data. There are two apps communicating with each other over the network.

Using ExportJson & ImportJson methods in PB 2017 or 2019 this works great.

I wanted to do the same in a PB 12.x version using the XML format but I am getting errors.

App 1 gets the data into a string:

ls_data = this.Object.DataWindow.Data.XML

App 2 receives the data and does an ImportString:

ll_result = dw_employees.ImportString(ls_data, XML!)

---------------------------
DataWindow Error
---------------------------
Item '' does not pass the validation test.
---------------------------
OK
---------------------------

 

I tried saving a default XML import template but that had no effect.

What is the secret to importing XML?

 

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 11 July 2019 14:01 PM UTC
  2. PowerBuilder
  3. # 1

Hi Roland;

   Have you tried the SaveAs(XML!) option instead of the DOT notation? The XML route should work though either way as long as the column definitions are the same between the two DWO's.

Regards ... Chris

Comment
  1. Roland Smith
  2. Thursday, 11 July 2019 14:05 PM UTC
SaveAs would create a file. The two DataWindow objects are exactly the same.
  1. Helpful
There are no comments made yet.
David Peace (Powersoft) Accepted Answer Pending Moderation
  1. Thursday, 11 July 2019 15:50 PM UTC
  2. PowerBuilder
  3. # 2

Hi Roland

Is it something to with null values producing empty or missing tags? I've used the saveas XML and imported it quite easily but must admit I have not tried what you are suggesting. On the face of it I cannot see when it would not work, so must be something quirky.

Not much help, but it's late and I'm lacking in inspiration....

Regards

David

Comment
  1. Roland Smith
  2. Friday, 12 July 2019 16:45 PM UTC
I ended up coding a function that produces tabbed text with quotes around all non-numeric columns. It is shorter than JSON and since I know that the two DataWindow objects are identical, I don't need column names in it.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.