run gp service via esri proxy

361
1
11-18-2020 09:52 AM
wadsonmakari
New Contributor III

Hi all,

I have extend web app builder and built a custom widget that calls a GP service which take a few parameters and returns a result as a string.

The GP service is secured in arcgis server 10.6.1 and requires a token to run. I have set a proxy on my web server and the proxy.config is set as follows for testing

 

 

<ProxyConfig allowedReferers="*"
             mustMatch="true"
             >
    <serverUrls>
      <serverUrl url="https://machinename/arcgis/rest/services/Shared/pche/MapServer"
                 username="username"
                 password="password"
                 matchAll="true"/>
      <serverUrl url="https://machinename/arcgis/rest/services/Shared/pche/MapServer"
                 username="username"
                 password="password"
                 matchAll="true" />
      <serverUrl url="https://machinename/arcgis/rest/services/Coll_GP/SnailTrailIssiNames/GPServer"
                 username="username"
                 password="password"
                 matchAll="true" />
    </serverUrls>
</ProxyConfig>

 

 

 

In my config.json I have the following

"httpProxy": {
"useProxy": true,
"url": "",
"rules":[{"urlPrefix":"https://machinename/arcgis/rest/services/Shared/pdac/MapServer",
"proxyUrl":"https://machinename/DotNet/proxy.ashx"},
{"urlPrefix":"https://machinename/arcgis/rest/services/Shared/pche/MapServer",
"proxyUrl":"https://machinename/DotNet/proxy.ashx"},
{"urlPrefix":"https://machinename/arcgis/rest/services/Coll_GP/SnailTrailIssiNames/GPServer",
"proxyUrl":"https://machinename/DotNet/proxy.ashx"}]
}

The 2 map services are both secured as well and I am access them via the proxy without any problems. However I am having problems calling the GP service via the proxy. The request returns the following

RequestError: Unable to load https://machinename/DotNet/proxy.ashx?"https://machinename/arcgis/rest/services/Coll_GP/SnailTrailIssiNames/GPServer/SnailTrailIssiNames/execute f=json?[list of parameters with values] Status 500

The GP service request is going through the proxy as expected but I am not sure why it is not working when the secure map layers are loaded without any issues? If I do not go via the proxy I get challenged for username and password and upon entering the credentials my request is processed as expected.

Any idea why the GP service is not working via the proxy? Is there something wrong with my config? Any pointers much appreciated.

Regards

 

 

Tags (1)
0 Kudos
1 Reply
KavishGhime3
New Contributor II

Hi @wadsonmakari ,

There are many things I see which can be troubleshooted. But first, is your ArcGIS Enterprise (10.6.1) a Federated or non-Federated?

Thanks,

Kavish

0 Kudos