Esempio n. 1
0
        public AesMobileStationLocation queryMAC(String mac)
        {
            ServicePointManager.ServerCertificateValidationCallback += new System.Net.Security.RemoteCertificateValidationCallback(ValidateServerCertificate);

            LocationService LS = new LocationService("https://" + mseAddr + "/location/");
            String lmac = mac.ToLower();
            try {
                AesGetChanges AGC = new AesGetChanges();
                AGC.classname = "AesMobileStationLocation";

                GetChangesMethodArgs GCM = new GetChangesMethodArgs();
                GCM.AesBusinessSession = new location.AesBusinessSession();
                GCM.AesBusinessSession.id = sessionId;
                GCM.AesGetChanges = AGC;

                location.Response r = LS.GetChanges(GCM);
                if ((r == null) || (r.Items == null))
                    return null;

                foreach (location.AesObject aesObj in r.Items) {
                    if (aesObj is AesMobileStationLocation) {
                        AesMobileStationLocation loc = (AesMobileStationLocation)aesObj;
                        // if (loc.macAddress.Equals(mac))
                        //    return (loc);
                        if (loc.macAddress.ToLower().Equals(lmac))
                            return (loc);
                    }
                }
            } catch (Exception x) {
                Trace.WriteLine(x);
            }
            return null;
        }
Esempio n. 2
0
        public AesMobileStationLocation[] query()
        {
            //ping();
            ServicePointManager.ServerCertificateValidationCallback += new System.Net.Security.RemoteCertificateValidationCallback(ValidateServerCertificate);

            LocationService LS = new LocationService("https://" + mseAddr + "/location/");
            try {
                GetChangesMethodArgs GCM = new GetChangesMethodArgs();
                GCM.AesBusinessSession = new location.AesBusinessSession();
                GCM.AesBusinessSession.id = sessionId;
                AesGetChanges AGC = new AesGetChanges();
                AGC.classname = "AesMobileStationLocation";

                GCM.AesGetChanges = AGC;
                location.Response r = LS.GetChanges(GCM);

                if (r != null && r.Items != null) {
                    int count = 0;
                    foreach (location.AesObject aesObj in r.Items) {
                        if (aesObj is AesMobileStationLocation)
                            count++;
                    }
                    AesMobileStationLocation[] locs = new AesMobileStationLocation[count];
                    int j = 0;
                    foreach (location.AesObject aesObj in r.Items) {
                        if (aesObj is AesMobileStationLocation) {
                            AesMobileStationLocation loc = (AesMobileStationLocation)aesObj;
                            locs[j++] = loc;
                        }
                    }
                    return locs;
                } else {
                    Trace.WriteLine("GetChanges Failed");
                }
            } catch (Exception x) {
                Trace.WriteLine(x);
            }
            return new location.AesMobileStationLocation[0];
        }
Esempio n. 3
0
 /// <remarks/>
 public void GetChangesAsync(GetChangesMethodArgs GetChanges1)
 {
     this.GetChangesAsync(GetChanges1, null);
 }
Esempio n. 4
0
 /// <remarks/>
 public void GetChangesAsync(GetChangesMethodArgs GetChanges1, object userState)
 {
     if ((this.GetChangesOperationCompleted == null))
     {
         this.GetChangesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetChangesOperationCompleted);
     }
     this.InvokeAsync("GetChanges", new object[] {
             GetChanges1}, this.GetChangesOperationCompleted, userState);
 }
Esempio n. 5
0
 /// <remarks/>
 public System.IAsyncResult BeginGetChanges(GetChangesMethodArgs GetChanges1, System.AsyncCallback callback, object asyncState)
 {
     return this.BeginInvoke("GetChanges", new object[] {
             GetChanges1}, callback, asyncState);
 }