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.
(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.
Solved! Go to Solution.
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>
Bing,
I see three issue reported in the browsers web console.
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": {}
...
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.
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.
And I am stuck at the first step. Thank you
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>
That works! Thank you Robert, you are great!
Don't forget to mark this question as answered by clicking on the "Mark Correct" link on the reply that answered your question.
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.