Select to view content in your preferred language

Proxy not being used correctly when service layer made visible ie MapServer/export?

1762
4
Jump to solution
09-11-2018 10:13 AM
FredSpataro
Frequent Contributor

Hi All

I have a WAB 2.7 app (self deployed) that accesses a webmap with a secured arcgis server token service.  The webamp will load correctly but the secure layer won't draw.  Watching the network traffic, this makes sense b/c the 'export' image request to the service is NOT routed via the proxy.

Setup and things I can confirm:

  1. The proxy is correctly setup and configured:
    1. loclahost/proxy.ashx?ping returns the expected json response
    2. localhost/proxy.ashx?https://myserver/myservice/.... all return the correct response when I manually copy/paste the requests to the browser bar
  2. The WAB app config file has at least some of the config correct.  I'm using the "rules" section for the specific secure service url.  Without the rule for the specific secure service, the login/token prompt is displayed.  With the rule in place the login dialog does NOT appear and watching the network traffic, I see a bunch of /info?=json requests for the service routed via the proxy. Config:

"httpProxy": {
        "alwaysUseProxy": false,
        "url": "http://localhost/proxy.ashx",
        "useProxy": true,
            "rules": [
                {
                    "urlPrefix": "https://streams.whitestar.com/arcgis/rest/services",
                    "proxyUrl": "http://localhost/proxy.ashx"
                }
            ]
    },

 

Network details

The WAB correctly uses the proxy when the webmap is loading and getting service/layer info.  These request all return 200 success and the JSON is visible in the response preview:

locallhost/proxy.ashx?https://streams.whitestar.com/arcgis/rest/services/omnitrax/WS_Parcels_OMNITRAX/MapServer?f=json
locallhost/proxy.ashx?https://streams.whitestar.com/arcgis/rest/services/omnitrax/WS_Parcels_OMNITRAX/MapServer/layers?f=j...
locallhost/proxy.ashx?https://streams.whitestar.com/arcgis/rest/services/omnitrax/WS_Parcels_OMNITRAX/MapServer/0?f=json
locallhost/proxy.ashx?https://streams.whitestar.com/arcgis/rest/services/omnitrax/WS_Parcels_OMNITRAX/MapServer/1?f=json
locallhost/proxy.ashx?https://streams.whitestar.com/arcgis/rest/services/omnitrax/WS_Parcels_OMNITRAX/MapServer/2?f=json

The the layer list checkbox is clicked on, the following requests to export function are not routed thru the proxy and return the "token required" json instead of an image:

streams.whitestar.com/arcgis/rest/services/omnitrax/WS_Parcels_OMNITRAX/MapServer/export?dpi=96&transparent=true&format=png32&layers=show%3A0%2C1%2C2&bbox=-15859205.762025328%2C3291557.064882444%2C-6735682.065909116%2C7826413.078984177&bboxSR=102100&imageSR=102100&size=1865%2C927&f=image

What am missing?

Thanks

0 Kudos
1 Solution

Accepted Solutions
FredSpataro
Frequent Contributor

well.... long story short... if you run into this issue upgrading the jsapi version in the WAB (env.js) to 3.25 appears to fix it. 

long story longer:

I created a few items to isolate out the various candidates 

  • a webmap with only the secure service layer
  • a stock app template via the arcgis.com builder (v 2.9)
  • a stock app template via a clean install of the WAB Developer version 2.8. 

Trying various combinations, I found:

1. No issues either webmap (single secure service and multiple service)  using 2.9 version

2. No issues using the single secure service using the 2.8 version

3. Issue repos with the multiple service webmap and the stock 2.8 WAB version. 

The obvious difference in the 3.25 version of the javascript api and switching up to the new version seems to be resolving the issue.  Going one step further, I took the 3.x 'Create webmap from id' sample, added in the proxy settings and tried both the single and multiple webmaps with both the 3.24 and 3.25 versions.  I get the same results: both webmaps work with 3.25, only the single works with 3.24.

So it appears to be something in 3.24 - not WAB - with webmaps that have both secure and non-secure services running on HTTPS.  Time for a beer.

View solution in original post

4 Replies
RobertScheitlin__GISP
MVP Emeritus

Fred,

   Http and Https requests are viewed as two different urls. So you have a rule for https. Is the request that is failing using http or https?

0 Kudos
FredSpataro
Frequent Contributor

Hi Robert:

Both the "info" set and "export" set are HTTPS.  I'll add an HTTP rule and see of that changes anything...

0 Kudos
FredSpataro
Frequent Contributor

Adding the second HTTP rule doesn't help but try a few other things along those lines:

1. Setting all URLs (portal, proxy services, etc) to HTTPS --- still broke

2. Setting all URLs (portal, proxy services, etc) to HTTP --- WORKS!!! This is a pain b/c you have to open you're portal on HTTP to add the service as HTTP to the web map.

3. Leaving everything as it was mixed HTTPS but adding the service to the webmap as HTTP and setting the rule for the service as HTTP --- Works.

So somehow the "matching" function for the HTTPS export request is working correctly...

0 Kudos
FredSpataro
Frequent Contributor

well.... long story short... if you run into this issue upgrading the jsapi version in the WAB (env.js) to 3.25 appears to fix it. 

long story longer:

I created a few items to isolate out the various candidates 

  • a webmap with only the secure service layer
  • a stock app template via the arcgis.com builder (v 2.9)
  • a stock app template via a clean install of the WAB Developer version 2.8. 

Trying various combinations, I found:

1. No issues either webmap (single secure service and multiple service)  using 2.9 version

2. No issues using the single secure service using the 2.8 version

3. Issue repos with the multiple service webmap and the stock 2.8 WAB version. 

The obvious difference in the 3.25 version of the javascript api and switching up to the new version seems to be resolving the issue.  Going one step further, I took the 3.x 'Create webmap from id' sample, added in the proxy settings and tried both the single and multiple webmaps with both the 3.24 and 3.25 versions.  I get the same results: both webmaps work with 3.25, only the single works with 3.24.

So it appears to be something in 3.24 - not WAB - with webmaps that have both secure and non-secure services running on HTTPS.  Time for a beer.