Exemplo n.º 1
0
        public LocalNetwork GetProfileNetworkForBrowser(int profileId)
        {
            //Debug logging
            Connects.Profiles.Service.ServiceImplementation.DebugLogging.Log("Line1: profileid:" + profileId);

            DataIO nb = new DataIO();


            try
            {
                Type type = typeof(LocalNetwork);

                string responseXML;

                responseXML = nb.GetProfileNetworkForBrowser(profileId).OuterXml;

                LocalNetwork ln = XmlUtilities.DeserializeObject(responseXML, type) as LocalNetwork;

                return(ln);
            }
            catch (Exception ex)
            {
                DebugLogging.Log("ERROR: " + ex.Message + " " + ex.StackTrace + " ,,,, INNER EXCEPTION: " + ex.InnerException.Message + ex.InnerException.StackTrace);
                throw ex;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Public method used to create an instance of the custom Profiles session object.
        /// </summary>
        public string SessionCreate()
        {
            DataIO dataio = new DataIO();


            Session session  = new Session();
            string  hostname = System.Net.Dns.GetHostName();

            string ipaddress = string.Empty;

            try
            {
                ipaddress = System.Net.Dns.GetHostAddresses(hostname).GetValue(1).ToString();
            }
            catch (Exception ex)
            {
                DebugLogging.Log(ex.Message + " ++ " + ex.StackTrace);
                ipaddress = "";
            }

            session.RequestIP = ipaddress;
            session.UserAgent = "PROFILES RNS";

            dataio.SessionCreate(ref session);

            //Store the object in the current session of the user.
            return(session.SessionID);
        }
Exemplo n.º 3
0
 public LocalNetwork GetProfileNetworkForBrowser(string profileId)
 {
     try
     {
         return(new NetworkBrowserServiceAdapter().GetProfileNetworkForBrowser(Convert.ToInt32(profileId)));
     }
     catch (Exception ex)
     {
         DebugLogging.Log("message==>" + ex.Message + " stacktrace==>" + ex.StackTrace + " source==" + ex.Source + " INNER: stack trace==> " + ex.InnerException.StackTrace + " message==>" + ex.InnerException.Message);
         throw ex;
     }
 }
Exemplo n.º 4
0
        public Connects.Profiles.Service.DataContracts.PersonList ProfileSearch(Connects.Profiles.Service.DataContracts.Profiles qd, bool isSecure)
        {
            Connects.Profiles.Service.DataContracts.PersonList pl = null;
            string req         = string.Empty;
            string responseXML = string.Empty;

            try
            {
                DataIO            ps            = new DataIO();
                XmlDocument       searchrequest = new XmlDocument();
                Utility.Namespace namespacemgr  = new Connects.Profiles.Utility.Namespace();


                Connects.Profiles.Service.DataContracts.Profiles p = new Connects.Profiles.Service.DataContracts.Profiles();

                req = Connects.Profiles.Utility.XmlUtilities.SerializeToString(qd);

                DebugLogging.Log("+++++++++ REQUEST=" + req);

                Type type = typeof(Connects.Profiles.Service.DataContracts.PersonList);

                searchrequest.LoadXml(this.ConvertToRDFRequest(req, qd.Version.ToString()));



                if (qd.QueryDefinition.PersonID != null && qd.Version != 2)
                {
                    qd.QueryDefinition.PersonID = ps.GetPersonID(qd.QueryDefinition.PersonID).ToString();
                }



                if (qd.QueryDefinition.PersonID != null)
                {
                    responseXML = ps.Search(qd.QueryDefinition.PersonID, isSecure).OuterXml;
                }
                else
                {
                    responseXML = ps.Search(searchrequest, isSecure).OuterXml;
                }


                string queryid = string.Empty;
                queryid = qd.QueryDefinition.QueryID;


                if (responseXML == string.Empty)
                {
                    if (queryid == null)
                    {
                        queryid = Guid.NewGuid().ToString();
                    }


                    responseXML = "<PersonList Complete=\"true\" ThisCount=\"0\" TotalCount=\"0\" QueryID=\"" + queryid + "\" xmlns=\"http://connects.profiles.schema/profiles/personlist\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" />";
                }
                else
                {
                    string version    = string.Empty;
                    bool   individual = false;


                    version = qd.Version.ToString();

                    if (qd.QueryDefinition.PersonID != null || qd.QueryDefinition.InternalIDList != null)
                    {
                        individual = true;
                    }

                    responseXML = ps.ConvertV2ToBetaSearch(responseXML, queryid, version, individual);
                }

                DebugLogging.Log("+++++++++ DONE WITH Convert V2 to Beta Search");
                pl = Connects.Profiles.Utility.XmlUtilities.DeserializeObject(responseXML, type) as Connects.Profiles.Service.DataContracts.PersonList;
                DebugLogging.Log("+++++++++ Returned + a total count of = " + pl.TotalCount);
            }
            catch (Exception ex)
            {
                DebugLogging.Log(req + " " + responseXML);
                DebugLogging.Log("ERROR==> " + ex.Message + " STACK:" + ex.StackTrace + " SOURCE:" + ex.Source);
            }

            return(pl);
        }