com.esri.arcgis.system
Class IRESTRequestHandlerProxy

java.lang.Object
  extended by com.esri.arcgis.interop.Dispatch
      extended by com.esri.arcgis.system.IRESTRequestHandlerProxy
All Implemented Interfaces:
IRESTRequestHandler, Externalizable, Serializable

public class IRESTRequestHandlerProxy
extends com.esri.arcgis.interop.Dispatch
implements IRESTRequestHandler, Serializable

Provides access to REST request for SO or SOE.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

See Also:
Serialized Form

Field Summary
 boolean noncastable
           
 
Fields inherited from class com.esri.arcgis.interop.Dispatch
DISPATCH_METHOD, DISPATCH_PROPERTYGET, DISPATCH_PROPERTYPUT, DISPATCH_PROPERTYPUTREF, objRef
 
Fields inherited from interface com.esri.arcgis.system.IRESTRequestHandler
IID, IID9d66a418_d54a_48ed_88bd_043a25fa9c83, xxDummy
 
Constructor Summary
  IRESTRequestHandlerProxy()
           
  IRESTRequestHandlerProxy(Object obj)
           
protected IRESTRequestHandlerProxy(Object obj, String iid)
           
 
Method Summary
 void addListener(String iidStr, Object theListener, Object theSource)
           
 String getSchema()
          This method returns the resource hierarchy of a REST based SOE.
 byte[] handleRESTRequest(String capabilities, String resourceName, String operationName, String operationInput, String outputFormat, String requestProperties, String[] responseProperties)
          Handles REST requests for SOE.
 void removeListener(String iidStr, Object theListener)
           
 
Methods inherited from class com.esri.arcgis.interop.Dispatch
bindUsingMoniker, constructVtblPosTable, convertToNative, cookieForListener, createDispatch, createObjrefMonikerDisplayName, equals, getActiveObject, getActiveObject, getDefaultProperty, getDispatchIdOfName, getLastErrorCode, getMtsObjectContext, getObjRef, getPropertyByName, getPropertyByName, getVtblPos, hashCode, initDispatch, invoke, invokeMethodByName, invokeMethodByName, invokeMethodByName, invokePropertyGetByName, invokePropertyPutByName, invokePropertyPutByRefByName, isNativeMode, isObjRef, optimizedVtblInvoke, queryInterface, readExternal, release, setNativeMode, setPropertyByName, toString, vtblInvoke, writeExternal
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

noncastable

public boolean noncastable
Constructor Detail

IRESTRequestHandlerProxy

public IRESTRequestHandlerProxy()

IRESTRequestHandlerProxy

public IRESTRequestHandlerProxy(Object obj)
                         throws IOException
Throws:
IOException

IRESTRequestHandlerProxy

protected IRESTRequestHandlerProxy(Object obj,
                                   String iid)
                            throws IOException
Throws:
IOException
Method Detail

addListener

public void addListener(String iidStr,
                        Object theListener,
                        Object theSource)
                 throws IOException
Overrides:
addListener in class com.esri.arcgis.interop.Dispatch
Throws:
IOException

removeListener

public void removeListener(String iidStr,
                           Object theListener)
                    throws IOException
Overrides:
removeListener in class com.esri.arcgis.interop.Dispatch
Throws:
IOException

handleRESTRequest

public byte[] handleRESTRequest(String capabilities,
                                String resourceName,
                                String operationName,
                                String operationInput,
                                String outputFormat,
                                String requestProperties,
                                String[] responseProperties)
                         throws IOException,
                                AutomationException
Handles REST requests for SOE.

This method is invoked by ArcGIS Server's REST handler, which intercepts client's request (in URL form), parses it and passes it on to this method in form of parameter values.

The REST SOE developer must add logic to use these parameter values to determine which resource/operation is being requested and accordingly handle these requests and generate responses in the output format indicated by the "outputFormat" parameter. For more information on developing REST SOEs, please consult the Java ArcObjects Developer Guide.

Developer doc: Developing extensions > Server Object Extensions > SOE Web Services > REST Web Services > Developing SOE REST Web Services
Samples: Samples > Server Object Extensions section

Specified by:
handleRESTRequest in interface IRESTRequestHandler
Parameters:
capabilities - The capabilities supported by the SOE. An admin can choose which capabilities are enabled on a particular SOE (in ArcGIS Manager or ArcCatalog), based on certain criteria such as security roles. This list of allowed capabilities is then sent to this method, at runtime, as a comma separated list. (in)
resourceName - Name of the resource being addressed. If empty, its assumed that root resource is being addressed. (in)
operationName - Name of the operation being invoked. If empty, description of resource is returned. (in)
operationInput - Input parameters, in form of comma separated list, to the operation specified by operationName parameter. (in)
outputFormat - OutputFormat of operation. Possible formats are JSON, HTML, AMF, etc. (in)
requestProperties - The requestProperties (in)
responseProperties - The responseProperties (out)
Returns:
Output generated by the SOE
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSchema

public String getSchema()
                 throws IOException,
                        AutomationException
This method returns the resource hierarchy of a REST based SOE. This hierarchy is in JSON format as shown in the example below:

For an SOE that has a root resource (called "root") with one operation ("operation0"), and 2 sub-resources with one operation each ("operation1" and "operation2" respectively), the schema would look like:


 {
   "name": "MyRESTSOE",
   "description": "My REST SOE with 3 resources and 1 operation each.",
   "isCollection": false,
   "operations": [
   {
      "name": "operation0",
      "parameters": ["param01"],
      "supportedOutputFormats": ["json"]
    }
 ],
 "resources": [
  {
      "name": "subresource1",
      "description": "Sub Resource 1",
      "isCollection": true,
      "operations": [
       {
          "name": "operation1",
          "parameters": ["param10", "param11"],
          "supportedOutputFormats": ["json"]
       }
    ]
  },
  {
      "name": "subresource2",
      "description": "Sub Resource 2",
      "isCollection": true,
      "operations": [
       {
          "name": "operation2",
          "parameters": ["param20", "param21"],
          "supportedOutputFormats": ["json"]
       }
    ]
  }
 ]
}

Specified by:
getSchema in interface IRESTRequestHandler
Returns:
resource hierarchy of REST SOE, as String
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.