.NET find near features SOAP SOE
This sample illustrates how to develop a SOAP server object extension (SOE) with new methods that can return service layer information and perform a spatial query to find features near a location. The FindNearFeatures method returns the features of a user-defined layer that fall within the search distance of a location point.
This sample is divided into the following parts:
- The SOE implementation, which receives SOAP messages, processes requests, and generates SOAP responses.
- A simple desktop client to consume the custom SOE via SOAP.
Deploying the SOE from the .soe file (
..\bin\Release\NetFindNearFeaturesSoapSOE_ent.soe) does not require you to open Visual Studio. However, you can load the project (
..\FindNearFeaturesSOAPSOE\NetFindNearFeaturesSoapSOE.sln) in Visual Studio to debug, modify, and recompile the SOE code.
- Create SOAP SOE methods
- SOAP capabilities
- Spatial query
Any dynamic map service published from ArcGIS Pro. This instruction uses the USA map service as the sample service to test with the SOE.
- Log in to ArcGIS Server Manager and click the Site tab.
- Click Extensions.
- Click Add Extension.
- Click Choose File and choose the NetFindNearFeaturesSoapSOE_ent.soe file (
- Click Add.
- Make sure you have published the USA map service using ArcGIS Pro. If not, refer to USA map service
- Log in to ArcGIS Server Manager and click the Services tab. Select USA map service and select Capabilities.
- In the list of available capabilities, find .NET Find Near Features SOAP SOE and check the box to enable it.
- Click the Save and Restart button to restart the service.
In Visual Studio, open the FindNearFeaturesSoapClient solution (
The application contains a simple Windows form with buttons and a text box. A Web Reference has been added to the project to reference the SOE SOAP endpoint.
Update the Web Reference.
Right-click the Web Reference folder in Solution Explorer.
Ensure that the Web Reference URL matches your own SOE's WSDL URL. The URL is in the following format:
Click Update Web Reference.
Update the service reference and URL in the code behind (Form1.cs).
Find the following two lines of code in each click event for the buttons:
var nearFeatsService = new localhost.USA_NetFindNearFeaturesSoapSOE(); nearFeatsService.Url = "https://<serverdomain>/<webadaptorname>/services/USA/MapServer/NetFindNearFeaturesSoapSOE";
nearFeatsServicereferences your SOAP SOE and
Run the application and click the buttons.
Layer information for all layers and features near the center of the default map extent for the service will be returned. All returned content displays in the rich text box in the form.
To test this SOE's GetLayerInfos operation in a SOAP client, you can try with the following request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://examples.esri.com/schemas/NetFindNearFeaturesSoapSOE/1.0"> <soapenv:Header/> <soapenv:Body> <ns:GetLayerInfos/> </soapenv:Body> </soapenv:Envelope>
To test the FindNearFeatures operation, try with this request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://examples.esri.com/schemas/NetFindNearFeaturesSoapSOE/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:esri="http://www.esri.com/schemas/ArcGIS/2.5.0"> <soapenv:Header/> <soapenv:Body> <ns:FindNearFeatures> <LayerID>0</LayerID> <Location xsi:type="esri:PointN"> <X>-110</X> <Y>30</Y> </Location> <Distance>2</Distance> </ns:FindNearFeatures> </soapenv:Body> </soapenv:Envelope>