Select to view content in your preferred language

Opening Edit Widget causes secure service challenge

697
3
Jump to solution
07-09-2012 09:02 AM
SimonRoss_User
Deactivated User
This follows from a previous post dealing with a similar issue but seemed better to post separately about this

Original post and solution is here
http://forums.arcgis.com/threads/61319-FV-3.0-Disable-Secure-Service-Login

Having launched a customized viewer as outline above I'm implementing the out of the box edit widget.  This is not preloaded at run time but when opened within the application it causes a challenge for secure servicee credentials but not for the services that can be edited

My map has three dynamic service layers (Base, Sensitivities, System) and three feature layers used for markup (Points, Lines, Polygons).  The dynamic service layers all access local data in file geodatabases.  The markup layers all access SDE layers on a SQLExpress database.

When turning on the widget I get challenged for credentials to Sensitivities - the dynamic map service.  If I enter valid credentials the dialog box disappears and the widget runs correctly. If I hit cancel the box opens back up again reqeusting credentials for Sensitivities.  If I hit cancel three times total then the dialog box disappears and the widget runs without issue.

Any thoughts before I dive into the code?
Thanks

Simon
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
SarthakDatt
Frequent Contributor
Hey Simon,

The out-of-the box Edit Widget looks at a dynamic map service and checks if there is a corresponding feature service which has editable feature layers. It then adds these feature layers to the map. In your case, I think you are using a proxy for the dynamic map service which when the Edit widget tries to create those feature layer(s) is not getting passed along(hence the prompt). This needs to be fixed in the widget.

In the meantime, assuming you are working with the source, so you can update the widget code:

 // get corresponding featurelayers
 var jsonTask:JSONTask = new JSONTask;
 var urlVars:URLVariables = new URLVariables();
 urlVars.f = "json";
// Line 401
 jsonTask.proxyURL = layer.proxyURL;    // assuming useProxy is true on the <layer> tag  
 jsonTask.url = featureServiceURL;  
 jsonTask.execute(urlVars, new AsyncResponder(jsonTask_resultHandler, jsonTask_faultHandler, { layer: layer, count: index }));

and 

fLayerObject = candidateFeatureLayers[index1];
var featureLayer:FeatureLayer = new FeatureLayer;
// Line 461
featureLayer.proxyURL = arcGISDynamicMapServiceLayer.proxyURL;
featureLayer.url = featureServiceURL + "/" + fLayerObject.id;    
updateFeatureLayerMinMaxScale(featureLayer, fLayerObject.id, copyLayerInfos);
featureLayer.addEventListener(LayerEvent.LOAD, featureLayerLoadHandler);
featureLayer.addEventListener(LayerEvent.LOAD_ERROR, featureLayerLoadErrorHandler);


Alternatively, you can try adding all the feature layer(s)(in the corresponding FeatureServer) as operational layers in the config upfront with useProxy=true. The Edit Widget will not try to add those feature layers then.

Hope that helps.

View solution in original post

0 Kudos
3 Replies
SimonRoss_User
Deactivated User
As an addition to this - I have seen changes to behaviour with different widgets enabled.  With only edit, locate, draw and print enabled then when I open edit it actualyl cycles through permission requests for the three dynamic map services by name
0 Kudos
SarthakDatt
Frequent Contributor
Hey Simon,

The out-of-the box Edit Widget looks at a dynamic map service and checks if there is a corresponding feature service which has editable feature layers. It then adds these feature layers to the map. In your case, I think you are using a proxy for the dynamic map service which when the Edit widget tries to create those feature layer(s) is not getting passed along(hence the prompt). This needs to be fixed in the widget.

In the meantime, assuming you are working with the source, so you can update the widget code:

 // get corresponding featurelayers
 var jsonTask:JSONTask = new JSONTask;
 var urlVars:URLVariables = new URLVariables();
 urlVars.f = "json";
// Line 401
 jsonTask.proxyURL = layer.proxyURL;    // assuming useProxy is true on the <layer> tag  
 jsonTask.url = featureServiceURL;  
 jsonTask.execute(urlVars, new AsyncResponder(jsonTask_resultHandler, jsonTask_faultHandler, { layer: layer, count: index }));

and 

fLayerObject = candidateFeatureLayers[index1];
var featureLayer:FeatureLayer = new FeatureLayer;
// Line 461
featureLayer.proxyURL = arcGISDynamicMapServiceLayer.proxyURL;
featureLayer.url = featureServiceURL + "/" + fLayerObject.id;    
updateFeatureLayerMinMaxScale(featureLayer, fLayerObject.id, copyLayerInfos);
featureLayer.addEventListener(LayerEvent.LOAD, featureLayerLoadHandler);
featureLayer.addEventListener(LayerEvent.LOAD_ERROR, featureLayerLoadErrorHandler);


Alternatively, you can try adding all the feature layer(s)(in the corresponding FeatureServer) as operational layers in the config upfront with useProxy=true. The Edit Widget will not try to add those feature layers then.

Hope that helps.
0 Kudos
SimonRoss_User
Deactivated User
Thanks Sarthak - that fixed the issue
0 Kudos