ArcGIS Server Web Services
ArcGIS Server is well suited to being the engine behind web services that have a spatial aspect. Tools like Microsoft Visual Studio .Net and Apache Axis (Java) make it easy to expose objects in your project as SOAP web services. There are numerous issues raised by the use of SOAP, but in this post I’ll focus on service design in the ArcGIS Server/ArcObjects environment.
A while ago I witnessed a demonstration that showed how easy it was to create a SOAP web service based on ArcGIS Server. It was a great example of how easy it is to create a SOAP binding using Visual Studio. It was an equally great example of how not to create a well designed web service. Granted, it was just a demo, but there are plenty of people in the GIS community who haven’t yet had a lot to do with web services. For them, it was a very poor introduction.
The person doing the demonstration picked a coarse-grained ArcObject class and created a SOAP interface directly from it. Sure, you can do that, but that’s using web services to do distributed objects. That’s bad form because you are exposing every property and method in that ArcObject class, and every object that it contains, to the outside world. You are also tightly coupling your web service, and the applications that use it, to the underlying ArcObjects implementation.
Web services are about interfaces. The applications that use the web service should not have to know anything about how the web service is implemented. i.e. They don’t care whether it was created using ArcGIS Server, MapXtreme or 100% custom code. All they need to know is how to call the service (the request) and what they get back (the response). That’s the interface.
If you are creating web services that works with ArcGIS Server I recommend that you:
- Design the interface first.
- Create facade classes that support the interface, and only then
- Connect the facade classes to your Application Developer Framework implementation classes.
This approach ensures that your interface does exactly what you need, and is separate from your implementation.
