I have the DotNet Proxy installed and working for url="https://route.arcgis.com/" like in the example.
I am now trying to do this for a Feature Service in my App...but not working it keeps asking me for Credentials...
ANY HELP would be appreciated.
I created a Function that works for the first two and then tried to add my Feature Service
Do I need to define this URL to the index number???? /FeatureService/0/
window.jsWidgets = function(){
//SET UP PROXY RULE FOR ROUTING AND TRAFFIC
// https://community.esri.com/groups/technical-support/blog/2015/04/07/setting-up-a-proxy/
urlUtils.addProxyRule({
urlPrefix: "route.arcgis.com",
proxyUrl: "https://xxxx.xxx.xxx.gov/DotNet/proxy.ashx"
});
urlUtils.addProxyRule({
urlPrefix: "traffic.arcgis.com",
proxyUrl: "https://xxxx.xxx.xxx.gov/DotNet/proxy.ashx"
});
urlUtils.addProxyRule({
urlPrefix: "https://xxxx.xxx.xxx.gov/arcgis/rest/services/Something/",
proxyUrl: "https://xxxx.xxx.xxx.gov/DotNet/proxy.ashx"
});
}
Then in my proxy.config I added this
DO I need to define this URL to the index number???? /FeatureService/0/
<serverUrl url="https://xxxx.xxxx.xxxx.gov/arcgis/rest/services/Something/"
matchAll="true" username="User" password="U$er" tokenServiceUrl="https://xxxx.xxxx.xxxx.gov/arcgis/tokens/"/>
This is how I have the Feature Service in my JS
Do I need to reference a Token number or something?
window.ServiceTest = new FeatureLayer("https://xxxx.xxxx.xxxx.gov/arcgis/rest/services/Something/ServiceName/FeatureServer/0", {
mode: FeatureLayer.MODE_SNAPSHOT,
id: "ServiceTest",
opacity: .4,
visible: true,
outFields:["*"]
});
legendLayers4.push({ layer: ServiceTest, title: 'NWTL Test' });
Solved! Go to Solution.
I got it....
<serverUrl url="https://xxxx.xxxx.xxxx.gov/arcgis/rest/services/Test/Test/FeatureServer/0"
matchAll="true" username="User" password="U$er"
tokenServiceUrl="https://xxxx.xxxx.xxxx.gov/arcgis/tokens/" />
urlUtils.addProxyRule({
urlPrefix: "https://xxxx.xxxx.xxxx.gov/arcgis/rest/services/Testing/Test/FeatureServer/0",
proxyUrl: "https://xxxx.xxxx.xxxx.gov/DotNet/proxy.ashx"
});
window.ServiceTest = new FeatureLayer("https://xxxx.xxxx.xxx.gov/arcgis/rest/services/Testing/Test/FeatureServer/0", {
mode: FeatureLayer.MODE_SNAPSHOT,
id: "ServiceTest",
opacity: .4,
visible: true,
outFields:["*"]
});
legendLayers4.push({ layer: ServiceTest, title: 'Test' });
I got it....
<serverUrl url="https://xxxx.xxxx.xxxx.gov/arcgis/rest/services/Test/Test/FeatureServer/0"
matchAll="true" username="User" password="U$er"
tokenServiceUrl="https://xxxx.xxxx.xxxx.gov/arcgis/tokens/" />
urlUtils.addProxyRule({
urlPrefix: "https://xxxx.xxxx.xxxx.gov/arcgis/rest/services/Testing/Test/FeatureServer/0",
proxyUrl: "https://xxxx.xxxx.xxxx.gov/DotNet/proxy.ashx"
});
window.ServiceTest = new FeatureLayer("https://xxxx.xxxx.xxx.gov/arcgis/rest/services/Testing/Test/FeatureServer/0", {
mode: FeatureLayer.MODE_SNAPSHOT,
id: "ServiceTest",
opacity: .4,
visible: true,
outFields:["*"]
});
legendLayers4.push({ layer: ServiceTest, title: 'Test' });