Using external capabilities files with WFS services
In this topic
- Creating external capabilities files
- Configuring a WFS service to use external capabilities files
- Controlling the number of features returned by the service
Each WFS service exposes service-level metadata through its capabilities file. The capabilities file is the XML response that clients receive when they make a GetCapabilities request on the service. Configuring external capabilities files gives you the flexibility to do the following:
- Add service-level metadata information to WFS capabilities files.
- Add feature-level metadata information to WFS capabilities files.
- Add additional predefined spatial reference systems from the ArcGIS Server predefined projection list.
- Improve performance when connecting to your WFS service, especially when there are many type names in your service.
To use external capabilities files with WFS services, create the files and configure the files for use with your WFS services. The sections below describe this process.
Note:
By using external capabilities files for your WFS service, you are responsible for validating your capabilities files against the DTD or XML schema from OGC. You also assume responsibility for all the synchronization between your capabilities files and the source map document or geodatabase from which your WFS service is published.
Creating external capabilities files
To configure a WFS service to use external capabilities files, prepare three WFS capabilities files: one for version 1.0.0, one for 1.1.0, and one for 2.0. You can create the files from scratch, but it's often easier to use the system-generated capabilities files as templates.
By default, system-generated capabilities files are created automatically every time you send a WFS GetCapabilities request to the service. To use the system-generated capabilities files as templates, manually send the GetCapabilities requests and save the responses as XML.
Follow the steps below to create external capabilities files for your WFS service.
- If you haven't done so already, publish a map or geodata service and enable the WFS capability. For more information, see WFS services.
- In a web browser, enter the URL of your WFS service. The URL is formatted:
http://gisserver.domain.com:6080/arcgis/services/folder/service/service type(can be MapServer or GeoDataServer)/WFSServer
- Append ?request=GetCapabilities&version=1.0.0 to the end of the service URL and press Enter. The XML displayed in the browser is the WFS version 1.0.0 capabilities for your service.
- Save the results as an XML file. The file name must follow the format <prefix><WFS version>.xml. For example, when you save the result XML from a WFS version 1.0.0 GetCapabilities request, the file must use a common prefix (such as Roads) followed by the three-digit WFS version number (100). The resulting file is Roads100.xml.
- Repeat steps 3 and 4 to create the capabilities files for WFS version 1.1.0 and 2.0.
- Configure and customize metadata information for the WFS layers in each capabilities file.
- Move all the capabilities files into a common folder accessible through HTTP. Typically, this will be a virtual directory on your organization's web server.
Configuring a WFS service to use external capabilities files
To configure your WFS service to use external capabilities files, update the WFS service to reference the URL of your capabilities files. You can do this in ArcGIS Server Manager or ArcGIS for Desktop.
In ArcGIS Server Manager:
- Open ArcGIS Server Manager and log in. If you need help with this step, see Logging in to Manager.
- Click Services > Manage Services.
- In the Manage Services module, locate your service and click Edit . If you don't see your service in the list, it may be located within a subfolder under the Site (root) folder.
- In the Edit module, click Capabilities.
- In the capabilities list, click WFS.
- In the WFS Configuration list, choose Use external capabilities files.
- In the Specify the location and prefix box, specify the URL of the folder where you placed your capabilities files plus the common prefix you used for the files. For example, if the URL to the folder that contains your files is http://webserver.domain.com/arcgis/WFS/services and the common prefix you used is Roads, then the URL you specify in the Specify the location and prefix box is http://webserver.domain.com/arcgis/WFS/services/Roads.
- Click Save and Restart.
In ArcGIS for Desktop:
- In ArcCatalog or the Catalog window in ArcGIS for Desktop, expand the GIS Servers node and establish an Administer GIS server connection type to ArcGIS Server. If you already have an Administer GIS server connection set up, you can skip this step. For instructions on how to connect, see Making an administrative connection to ArcGIS Server in ArcGIS for Desktop.
- Within your connection to ArcGIS Server, right-click your service and choose Service Properties.
- In the Service Editor, click the Capabilities tab.
- Click the WFS tab and select Use external capabilities files.
- In the Specify the location and prefix box, specify the URL of the folder where you placed your capabilities files plus the common prefix you used for the files. For example, if the URL to the folder that contains your files is http://webserver.domain.com/arcgis/WFS/services and the common prefix you used is Roads, then the URL you specify in the Specify the location and prefix box is http://webserver.domain.com/arcgis/WFS/services/Roads.
- Click OK.
Controlling the number of features returned by the service
Optionally, you can set the DefaultMaxFeatures property, which allows you to control the maximum number of features returned by the service. The DefaultMaxFeatures property is only supported with WFS 1.1.0, so if you are using external capabilities files, you only need to set this property in the file referencing the 1.1.0 properties.
In an external capabilities file, the DefaultMaxFeatures property is defined in the metadata section of WFSServer 1.1.0 file as follows:
<ows:Constraint name="DefaultMaxFeatures">
<ows:Value>200</ows:Value>
</ows:Constraint>