Select to view content in your preferred language

Error Network Connection during Data Sync - MobileServiceConnection

1919
1
10-12-2011 07:35 AM
RobertMEIER
Regular Contributor
Just recently started happening, I have not been able to connect to my service to sync data. I have recreated the mxd and the service, but still cannot connect.

The error is "Could not establish connection to network."

I wrote the following to test the connection -

            MobileServiceConnection connection = new MobileServiceConnection();
        
            connection.Url = @"http://<servername>/arcgis/services/<foldername>/<servicename>/MapServer/MobileServer"
            bool bjunk = connection.IsValid;
            FeatureLayer flCR = myMobileCache.Layers["NSMobile_CR"] as FeatureLayer;
            connection.GetFeatureCount(flCR,null);

The connection.IsValid test returns true, but the connection.GetFeatureCount returns the connection error.

I have the device connected to my laptop via Mobile Data Center.

any help is appreciated

-bert
.
0 Kudos
1 Reply
RobertMEIER
Regular Contributor
Actually one of my coworkers figured this out, turns out it was an internal network DNS issue.

A simple fix was to just use the ip address in the url

connection.Url = @"http://<IP Address>/arcgis/services/<foldername>/<servicename>/MapServer/MobileServer"
0 Kudos