ESRI Default Routing Service Usage in WAB

4491
11
Jump to solution
09-18-2015 11:40 AM
DavidColey
Frequent Contributor

I know this question has been all over the place but I just can't seem to find a good production deploy example.  I've got my proxy correctly configured with the esri routing service and esri geocode service. 

My proxy on my production IIS web server has been added and converted to an .NET4.0 integated app pool. I have tested the sevices.arcgisonline.com access redirect and it seems to be working fine:

    <serverUrls>
        <serverUrl url="https://services.arcgisonline.com"
                   matchAll="true"/>
  <serverUrl url="https://traffic.arcgis.com" username="dcoley_sarco" password="xxxx"
                   matchAll="true"/>
  <serverUrl url="https://route.arcgis.com" username="dcoley_sarco" password="xxxx"
                   matchAll="true"/>

I have assigned my appID and added my proxy url to my web app config.json:

"httpProxy": {
        "useProxy": true,
        "alwaysUseProxy": false,
        "url": "https://ags2.scgov.net/proxy/proxy.ashx",
        "rules": []
    },

but I still can't seem to access the route service from the directions widget without having to provide login credentials. 

What am I missing?  Do I need to add the route service to my items in ArcGIS Online?  Do I need to add more info in the rules array?

Thanks

David

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
YueWu1
by Esri Regular Contributor
Esri Regular Contributor

Hi David,

Not really sure if this issue has been resolved or not. However, here is the steps to make the proxy setting works for "Direction Widget"

1. Under your application folder, open the config.json file, add those rules under line "useProxy": true,

   "alwaysUseProxy": false,

  "alwaysUseProxy": false,

  "rules": [

  {

  "urlPrefix": "https://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",

  "proxyUrl": "yourproxyurl/proxy.ashx"

  },

        {

  "urlPrefix": "https://logistics.arcgis.com/arcgis/rest/services/World/Utilities/GPServer/GetTravelModes/",

  "proxyUrl": "yourproxyurl/proxy.ashx"

  }]

2. Make sure all three url that also define the proxy rule in your proxy file.

Hope this can help.

View solution in original post

11 Replies
Jianxia
Esri Regular Contributor

David,

I assume you are using Dev Edition 1.2, correct?

AGOL July release introduces Travel modes in Directions widget, which requires the service below:

http://logistics.arcgis.com/arcgis/rest/services/World/Utilities/GPServer

By default, the travel mode is enabled in WAB 1.2 and, unfortunately, we did not add above service in the widget configuration. As a result, you cannot set it as proxy service and the public access to the Directions widget is broken. You have to provide login credentials.

This has been fixed in WAB embedded in Online and will be fixed in dev edition 1.3. To workaround it, could you create a new app in online and download it locally. Unzip the downloaded file. Copy the directions widget over to replace the one in dev edition. Restart the builder and reconfigure the directions widget.

Thanks,

Jianxia

DavidColey
Frequent Contributor

Thank you Jianxia. Yes I am in Dev Edition 1.2 and until now had been supplying our own NA Server layer.  I'll proceed as you suggest and post back my findings here.

0 Kudos
DavidColey
Frequent Contributor

Ok so I am a little confused.  Are you suggesting to completely overwrite the \\myDevEdtionWab\widgets\Directions\Widget.js file with \\onlineEdtion\widgets\Directions\Widgets.js file?  There seem to be alot of differences: 1000+ un-minified lines in online directions js vs 300+ lines in dev

0 Kudos
Jianxia
Esri Regular Contributor

David,

Online version is minified but dev edition is not. Replace the Directions folder from

\\myDevEdtionWab\widgets\Directions

with

\\onlineEdtion\widgets\Directions

Make sure you make a copy of the original folder first.

This workaround is meant for Online Routing service. If you are using NA server from ArcGIS server, you should make directions widget publicly accessible without above changes as the travel modes are not available in ArcGIS Server yet. Could you please confirm?

Thanks,

Jianxia

0 Kudos
DavidColey
Frequent Contributor

I'm sorry Jianxia I had a typo in my last reply.  The code differences seem significant between the 2 widget js files. I un-minified the online version - there are over 10,000 lines of code in the online version as compared to 300-plus in the developer edition.  Is all that additional code required to handle the traffic mode?

0 Kudos
DavidColey
Frequent Contributor

Another thought has occurred.  Since the developer edition wab directions widget seems to handle travel modes and traffic without any issues as long as credentials are supplied, would it not be possible to simply include the travel modes url like:

"travelModesUrl": "http://logistics.arcgis.com/arcgis/rest/services/World/Utilities/GPServer"

in the directions widget config json and account for logistics url in the proxy and in the apps' http proxy rules?

0 Kudos
Jianxia
Esri Regular Contributor

David,

I am going to bring Qun, the developer on Directions widget, on board to assist you.

Qun Sun

Jianxia

0 Kudos
DavidColey
Frequent Contributor

That's fine.  It just really seemed like a significant code change.  At any rate, I'm probably going to submit a support ticket as I am having difficulty understanding how all of the proxy pieces fit together. 

0 Kudos
YueWu1
by Esri Regular Contributor
Esri Regular Contributor

Hi David,

Not really sure if this issue has been resolved or not. However, here is the steps to make the proxy setting works for "Direction Widget"

1. Under your application folder, open the config.json file, add those rules under line "useProxy": true,

   "alwaysUseProxy": false,

  "alwaysUseProxy": false,

  "rules": [

  {

  "urlPrefix": "https://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",

  "proxyUrl": "yourproxyurl/proxy.ashx"

  },

        {

  "urlPrefix": "https://logistics.arcgis.com/arcgis/rest/services/World/Utilities/GPServer/GetTravelModes/",

  "proxyUrl": "yourproxyurl/proxy.ashx"

  }]

2. Make sure all three url that also define the proxy rule in your proxy file.

Hope this can help.