Select to view content in your preferred language

Token authentication error for posting updates

3147
3
06-30-2010 02:41 PM
Jitendrudulacaraju
Emerging Contributor
I get this error:
The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.

Code:
userName = loginView.TextBoxUserName.Text;
            password = loginView.TextBoxPassword.Text;

            catalogService.Url = @"http://Server/arcgis/rest/services";
           requiresToken = catalogService.RequiresTokens();
            if (!requiresToken)
            {
                tokenServiceUrl = catalogService.GetTokenServiceURL();
                tokenServiceUrl = @"https://Server/ArcGIS/tokens/gettoken.html";
                tokenCredentials = new TokenCredential(userName,password);
                TokenGenerator tokenGenerator = new TokenGenerator();
                token = TokenGenerator.GenerateToken(tokenServiceUrl, tokenCredentials);
            }
           
            Mapservice.MobileService.ServiceConnection.TokenCredential = new TokenCredential(userName, password);
            mapservice.MobileService.Url = "http://Server/ArcGIS/services/StormWaterMobile/MapServer" + "?" + token;
        }
0 Kudos
3 Replies
MaximilianGlas
Esri Contributor
0 Kudos
Jitendrudulacaraju
Emerging Contributor
Same error like me.
You have seen my post already?
http://forums.arcgis.com/threads/7013-9.3.1-HowTo-Using-mobile-service-connections-with-SSL


Seen that post. Did the same.Will help if you can post the code snippet as well. What does that code line do, please brief.
thanks
0 Kudos
MaximilianGlas
Esri Contributor
It is really simple, not sure if a code snippet is really necessary.
What it does? See google:
http://www.google.de/search?q=ServerCertificateValidationCallback
0 Kudos