<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Disable schema locking on multiple published services in ArcGIS Server with JavaScript API Questions</title>
    <link>https://community.esri.com/t5/arcgis-server-with-javascript-api-questions/disable-schema-locking-on-multiple-published/m-p/793133#M257</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can do it via the REST API. Most of the documentation out there is written for Python 2.7.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a code&amp;nbsp; in Python 3. You can add a loop to switch the serviceURL, that should do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;urllib&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;json&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;urllib.request&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;requests&lt;/SPAN&gt;


&lt;SPAN style="font-size: 15px;"&gt;&lt;SPAN style="color: #cc7832;"&gt;def &lt;/SPAN&gt;&lt;SPAN style="color: #ffc66d;"&gt;main&lt;/SPAN&gt;():&lt;/SPAN&gt;

&lt;SPAN style="font-size: 15px;"&gt;    portalURL = &lt;SPAN style="color: #6a8759;"&gt;r''
&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;    &lt;/SPAN&gt;username = &lt;SPAN style="color: #6a8759;"&gt;''
&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;    &lt;/SPAN&gt;password = &lt;SPAN style="color: #6a8759;"&gt;''
&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;    &lt;/SPAN&gt;new_token = generateToken(username&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;password&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;portalURL)&lt;/SPAN&gt;

&lt;SPAN style="font-size: 15px;"&gt;    &lt;SPAN style="color: #808080;"&gt;# edit a service
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;    &lt;/SPAN&gt;serviceURL = &lt;SPAN style="color: #6a8759;"&gt;'&amp;lt;server root url&amp;gt;/admin/services/&amp;lt;service_name&amp;gt;.MapServer'
&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;    &lt;/SPAN&gt;params = {&lt;SPAN style="color: #6a8759;"&gt;'f'&lt;/SPAN&gt;: &lt;SPAN style="color: #6a8759;"&gt;'json'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'token'&lt;/SPAN&gt;: new_token}&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;    req = urllib.request.Request(serviceURL&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;urllib.parse.urlencode(params).encode(&lt;SPAN style="color: #6a8759;"&gt;"utf-8"&lt;/SPAN&gt;))&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;    response = urllib.request.urlopen(req)&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;    data = json.load(response)&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;    data[&lt;SPAN style="color: #6a8759;"&gt;"properties"&lt;/SPAN&gt;][&lt;SPAN style="color: #6a8759;"&gt;"schemaLockingEnabled"&lt;/SPAN&gt;] = &lt;SPAN style="color: #6a8759;"&gt;"false"
&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;    &lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;# Serialize back into JSON
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;    &lt;/SPAN&gt;updatedSvcJson = json.dumps(data)&lt;/SPAN&gt;

&lt;SPAN style="font-size: 15px;"&gt;    &lt;SPAN style="color: #808080;"&gt;# Call the edit operation on the service. Pass in modified JSON.
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;    &lt;/SPAN&gt;editSvcURL = serviceURL + &lt;SPAN style="color: #6a8759;"&gt;"/edit"
&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;    &lt;/SPAN&gt;headers = {&lt;SPAN style="color: #6a8759;"&gt;"Content-type"&lt;/SPAN&gt;: &lt;SPAN style="color: #6a8759;"&gt;"application/x-www-form-urlencoded"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"Accept"&lt;/SPAN&gt;: &lt;SPAN style="color: #6a8759;"&gt;"text/plain"&lt;/SPAN&gt;}&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;    params_e = urllib.parse.urlencode({&lt;SPAN style="color: #6a8759;"&gt;'token'&lt;/SPAN&gt;:new_token&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'f'&lt;/SPAN&gt;: &lt;SPAN style="color: #6a8759;"&gt;'json'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'service'&lt;/SPAN&gt;: updatedSvcJson})&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;    &lt;SPAN style="color: #808080;"&gt;r &lt;/SPAN&gt;= requests.post(editSvcURL&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;params_e&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #aa4926;"&gt;headers &lt;/SPAN&gt;= headers)&lt;/SPAN&gt;


&lt;SPAN style="font-size: 15px;"&gt;&lt;SPAN style="color: #cc7832;"&gt;def &lt;/SPAN&gt;&lt;SPAN style="color: #ffc66d;"&gt;generateToken&lt;/SPAN&gt;(username&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;password&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;portalUrl):&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;    &lt;SPAN style="color: #629755;"&gt;'''Retrieves a token to be used with API requests.'''
&lt;/SPAN&gt;&lt;SPAN style="color: #629755;"&gt;    &lt;/SPAN&gt;parameters = urllib.parse.urlencode({&lt;SPAN style="color: #6a8759;"&gt;'username' &lt;/SPAN&gt;: username&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;                                   &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'password' &lt;/SPAN&gt;: password&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;                                   &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'client' &lt;/SPAN&gt;: &lt;SPAN style="color: #6a8759;"&gt;'referer'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;                                   &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'referer'&lt;/SPAN&gt;: portalUrl&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;                                   &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'expiration'&lt;/SPAN&gt;: &lt;SPAN style="color: #6897bb;"&gt;60&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;                                   &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'f' &lt;/SPAN&gt;: &lt;SPAN style="color: #6a8759;"&gt;'json'&lt;/SPAN&gt;}).encode(&lt;SPAN style="color: #6a8759;"&gt;"utf-8"&lt;/SPAN&gt;)&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;    response = urllib.request.urlopen(portalUrl + &lt;SPAN style="color: #6a8759;"&gt;'/sharing/rest/generateToken?'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,&lt;/SPAN&gt;parameters).read()&lt;/SPAN&gt;

&lt;SPAN style="font-size: 15px;"&gt;    &lt;SPAN style="color: #cc7832;"&gt;try&lt;/SPAN&gt;:&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;        jsonResponse = json.loads(response)&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;        &lt;SPAN style="color: #cc7832;"&gt;if &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'token' &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;jsonResponse:&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;            &lt;SPAN style="color: #cc7832;"&gt;return &lt;/SPAN&gt;jsonResponse[&lt;SPAN style="color: #6a8759;"&gt;'token'&lt;/SPAN&gt;]&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;        &lt;SPAN style="color: #cc7832;"&gt;elif &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'error' &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;jsonResponse:&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;            &lt;SPAN style="color: #8888c6;"&gt;print&lt;/SPAN&gt;(jsonResponse[&lt;SPAN style="color: #6a8759;"&gt;'error'&lt;/SPAN&gt;][&lt;SPAN style="color: #6a8759;"&gt;'message'&lt;/SPAN&gt;])&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;            &lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;detail &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;jsonResponse[&lt;SPAN style="color: #6a8759;"&gt;'error'&lt;/SPAN&gt;][&lt;SPAN style="color: #6a8759;"&gt;'details'&lt;/SPAN&gt;]:&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;                &lt;SPAN style="color: #8888c6;"&gt;print&lt;/SPAN&gt;(detail)&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;    &lt;SPAN style="color: #cc7832;"&gt;except &lt;/SPAN&gt;&lt;SPAN style="color: #8888c6;"&gt;ValueError&lt;/SPAN&gt;:&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;        &lt;SPAN style="color: #8888c6;"&gt;print&lt;/SPAN&gt;(&lt;SPAN style="color: #6a8759;"&gt;'An unspecified error occurred.'&lt;/SPAN&gt;)&lt;/SPAN&gt;


&lt;SPAN style="font-size: 15px;"&gt;&lt;SPAN style="color: #cc7832;"&gt;if &lt;/SPAN&gt;__name__ == &lt;SPAN style="color: #6a8759;"&gt;'__main__'&lt;/SPAN&gt;:&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;    &lt;SPAN style="color: #6a8759;"&gt;'''
&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;    debug
&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;    '''
&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;    &lt;/SPAN&gt;main()&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 09:07:13 GMT</pubDate>
    <dc:creator>AdrienLepoutre</dc:creator>
    <dc:date>2021-12-12T09:07:13Z</dc:date>
    <item>
      <title>Disable schema locking on multiple published services</title>
      <link>https://community.esri.com/t5/arcgis-server-with-javascript-api-questions/disable-schema-locking-on-multiple-published/m-p/793132#M256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have hundreds of map services&amp;nbsp;published on our server and they all have the default setting of schema locking enabled.&amp;nbsp;We&amp;nbsp;want to disable schema locking on all of them. We know we can change the service properties for each service either through ArcGIS Server or ArcMap, but is there a way to automate this process through scripting so we don't have to do this for each service individually?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Jun 2019 13:41:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-server-with-javascript-api-questions/disable-schema-locking-on-multiple-published/m-p/793132#M256</guid>
      <dc:creator>StephanieRinguet2</dc:creator>
      <dc:date>2019-06-28T13:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: Disable schema locking on multiple published services</title>
      <link>https://community.esri.com/t5/arcgis-server-with-javascript-api-questions/disable-schema-locking-on-multiple-published/m-p/793133#M257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can do it via the REST API. Most of the documentation out there is written for Python 2.7.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a code&amp;nbsp; in Python 3. You can add a loop to switch the serviceURL, that should do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;urllib&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;json&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;urllib.request&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;&lt;SPAN style="color: #cc7832;"&gt;import &lt;/SPAN&gt;requests&lt;/SPAN&gt;


&lt;SPAN style="font-size: 15px;"&gt;&lt;SPAN style="color: #cc7832;"&gt;def &lt;/SPAN&gt;&lt;SPAN style="color: #ffc66d;"&gt;main&lt;/SPAN&gt;():&lt;/SPAN&gt;

&lt;SPAN style="font-size: 15px;"&gt;    portalURL = &lt;SPAN style="color: #6a8759;"&gt;r''
&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;    &lt;/SPAN&gt;username = &lt;SPAN style="color: #6a8759;"&gt;''
&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;    &lt;/SPAN&gt;password = &lt;SPAN style="color: #6a8759;"&gt;''
&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;    &lt;/SPAN&gt;new_token = generateToken(username&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;password&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;portalURL)&lt;/SPAN&gt;

&lt;SPAN style="font-size: 15px;"&gt;    &lt;SPAN style="color: #808080;"&gt;# edit a service
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;    &lt;/SPAN&gt;serviceURL = &lt;SPAN style="color: #6a8759;"&gt;'&amp;lt;server root url&amp;gt;/admin/services/&amp;lt;service_name&amp;gt;.MapServer'
&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;    &lt;/SPAN&gt;params = {&lt;SPAN style="color: #6a8759;"&gt;'f'&lt;/SPAN&gt;: &lt;SPAN style="color: #6a8759;"&gt;'json'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'token'&lt;/SPAN&gt;: new_token}&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;    req = urllib.request.Request(serviceURL&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;urllib.parse.urlencode(params).encode(&lt;SPAN style="color: #6a8759;"&gt;"utf-8"&lt;/SPAN&gt;))&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;    response = urllib.request.urlopen(req)&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;    data = json.load(response)&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;    data[&lt;SPAN style="color: #6a8759;"&gt;"properties"&lt;/SPAN&gt;][&lt;SPAN style="color: #6a8759;"&gt;"schemaLockingEnabled"&lt;/SPAN&gt;] = &lt;SPAN style="color: #6a8759;"&gt;"false"
&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;    &lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;# Serialize back into JSON
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;    &lt;/SPAN&gt;updatedSvcJson = json.dumps(data)&lt;/SPAN&gt;

&lt;SPAN style="font-size: 15px;"&gt;    &lt;SPAN style="color: #808080;"&gt;# Call the edit operation on the service. Pass in modified JSON.
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;    &lt;/SPAN&gt;editSvcURL = serviceURL + &lt;SPAN style="color: #6a8759;"&gt;"/edit"
&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;    &lt;/SPAN&gt;headers = {&lt;SPAN style="color: #6a8759;"&gt;"Content-type"&lt;/SPAN&gt;: &lt;SPAN style="color: #6a8759;"&gt;"application/x-www-form-urlencoded"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;"Accept"&lt;/SPAN&gt;: &lt;SPAN style="color: #6a8759;"&gt;"text/plain"&lt;/SPAN&gt;}&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;    params_e = urllib.parse.urlencode({&lt;SPAN style="color: #6a8759;"&gt;'token'&lt;/SPAN&gt;:new_token&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'f'&lt;/SPAN&gt;: &lt;SPAN style="color: #6a8759;"&gt;'json'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'service'&lt;/SPAN&gt;: updatedSvcJson})&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;    &lt;SPAN style="color: #808080;"&gt;r &lt;/SPAN&gt;= requests.post(editSvcURL&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;params_e&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #aa4926;"&gt;headers &lt;/SPAN&gt;= headers)&lt;/SPAN&gt;


&lt;SPAN style="font-size: 15px;"&gt;&lt;SPAN style="color: #cc7832;"&gt;def &lt;/SPAN&gt;&lt;SPAN style="color: #ffc66d;"&gt;generateToken&lt;/SPAN&gt;(username&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;password&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;portalUrl):&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;    &lt;SPAN style="color: #629755;"&gt;'''Retrieves a token to be used with API requests.'''
&lt;/SPAN&gt;&lt;SPAN style="color: #629755;"&gt;    &lt;/SPAN&gt;parameters = urllib.parse.urlencode({&lt;SPAN style="color: #6a8759;"&gt;'username' &lt;/SPAN&gt;: username&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;                                   &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'password' &lt;/SPAN&gt;: password&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;                                   &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'client' &lt;/SPAN&gt;: &lt;SPAN style="color: #6a8759;"&gt;'referer'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;                                   &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'referer'&lt;/SPAN&gt;: portalUrl&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;                                   &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'expiration'&lt;/SPAN&gt;: &lt;SPAN style="color: #6897bb;"&gt;60&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;                                   &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'f' &lt;/SPAN&gt;: &lt;SPAN style="color: #6a8759;"&gt;'json'&lt;/SPAN&gt;}).encode(&lt;SPAN style="color: #6a8759;"&gt;"utf-8"&lt;/SPAN&gt;)&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;    response = urllib.request.urlopen(portalUrl + &lt;SPAN style="color: #6a8759;"&gt;'/sharing/rest/generateToken?'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;,&lt;/SPAN&gt;parameters).read()&lt;/SPAN&gt;

&lt;SPAN style="font-size: 15px;"&gt;    &lt;SPAN style="color: #cc7832;"&gt;try&lt;/SPAN&gt;:&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;        jsonResponse = json.loads(response)&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;        &lt;SPAN style="color: #cc7832;"&gt;if &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'token' &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;jsonResponse:&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;            &lt;SPAN style="color: #cc7832;"&gt;return &lt;/SPAN&gt;jsonResponse[&lt;SPAN style="color: #6a8759;"&gt;'token'&lt;/SPAN&gt;]&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;        &lt;SPAN style="color: #cc7832;"&gt;elif &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;'error' &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;jsonResponse:&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;            &lt;SPAN style="color: #8888c6;"&gt;print&lt;/SPAN&gt;(jsonResponse[&lt;SPAN style="color: #6a8759;"&gt;'error'&lt;/SPAN&gt;][&lt;SPAN style="color: #6a8759;"&gt;'message'&lt;/SPAN&gt;])&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;            &lt;SPAN style="color: #cc7832;"&gt;for &lt;/SPAN&gt;detail &lt;SPAN style="color: #cc7832;"&gt;in &lt;/SPAN&gt;jsonResponse[&lt;SPAN style="color: #6a8759;"&gt;'error'&lt;/SPAN&gt;][&lt;SPAN style="color: #6a8759;"&gt;'details'&lt;/SPAN&gt;]:&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;                &lt;SPAN style="color: #8888c6;"&gt;print&lt;/SPAN&gt;(detail)&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;    &lt;SPAN style="color: #cc7832;"&gt;except &lt;/SPAN&gt;&lt;SPAN style="color: #8888c6;"&gt;ValueError&lt;/SPAN&gt;:&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;        &lt;SPAN style="color: #8888c6;"&gt;print&lt;/SPAN&gt;(&lt;SPAN style="color: #6a8759;"&gt;'An unspecified error occurred.'&lt;/SPAN&gt;)&lt;/SPAN&gt;


&lt;SPAN style="font-size: 15px;"&gt;&lt;SPAN style="color: #cc7832;"&gt;if &lt;/SPAN&gt;__name__ == &lt;SPAN style="color: #6a8759;"&gt;'__main__'&lt;/SPAN&gt;:&lt;/SPAN&gt;
&lt;SPAN style="font-size: 15px;"&gt;    &lt;SPAN style="color: #6a8759;"&gt;'''
&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;    debug
&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;    '''
&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759;"&gt;    &lt;/SPAN&gt;main()&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:07:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-server-with-javascript-api-questions/disable-schema-locking-on-multiple-published/m-p/793133#M257</guid>
      <dc:creator>AdrienLepoutre</dc:creator>
      <dc:date>2021-12-12T09:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: Disable schema locking on multiple published services</title>
      <link>https://community.esri.com/t5/arcgis-server-with-javascript-api-questions/disable-schema-locking-on-multiple-published/m-p/793134#M258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Sep 2019 14:31:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-server-with-javascript-api-questions/disable-schema-locking-on-multiple-published/m-p/793134#M258</guid>
      <dc:creator>StephanieRinguet2</dc:creator>
      <dc:date>2019-09-20T14:31:05Z</dc:date>
    </item>
  </channel>
</rss>

