2

I would like to change some parameters in my sdDraft file using arcpy and XML parsing. Some of my steps work without any problems; other certain property-change does not any effect in the resulting service. The relevant code snippet looks like the following:

def setServiceCapabilities(sddraft):
    # Read the sddraft xml.
    doc = DOM.parse(sddraft)

    # get keys in configuration-block to edit those
    SVCConfiguration = doc.getElementsByTagName('PropertySetProperty')
    for config in SVCConfiguration:
        # Get the TypeName we want to disable.
        #in admin-rest interface, this is called "maxWaitTime"
        if config.firstChild.firstChild.data == "WaitTimeout":
            print("Key WaitTimeout")
            config.lastChild.lastChild.data = 111
            print(str(config.lastChild.lastChild.data))
        #in admin-rest interface, this is called "maxIdleTime"
        if config.firstChild.firstChild.data == "IdleTimeout":
            print("Key IdleTimeout")
            config.lastChild.lastChild.data = 222
            print(str(config.lastChild.lastChild.data))
        #in admin-rest interface, this is called "maxUsageTime"
        if config.firstChild.firstChild.data == "UsageTimeout":
            print("Key UsageTimeout")
            config.lastChild.lastChild.data = 333
            print(str(config.lastChild.lastChild.data))
        #in admin-rest interface, this is called "maxInstancesPerNode"
        if config.firstChild.firstChild.data == "MaxInstances":
            print("Key MaxInstances")
            config.lastChild.lastChild.data = 3
            print(str(config.lastChild.lastChild.data))



    # Output to a new sddraft.
    updatedDraft = workspace + service + 'updated' + '.sddraft'
    f = open(updatedDraft , 'w')
    doc.writexml(f)
    f.close()
    return updatedDraft 

So...as a result, the following works:

  • Setting WaitTimeout, IdleTimeout, UsageTimeout and MaxInstances is working properly.

Checking the saved sdDraft, it seems that all settings are applied as you can see in the created sdDraft (this is just a snippet):

   [...]
   <Props xsi:type="typens:PropertySet">
     <PropertyArray xsi:type="typens:ArrayOfPropertySetProperty">
         [...]
         <PropertySetProperty xsi:type="typens:PropertySetProperty">
             <Key>MaxInstances</Key>
             <Value xsi:type="xs:string">3</Value>
         </PropertySetProperty>
         <PropertySetProperty xsi:type="typens:PropertySetProperty">
             <Key>WaitTimeout</Key>
             <Value xsi:type="xs:string">111</Value>
         </PropertySetProperty>
         <PropertySetProperty xsi:type="typens:PropertySetProperty">
             <Key>IdleTimeout</Key>
             <Value xsi:type="xs:string">222</Value>
         </PropertySetProperty>
         <PropertySetProperty xsi:type="typens:PropertySetProperty">
             <Key>UsageTimeout</Key>
             <Value xsi:type="xs:string">333</Value>
         </PropertySetProperty>
         [...]
     </PropertyArray>
 </Props>
 [...]

However I would like to set an additional property called "StartupTimeout" using the above described mechanism:

#in admin-rest interface, this is called "maxStartupTime"
if config.firstChild.firstChild.data == "StartupTimeout":
    print("Key StartupTimeout")
    config.lastChild.lastChild.data = 444
    print(str(config.lastChild.lastChild.data))

, which seems to be okay as the needed setting is applied to my sdDraft:

   [...]
   <Props xsi:type="typens:PropertySet">
     <PropertyArray xsi:type="typens:ArrayOfPropertySetProperty">
         [...]
         <PropertySetProperty xsi:type="typens:PropertySetProperty">
             <Key>StartupTimeout</Key>
             <Value xsi:type="xs:string">444</Value>
         </PropertySetProperty>
         [...]
     </PropertyArray>
 </Props>
 [...]

Unfortunately the last parameter StartupTimeout is not applied checking the ArcGIS Server Admin-Rest Interface: enter image description here

Does anyone know what the problem might be?

  • Mixing code that works with code that doesn't is confusing. Can you provide the relevant subset of XML, before and after, to show whether it's the XML manipulation or service creation which has failed? – Vince Apr 3 '17 at 10:47
  • Hi @Vince : I've updated my question und removed not needed information as well as I've clarified what works and what does not work, I hope this helps. – schlomm Apr 3 '17 at 12:00
  • You have the question tagged with arcgis-10.1. What exact version do you have installed (SP & patches)? I found a bunch of quirky stuff in 10.1 disappeared at 10.2.2. You could try contacting Tech Support, but given 10.1's "Mature" support status, and the availability of 10.2.2, 10.3.1, 10.4.1, and 10.5.0, I don't expect them to do much more that confirm that it works with a modern release. – Vince Apr 3 '17 at 13:09
  • I am using ArcGIS Server 10.1.1 (build 3143)...I'll try to find another machine with higher or at least equal to 10.2.2. I've already tried out ArcGIS Server 10.2.1, but the same problem occurs using this version. – schlomm Apr 3 '17 at 13:48
  • ...I've also tried it with 10.2.2, but I've run into the same problem. Unfortunately I have no access to a newer version than 10.2.2 today, but I try to get a instance with 10.3 or above. – schlomm Apr 3 '17 at 14:23
1

I got an answer to my request from the esri support. My problem is a known issue and can be found using the Track-ID BUG-000082180.

Manually changing the 'startuptimeout' setting in a Service Definition Draft (.sddraft) file is not applied to the service when the service definition (.SD) file is created during the publishing process in ArcGIS for Server 10.2.2

As I've already tried to solve the problem by using ArcGIS Server 10.2.2 and 10.4.1 without any luck, I would assume that the problem still exists in 10.5.

As a workaround, it is possible to update the needed params through the Rest-Interface. I've used the following python script and modified it to my needs: http://resources.arcgis.com/en/help/main/10.2/index.html#/Example_Edit_service_properties/0154000005r4000000/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.