Hello, i have a task to receive messages in XML in geoevent

3835
2
12-16-2015 11:35 AM
Highlighted
New Contributor

The goal is to receive messages in XML. I configured connector Receive XML on a REST Endpoint. But through the monitor GEP can see that the message does not come. I sent the same message using the Firefox Poster - message came. We looked at the traffic using Wireshark. Notifications different headings. In both cases, GEP responds 200 OK. Please tell me - what could be wrong. What immediately catches the eye - it is one message HTTP / 1.0 and other HTTP / 1.1

Request that comes from an external system and enters the GEP

POST / geoevent / rest / receiver / e5fca6b5-ecf3-4853-81af-1815d4620f91 HTTP / 1.0

Host: 91.242.171.9: 6180

User-Agent: SOAP Sender v1.2

Content-Length: 408

Content-Type: text / xml

Connection: Close

Pragma: no-cache

<? xml version = "1.0" encoding = "windows-1251"?>

<soapenv: Envelope xmlns: soapenv = "http://schemas.xmlsoap.org/soap/envelope" xmlns: ws = "http://schemas.xmlsoap.org/soap/ws">

<soapenv: Header />

<soapenv: Body>

<ws: PutCoord>

<ObjectID> 214168 </ ObjectID>

<Coord time = "2015-12-08T13: 24: 20Z" lon = "66.6379" lat = "66.5293" alt = "0" speed = "0" dir = "276" valid = "1" />

</ ws: PutCoord>

</ soapenv: Body>

</ soapenv: Envelope>

HTTP / 1.1 200 OK

Content-Length: 0

Date: Tue, 08 Dec 2015 13:24:23 GMT

Server: ArcGIS GeoEvent Extension for Server 10.3.0

Inquiry held in GEP, made by Poster

POST / geoevent / rest / receiver / e5fca6b5-ecf3-4853-81af-1815d4620f91 HTTP / 1.1

Host: 91.242.171.9:6180

User-Agent: Mozilla / 5.0 (Windows NT 6.3; WOW64; rv: 42.0) Gecko / 20100101 Firefox / 42.0

Accept: text / html, application / xhtml xml, application / xml; q = 0.9, * / *; q = 0.8

Accept-Language: ru-RU, ru; q = 0.8, en-US; q = 0.5, en; q = 0.3

Accept-Encoding: gzip, deflate

Content-Type: text / xml; charset = UTF-8

Content-Length: 398

Connection: keep-alive

Pragma: no-cache

Cache-Control: no-cache

<? xml version = "1.0" encoding = "windows-1251"?>

<soapenv: Envelope xmlns: soapenv = "http://schemas.xmlsoap.org/soap/envelope" xmlns: ws = "http://schemas.xmlsoap.org/soap/ws">

<soapenv: Header />

<soapenv: Body>

<ws: PutCoord>

<ObjectID> 442 419 </ ObjectID>

<Coord time = "2015-12-08T13: 05: 29Z" lon = "66.6279" lat = "66.5296" alt = "0" speed = "29" dir = "275" valid = "1" />

</ ws: PutCoord>

</ soapenv: Body>

</ soapenv: Envelope> HTTP / 1.1 200 OK

Content-Length: 0

Date: Tue, 08 Dec 2015 13:21:48 GMT

Server: ArcGIS GeoEvent Extension for Server 10.3.0

Reply
0 Kudos
2 Replies
Highlighted
New Contributor II

Hi Alena,

HTTP 200 OK response simply means that the request has been successfully received. It doesn't necessarily mean that it would be successfully processed by GeoEvent. You can check if GeoEvent is successfully able to auto-generate the associated geoevent definition. If not, then this means that it wasn't able to parse the incoming geoevent. Check for any sort of parsing errors in GeoEvent logs.

Reply
0 Kudos
Highlighted
Esri Regular Contributor

Hello Alena -

I see several references to SOAP in the XML you included in the body of your post. While SOAP is XML ... it is not the sort of XML the GeoEvent 'Receive XML on a REST Endpoint' input expects to recieve. Please take a look at the thread SOAP Input​ for some notes on the differences between the JSON expected from a REST request and the XML response expected from a SOAP request. You might also find the discussion on the thread Re: XML to Geoevent and Convert string to geometry​ helpful.

The GeoEvent XML inbound adapter actually attempts to convert XML it receives to JSON using a 3rd party library. This can present some challenges, especially if the names of attributes within a tag conflict with other tags in the XML structure.

Here's some sample XML which can be posted to a GeoEvent 'Receive XML on a REST Endpoint' input.

<?xml version="1.0" encoding="utf-8"?>

<assetLocationUpdate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://sky.customer.com/linehaulAutomation/schema">

  <userId xmlns="http://sky.customer.com/linehaulAutomation/techarch/schema">LocationDataServer</userId>

  <userLocation xmlns="http://sky.customer.com/linehaulAutomation/techarch/schema">9999</userLocation>

  <transmitDate xmlns="http://sky.customer.com/linehaulAutomation/techarch/schema">2014-05-30T18:11:01Z</transmitDate>

  <locatorId xmlns="">10027878</locatorId>

  <dateUTC xmlns="">2014-05-30T18:11:00Z</dateUTC>

  <coordinate xmlns="">

    <latitude xmlns="http://sky.customer.com/linehaulAutomation/common/schema">35.7336426</latitude>

    <longitude xmlns="http://sky.customer.com/linehaulAutomation/common/schema">-80.85889</longitude>

  </coordinate>

  <altitude xmlns="">272</altitude>

  <bearing xmlns="">174</bearing>

  <speed xmlns="">0</speed>

  <odometer xmlns="">195638910</odometer>

  <powerPresent xmlns="">true</powerPresent>

  <vehicleVoltage xmlns="">13.115</vehicleVoltage>

  <batteryVoltage xmlns="">4.447</batteryVoltage>

  <batteryRemaining xmlns="">100</batteryRemaining>

  <batteryDaysRemaining xmlns="">42</batteryDaysRemaining>

  <temperature xmlns="">37</temperature>

  <radioRssi xmlns="">-77</radioRssi>

  <messageReason xmlns="">1</messageReason>

  <geofenceId xmlns="">0</geofenceId>

  <analogInput xmlns="">0.027</analogInput>

  <digitalIO1 xmlns="">false</digitalIO1>

  <digitalIO2 xmlns="">false</digitalIO2>

  <digitalIO3 xmlns="">false</digitalIO3>

  <gpsSatelliteCount xmlns="">7</gpsSatelliteCount>

  <firmwareVersion xmlns="">118</firmwareVersion>

  <configVersion xmlns="">8</configVersion>

  <geofenceHash xmlns="">666094417</geofenceHash>

</assetLocationUpdate>

Using the assetLocationUpdate tag as the root node, notice how the sample XML structure above translates into JSON:

[{

  "batteryDaysRemaining" : {

    "content" : 42,

    "xmlns" : ""

  },

  "locatorId" : {

    "content" : 10027878,

    "xmlns" : ""

  },

  "altitude" : {

    "content" : 272,

    "xmlns" : ""

  },

  "digitalIO3" : {

    "content" : false,

    "xmlns" : ""

  },

  "digitalIO2" : {

    "content" : false,

    "xmlns" : ""

  },

  "dateUTC" : {

    "content" : 1401473460000,

    "xmlns" : ""

  },

  "batteryVoltage" : {

    "content" : 4.447,

    "xmlns" : ""

  },

  "digitalIO1" : {

    "content" : false,

    "xmlns" : ""

  },

  "transmitDate" : {

    "content" : 1401473461000,

    "xmlns" : "http://sky.customer.com/linehaulAutomation/techarch/schema"

  },

  "temperature" : {

    "content" : 37.0,

    "xmlns" : ""

  },

  "userLocation" : {

    "content" : "9999",

    "xmlns" : "http://sky.customer.com/linehaulAutomation/techarch/schema"

  },

  "userId" : {

    "content" : "LocationDataServer",

    "xmlns" : "http://sky.customer.com/linehaulAutomation/techarch/schema"

  },

  "firmwareVersion" : {

    "content" : 118,

    "xmlns" : ""

  },

  "messageReason" : {

    "content" : 1,

    "xmlns" : ""

  },

  "vehicleVoltage" : {

    "content" : 13.115,

    "xmlns" : ""

  },

  "radioRssi" : {

    "content" : -77,

    "xmlns" : ""

  },

  "xmlns:xsd" : "http://www.w3.org/2001/XMLSchema",

  "geofenceHash" : {

    "content" : 666094417,

    "xmlns" : ""

  },

  "speed" : {

    "content" : 0.0,

    "xmlns" : ""

  },

  "coordinate" : {

    "longitude" : {

      "content" : -80.85889,

      "xmlns" : "http://sky.customer.com/linehaulAutomation/common/schema"

    },

    "latitude" : {

      "content" : 35.7336426,

      "xmlns" : "http://sky.customer.com/linehaulAutomation/common/schema"

    },

    "xmlns" : ""

  },

  "odometer" : {

    "content" : 195638910,

    "xmlns" : ""

  },

  "xmlns" : "http://sky.customer.com/linehaulAutomation/schema",

  "gpsSatelliteCount" : {

    "content" : 7,

    "xmlns" : ""

  },

  "analogInput" : {

    "content" : 0.027,

    "xmlns" : ""

  },

  "bearing" : {

    "content" : 174,

    "xmlns" : ""

  },

  "xmlns:xsi" : "http://www.w3.org/2001/XMLSchema-instance",

  "batteryRemaining" : {

    "content" : 100.0,

    "xmlns" : ""

  },

  "configVersion" : {

    "content" : 8,

    "xmlns" : ""

  },

  "geofenceId" : {

    "content" : 0,

    "xmlns" : ""

  },

  "powerPresent" : {

    "content" : true,

    "xmlns" : ""

  }

}]

Hope this information is helpful -

RJ

Reply
0 Kudos