Select to view content in your preferred language

Receive XML on a REST Endpoint Testing

127
2
2 weeks ago
MeleKoneya
Frequent Contributor

I have crated an Receive XML on a REST Endpoint connector and am trying to get an XML file to process in the service below

 

MeleKoneya_0-1755116907785.png

MeleKoneya_1-1755116990989.png

I sending an XML via Python to see if anything comes through but have not seen it working as there is nothing in in/out and sample route shows nothing.   

This is how I am sending the XML with python in ArcGIS Pro

# GeoEvent Server details
geoevent_server_url = "https://ourserver:6143" # Replace with your server URL
input_connector_name = "SFD_ipad_XML" # Replace with your input connector name
receiver_url = f"{geoevent_server_url}/geoevent/rest/receiver/{input_connector_name}"

# XML data to send
xml_data = """
<<location data>
<latitude>[33.49419124478499]</latitude>
<longitude>[-111.8995224018715]</longitude>
<date>[Jul 25, 2025 at 2:30 PM]</date>
<device_id>[EPCRM365_191 (APIPAD00096)]</device_id>
</location data>
"""

# Set the headers for the request
headers = {
"Content-Type": "application/xml"
}

try:
# Send the POST request
response = requests.post(receiver_url, data=xml_data, headers=headers, verify=False) # verify=False for self-signed certs

# Check the response status
if response.status_code == 200:
print("XML data successfully sent to GeoEvent Server.")
else:
print(f"Error sending XML data. Status code: {response.status_code}")
print(f"Response content: {response.text}")

except requests.exceptions.RequestException as e:
print(f"An error occurred: {e}")
XML data successfully sent to GeoEvent Server.

This is my first attempt at using this connector, so I may be missing something obvious.   Thank you for any assistance.

Mele

 

 

 

0 Kudos
2 Replies
JeffSilberberg
Frequent Contributor

@MeleKoneya 

At least two things look suspicious in your XML Data block - 

There are two << opening brackets instead of one.  Shouldn't it be <location data>

Also, you enclosed the Lat & lon data in Square Brackets, which is not standard XML.. 

Check your Logs, and maybe add a temporary output to a text file, that you can then open and see if your XML document made it all the way in. 

 

 

 

 

MeleKoneya
Frequent Contributor

@JeffSilberberg   Thank you for seeing my poor formatting.   I think you are on to something for sure as know I can see the file getting passed through the connector.    I think I still need to fix a few things and will try the suggestion of written it to a text file to see if I am missing something else in the format.   Thanks again!

0 Kudos