Select to view content in your preferred language

Enable custom capabilities on a mapservice

1180
0
07-13-2016 02:51 AM
AleydisG__Pere
Regular Contributor

I have my own scripts to upload and register SOEs (based on this toolkit) and to change properties and add capabilities to services both editing the sddraft (as shown here) and editing services once they are already published (based on this with some extra code to edit capabilities). Everything works except that I cannot enable on mapservices the new capabilities I added when registering custom SOEs.

The standard capability definitions are automatically added to sddraft files, therefore it's pretty easy to edit the sddraft to enable them. But what if I want to add some custom capabilities to the service? This does not seem the way to go.

Using common sense I thought that editing the published mapservice using the ArcGIS Server Administrator API would be the way to do it but, just like with sddraft files, in the JSON definition of the service, under 'extensions', there's no 'TypeName' with the name of any of my new extensions.

If I enable my custom capabilities on a mapservice from the Manager and use my script again, the JSON definition of the service now includes all my extensions and (as expected) they are enabled. I disable all of them again and run my script for the second time and  they are still there and disabled (as expected). So custom capability definitions are not added by default to the JSON definition of services. Ok, so what should I do?

For example, my PrintUtils extension looks like this (see below) in the JSON definition of one service (once I enabled it from the Manager). Should I add this in the JSON definition of each service? Do custom extension always have those same tags? I want to use my script to enable ANY custom extension any admin user may have registered with the server.

...

"extensions": [
   {
     "typeName": "PrintUtils",
     "enabled": "true",
     "maxUploadedFileSize": 0,

     "allowedUploadFileTypes": "",

     "capabilities": "",
     "properties": {
       "supportsSOAP": "false",
       "supportsREST": "true"
      }
    },

    {

      *some other extension*

     }

],

...
}

0 Kudos
0 Replies