AnsweredAssumed Answered

Problem Saving XML in a text field

Question asked by ArborBandricks on May 4, 2018
Latest reply on May 4, 2018 by ArborBandricks

I have an enterprise geodatabase and ArcGIS server that has editable feature services published. I've noticed odd behavior when trying to sync offline data back:

 

I am able to download, make edits/inserts using the .NET sdk, then sync back fine for most tables/feature classes. However, there is one table where I am trying to save XML into a text field and am not seeing the data come back. The table only has three simple text columns, and of course global ids and archiving tables. The three user editable fields are essentially text(200), text(200), and text(1073741822) - the last is equivalent to nchar(MAX) in sqlServer: 

If I only put basic text strings into these fields, ex. ReportID =  "testValue1", DisplayName = "testValue2", LayoutData = "testValue3", I can get this to sync back to the server just fine. However, I need the last field (LayoutData) to store XML. Whenever I add XML to this field - it will not show up on the sever. It will run the sync task and say "sync successful" and does not through any errors but the data does not make it back. I can still see my edits which include the XML I added to the field in my local copy of the mobile geodatabase (sqlLite), but it never shows up on the server. Again, if I just put a simple text string in here it works just fine. 

 

If I edit the XML string that is put into that field (for example, add a few spaces) which essentially makes it invalid XML, it will sync back, as it apparently see this invalid XML as a plain string. But when the XML is valid XML, it will not sync back to the server - with no error telling me why!?

 

Does esri not allow XML to be stored in a field in a table of a geodatabase? If not, what is the recommended work around?

 

I have verified that this is not a code problem related to the sync (since it works fine with plain text) and have narrowed it down to the Valid vs. Invalid XML as the issue. It will sync perfectly with everything but the valid XML. 

 

Thanks for any assistance!

Outcomes