Esempio n. 1
0
        public LocalNetwork GetProfileNetworkForBrowser(int profileId)
        {
            //Debug logging
            XmlUtilities.logit("Line1: profileid:" + profileId);

            NetworkBrowserBL nb = new NetworkBrowserBL();


            try
            {
                using (XmlReaderScope scope = nb.GetProfileNetworkForBrowser(profileId))
                {
                    Type type = typeof(LocalNetwork);

                    string responseXML;

                    scope.Reader.Read();

                    responseXML = scope.Reader.ReadOuterXml();


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

                    return(ln);
                }
            }
            catch (Exception ex)
            {
                XmlUtilities.logit("ERROR: " + ex.Message + " " + ex.StackTrace + " ,,,, INNER EXCEPTION: " + ex.InnerException.Message + ex.InnerException.StackTrace);
                throw ex;
            }
        }
Esempio n. 2
0
        public MatchingKeywordList GetMatchingKeywords(string keyword, string queryID, bool exactKeyword)
        {
            ProfileSearchBL ps = new ProfileSearchBL();

            Connects.Profiles.Service.DataContracts.MatchingKeywordList pl = new Connects.Profiles.Service.DataContracts.MatchingKeywordList();

            using (XmlReaderScope scope = ps.GetMatchingKeywords(keyword, queryID, exactKeyword))
            {
                Type   type = typeof(MatchingKeywordList);
                string responseXML;

                scope.Reader.Read();
                responseXML = scope.Reader.ReadOuterXml();

                pl = XmlUtilities.DeserializeObject(responseXML, type) as MatchingKeywordList;

                return(pl);
            }
        }
Esempio n. 3
0
        public PersonList ProfileSearch(Connects.Profiles.Service.DataContracts.Profiles qd, bool isSecure)
        {
            PersonList pl = null;

            try
            {
                ProfileSearchBL ps = new ProfileSearchBL();
                Connects.Profiles.Service.DataContracts.Profiles p = new Connects.Profiles.Service.DataContracts.Profiles();

                //qd.OutputOptions.StartRecord = (Convert.ToInt32(qd.OutputOptions.StartRecord) + 1).ToString();

                string req = XmlUtilities.SerializeToString(qd);


                req = req.Replace("Version=\"0\"", "Version=\"1\"");


                XmlUtilities.logit("Line 1: ProfileServiceAdapter.ProfileSearch(" + req + "," + isSecure.ToString() + ")");

                // If we are enforcing XSD
                if (Convert.ToBoolean(ConfigUtil.GetConfigItem("EnforceQuerySchema")) == true)
                {
                    XmlUtilities.logit("Line 2: Enforcing XSD");
                    if (ValidateSearchRequest(req) == false)
                    {
                        XmlUtilities.logit("Line 3: Failed XSD");
                        throw new Exception("Search request failed XML schema validation");
                    }
                    XmlUtilities.logit("Line 3: Passed XSD");
                }
                else
                {
                    XmlUtilities.logit("Line 2 and 3: No XSD Required");
                }

                using (XmlReaderScope scope = ps.ProfileSearch(req, isSecure))
                {
                    Type   type = typeof(PersonList);
                    string responseXML;

                    scope.Reader.Read();

                    responseXML = scope.Reader.ReadOuterXml();
                    XmlUtilities.logit("Line 4: Response data " + responseXML);

                    // If we are enforcing XSD
                    if (Convert.ToBoolean(ConfigUtil.GetConfigItem("EnforceResponseSchema")) == true)
                    {
                        XmlUtilities.logit("Line 5: Enforcing response XSD");

                        if (ValidateSearchResponse(responseXML) == false)
                        {
                            XmlUtilities.logit("Line 6: Failed response xsd");
                            throw new Exception("Search response failed XML schema validation");
                        }
                        XmlUtilities.logit("Line 6: Passed response xsd");
                    }
                    else
                    {
                        XmlUtilities.logit("Line 5 and 6: No XSD Required");
                    }


                    pl = XmlUtilities.DeserializeObject(responseXML, type) as PersonList;

                    XmlUtilities.logit("Line 7: Returned to requestor");
                }
            }
            catch (Exception ex)
            {
                XmlUtilities.logit("ERROR==> " + ex.Message + " STACK:" + ex.StackTrace + " SOURCE:" + ex.Source);
            }


            return(pl);
        }