Select to view content in your preferred language

Create Replica from FeatureService with Basic authentication on Windows Phone, Return error 404

1276
2
Jump to solution
09-23-2016 07:09 AM
TércyoStorck1
Occasional Contributor

Hi,

I've tried to create a replica from a FeatureService that has basic authentication. When I request the replica from Windows Store, it works fine. When the request comes from Windows Phone, the callback returns a 404 Error (URL not found).

PS.: It's an UWP project and I'm using the code below for the both applications.

DTO.AGSAuth agsAuth = await restConn.ArcGISServerRequestCredentialAsync(this.featureService.Url);

GeodatabaseSyncTask gdbTask = new GeodatabaseSyncTask(new Uri(this.featureService.Url));

if (agsAuth != null)
{
    switch (agsAuth.mode)
    {
        case "TOKEN":
            DTO.AGSAuthToken agsToken = agsAuth as DTO.AGSAuthToken;
            gdbTask.Token = agsToken.credential.token;
            break;
        case "BASIC":
            agsAuthBasic = agsAuth as DTO.AGSAuthBasic;

            byte[] data = Convert.FromBase64String(agsAuthBasic.credential.key);
            string[] credentials = Encoding.UTF8.GetString(data, 0, data.Length).Split(':');

            string userName = credentials[0].Split('\\')[1], passWord = credentials[1], domain = credentials[0].Split('\\')[0];

            System.Net.NetworkCredential networkCredential = new System.Net.NetworkCredential(userName, passWord, domain);

            var credential = new ArcGISNetworkCredential
            {
                Credentials = networkCredential,
                ServiceUri = this.featureService.Url
            };

            IdentityManager.Current.AddCredential(credential);
            break;
        default:
            break;
    }
}

featureService.Layers = await new DAO.DAOFeatureServiceLayer().GetFromServiceAsync(featureService);
featureService.Extent = new DAO.DAOMapa().GetExtent(App.Usuario);

var gdbParams = new GenerateGeodatabaseParameters(featureService.Layers.Select(x => x.ID), featureService.Extent)
{
    OutSpatialReference = new SpatialReference(102100),
    SyncModel = SyncModel.PerLayer,
    ReturnAttachments = true
};

await gdbTask.GenerateGeodatabaseAsync
    (
        gdbParams,
        GdbCreatedCompleteCallback,
                            new TimeSpan(0, 1, 0),
                            null,
                            CancellationToken.None
                            );
0 Kudos
1 Solution

Accepted Solutions
MichaelBranscomb
Esri Frequent Contributor

Hi,

The current ArcGIS Runtime SDK 10.2.7 for .NET API that targets Windows Store 8.1 apps will technically work for building UWP apps but is not officially certified or supported on that platform. 

We're currently working on the next major release of ArcGIS Runtime SDK for .NET which includes an API specifically targeting the UWP platform. That was released in beta back in July. If you're building a UWP app I recommend starting with the beta ArcGIS Runtime SDK for .Net | ArcGIS for Developers and if you run into any issues please post for discussion in the beta forum or report bugs via the feedback facility in the beta community site: http://links.esri.com/runtime-dotnet-sdk-forum

Cheers

Mike

View solution in original post

2 Replies
MichaelBranscomb
Esri Frequent Contributor

Hi,

The current ArcGIS Runtime SDK 10.2.7 for .NET API that targets Windows Store 8.1 apps will technically work for building UWP apps but is not officially certified or supported on that platform. 

We're currently working on the next major release of ArcGIS Runtime SDK for .NET which includes an API specifically targeting the UWP platform. That was released in beta back in July. If you're building a UWP app I recommend starting with the beta ArcGIS Runtime SDK for .Net | ArcGIS for Developers and if you run into any issues please post for discussion in the beta forum or report bugs via the feedback facility in the beta community site: http://links.esri.com/runtime-dotnet-sdk-forum

Cheers

Mike

TércyoStorck1
Occasional Contributor

Do you know if they'll fix it in the current ArcGis Runtime SDK? Or only in Quartz?

0 Kudos