Delivering Geocoding Data to the ESRI Database

In this section:

The adapter can now deliver the geocoding data for the crime address to the ESRI database through an ESRI loading target. The steps are:

  1. Create an ESRI loading target that defines the path to the ESRI database.
  2. Connect to the database through the target.
  3. Select the database table where the geocoding data will reside. In this case, it is the table named CRIME.
  4. If desired, view the metadata of the table by selecting the ColumnList tab.
  5. Select the insert table service.
  6. Generate and save schemas for the XML insert request and response documents.
  7. Use an XML editor to create the insert request and response documents based on these schemas.
  8. Create an ESRI loading service and a method for the service.

Top of page

x
Insert Request Document

The geocoding information for the crime location is delivered to the ESRI database in an XML insert request document. This document provides all data for the new record being added to the CRIME table, which includes the crime identification (CRIMEID), the crime description (CRIMEDESC), the latitude and longitude of the crime location, and the date and time of the crime (CRIMEDATE).

The following insert request document is requesting to insert the record regarding a theft with crime ID 1111 that occurred on August 13, 1997. The latitude and longitude information in this document was obtained from the geocoding response document.

<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSPY v5 rel. 4 U
    (http://www.xmlspy.com)-->
<arcsde_CRIME_insert_request
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="C:\Temp\insert_request.xsd">
   <record>
      <CRIMEID>1111</CRIMEID>
      <CRIMEDESC>Theft</CRIMEDESC>
      <TLOCATION>
         <lon>-74.263965</lon>
         <lat>40.580023</lat>
      </TLOCATION>
      <CRIMEDATE>08-13-1997 2:22:22</CRIMEDATE>
   </record>
</arcsde_CRIME_insert_request>

Top of page

x
Insert Response Document

When the insert is successfully completed, the following response document is sent to the adapter. The <Return_Msg>OK</Return_Msg> statement indicates the insert was successful.

<?xml version="1.0" encoding="UTF-8" ?>
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
   xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <SOAP-ENV:Body>
  <insertResponse xmlns="urn:iwaysoftware:ibse:jul2003:insert:response"
      cid="98742723503648685E51710C4C01D4A9">
   <arcsde_insert_response>
      <Return_Code>0</Return_Code>
      <Return_Msg>OK</Return_Msg>
      <insert_recordsNumber>1</insert_recordsNumber>
   </arcsde_insert_response>
  </insertResponse>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

iWay Software