Select to view content in your preferred language

WAB 2.7 Developer Edition, Deploy "Find Restaurant" widget app to IIS, Yelp restaurants do not show

1646
8
Jump to solution
08-09-2018 11:52 AM
BingJing
Regular Contributor

My customer "FindRestaurants" widget and application works well on the ArcGIS Online.  When I deployed to IIS server, the Yelp restaurants search didnot show anything. Looks like it didnot search Yelp. 

I have followed the deployment steps, and Robert's posts' instructions steps too(Thank you so much Robert). The Yelp API, config.json are setup. The address search works, but no yelp restaurants returned. Anyone has experience about what went wrong?

Here is the production application link.

ArcGIS Web Application  

(I also attached a screen copy of what should the yelp results be. This is the app I created through AGOL. )

Thank you so much.

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Bing,

   OK so your proxy.config should look like:

<?xml version="1.0" encoding="utf-8" ?>
<ProxyConfig allowedReferers="*" mustMatch="true">
  <serverUrls>
    <serverUrl url="http://services.arcgisonline.com" matchAll="true" />
    <serverUrl url="https://api.yelp.com" matchAll="true" />
    <serverUrl url="http://www.carsonproperty.info" matchAll="true" />
  </serverUrls>
</ProxyConfig>

View solution in original post

0 Kudos
8 Replies
RobertScheitlin__GISP
MVP Emeritus

Bing,

   I see three issue reported in the browsers web console.

  1. You have some local server urls in your app still.
  2. You have not setup the woff and woff2 mime types added to your IIS Server. How to set MIME types for web fonts in IIS? - Knowledgebase - AccuWebHosting 
  3. You need to add a Proxy to your IIS. GitHub - Esri/resource-proxy: Proxy files for DotNet, Java and PHP. https://blogs.esri.com/esri/supportcenter/2015/10/28/setting-up-a-proxy-with-web-appbuilder-for-arcg...
BingJing
Regular Contributor

Hi Robert, I could not get the proxy working. The below is the Proxy.config file. Does it look wrong? apiKey is the only parameter needed. I also already configured it in the widget folder's config.json.

<?xml version="1.0" encoding="utf-8" ?>
<ProxyConfig allowedReferers="*"
mustMatch="true">
<serverUrls>
<serverUrl url="http://services.arcgisonline.com"
matchAll="true"/>
<serverUrl url="https://api.yelp.com/v3/businesses/search?f=json" apiKey="bb*********************" matchAll="true" />
></serverUrl>
</serverUrls>
</ProxyConfig>

The config.json has the below.

...

"isWebTier": false,
"httpProxy": {
"useProxy": true,
"alwaysUseProxy": false,
"url": "http://www.carsonproperty.info/DotNet/Proxy.ashx",
"rules": []
},
"dataSource": {
"dataSources": {},
"settings": {}

...

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Bing,

   Your proxy is not running properly.

http://www.carsonproperty.info/DotNet/Proxy.ashx 

If you just go to this url is gives an application error.

0 Kudos
BingJing
Regular Contributor

Yes, it is because the "serverUrl" in Proxy.config is not configured right. I removed all items I added, now the error message of running proxy.ashx is :

{"error": {"code": 400,"message":"This proxy does not support empty parameters."}}

I am reading your post of 

  So first off you need to test your proxy with the following urls.

  1. http://host-vm/DotNet/proxy.ashx?ping
  2. http://host-vm/DotNet/proxy.ashx?http://server.virtual.private/arcgis/rest/services http://host-vm/DotNet/proxy.ashx?ping
  3. http://host-vm/DotNet/proxy.ashx?https://server.virtual.private/arcgis/rest/services

And I am stuck at the first step.  Thank you

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Bing,

   OK so your proxy.config should look like:

<?xml version="1.0" encoding="utf-8" ?>
<ProxyConfig allowedReferers="*" mustMatch="true">
  <serverUrls>
    <serverUrl url="http://services.arcgisonline.com" matchAll="true" />
    <serverUrl url="https://api.yelp.com" matchAll="true" />
    <serverUrl url="http://www.carsonproperty.info" matchAll="true" />
  </serverUrls>
</ProxyConfig>
0 Kudos
BingJing
Regular Contributor

That works!  Thank you Robert, you are great! 

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Don't forget to mark this question as answered by clicking on the "Mark Correct" link on the reply that answered your question.

0 Kudos
BingJing
Regular Contributor

I also debugged and found this "esri.config.defaults.io.proxyUrl is not set. If making a request to a CORS enabled server, please push the domain into esri.config.defaults.io.corsEnabledServers."

I did not get the proxy working correctly yet,  will post here once I figure out.

Thank you Robert for always helping out.

0 Kudos