Select to view content in your preferred language

Help-Poll an External Website for XML

1758
4
03-27-2019 12:04 AM
HaticeKorkulu2
Occasional Contributor

Hi, I am trying Geoevent input connector which is Poll an External Website for XML. I created an output like “Write output CSV file” and “Write to a JSON File”.

This is my XML service link http://85.105.43.165:8080/rest/p_operation=get&p_username=admin&p_password=admin&p_context=users.adm... 

When I tried to get data, I have no problem and I can access from Geoevent server. The problem is that I could not get value. My all fields are null where you can see below in .json file and there is no value just a field separator(,) in my .csv file. Do you have any idea? What am I missing? or Is not my service suitable for Geoevent?  

4 Replies
EarlMedina
Esri Regular Contributor

Hi there Hatice,

If I understand you correctly, you're able to see the Input counts rise but the output is the problem?

I wonder if perhaps you need to refine the connector to use records or record as an XML Object name. To set that, you'd go to the Input properties > Advanced - there you will find the field XML Object Name.

-Earl

0 Kudos
HaticeKorkulu2
Occasional Contributor

Hi Earl, 

You are right, I am able to see input and output counts rise but I could not see a value inside of my files. ( you can see my output .jpeg what I mean ) and also I try XML object name but it does not work.

Hati

0 Kudos
DanielCota1
Frequent Contributor

Hi Hatice Korkulu

I took a look at your XML and ran a few internal tests. In each attempt, I was met with the inability to parse the XML past the point of the "records" element. Because it is nested AND makes the field names a property of the value tag, it becomes difficult for Geoevent to read the relevant values. Another staff member also took a look and they suggested that using a field mapper may work to flatten the nested XML structure, but even so, Geoevent does not recognize anything past the first "uid" field. Presumably, this is because the names of each field are all properties of the tag and not tags themselves. 

In short, the structure of this XML does not seem to be compatible with GeoEvent. If it is at all in the realm of possibility to get the data reformatted, like the example below, then GeoEvent should not have an issues with it. Otherwise, we may be at an impasse here.

<records>

   <uid>###</uid>

   <tstres>###</tstres>
   <temperature>###</temperature>

   <humidity>###</humidity>

   <shumidity>###</shumidity>

   <Lati>###</Lati>

   <long>###</long>

</records>

NathanKoski
Regular Contributor

Hi Daniel,

I am having similar issues to Hatice, and I am curious if you think that my XML structure is also to blame. It also includes a value as apart of the attributes name.

My input XML is structured like:

<Placemark>

        <ExtendedData xmlns:data="eventdata">
               <data:deviceID>262</data:deviceID>

               <data:speedKPH>0.0</data:speedKPH>

               ...

        </ExtendedData>

        <Point>
               <coordinates>...</coordinates>
         </Point> 

</Placemark>

And every time I poll, even if I set ExtendedData to be my root object which flattens the Definition, all my outputs for ExtendData are null, but for my Point group the output works fine.

However, that confusing part is that if I turn on "Learning Mode" it polls a single event and just one event, and everything for that one event is filled in properly. Do you know why this could be

Thanks!

EDIT:

I figured out my problem. The GeoEvent auto-generated definitions were not including the xml name space of those attributes, in this case, it is: data

By changing all of the attributes to include the namespace, like deviceID to data:deviceID, it works fine.

Thanks to this blog for pointing out that you manually have to specify your namespaces in the definitions:

https://community.esri.com/community/gis/enterprise-gis/geoevent/blog/2019/06/12/working-with-xml-da...

Still unsure why in Learning Mode it was able to read them, but never the less it is working now.

0 Kudos