// DON'T SEE A USERLOOKUPBYNAME FUNCTION ON USERAPI public TaggedUserArrays lookupMS(string target, string maxRex) { TaggedUserArrays result = new TaggedUserArrays(); string msg = MdwsUtils.isAuthorizedConnection(mySession); if (msg != "OK") { result.fault = new FaultTO(msg); } else if (target == "") { result.fault = new FaultTO("Missing target"); } //else if (!StringUtils.isNumeric(maxRex)) //{ // result.fault = new FaultTO("Non-numeric maxRex"); //} if (result.fault != null) { return result; } try { KeyValuePair<string, string> kvp = new KeyValuePair<string, string>("NAME",target); UserApi api = new UserApi(); IndexedHashtable t = api.userLookup(mySession.ConnectionSet, kvp, maxRex); result = new TaggedUserArrays(t); } catch (Exception e) { result.fault = new FaultTO(e.Message); } return result; }
public UserTO userLookup(string duz) { UserTO result = new UserTO(); string msg = MdwsUtils.isAuthorizedConnection(mySession); if (String.IsNullOrEmpty(duz)) { result.fault = new FaultTO("Missing DUZ param"); } else if (msg != "OK") { result.fault = new FaultTO(msg); } if (result.fault != null) { return result; } try { AbstractConnection cxn = mySession.ConnectionSet.BaseConnection; UserApi api = new UserApi(); User[] user = api.userLookup(cxn, new System.Collections.Generic.KeyValuePair<string, string>("DUZ", duz)); result = new UserTO(user[0]); } catch (Exception exc) { result.fault = new FaultTO(exc); } return result; }
public UserArray lookup(string sitecode, string target, string maxRex) { UserArray result = new UserArray(); string msg = MdwsUtils.isAuthorizedConnection(mySession, sitecode); if (msg != "OK") { result.fault = new FaultTO(msg); } else if (target == "") { result.fault = new FaultTO("Missing target"); } else if (!StringUtils.isNumeric(maxRex)) { result.fault = new FaultTO("Non-numeric maxRex"); } if (result.fault != null) { return result; } if (String.IsNullOrEmpty(sitecode)) { sitecode = mySession.ConnectionSet.BaseSiteId; } try { AbstractConnection cxn = mySession.ConnectionSet.Connections[sitecode]; UserApi api = new UserApi(); User[] matches = api.userLookup(cxn, new KeyValuePair<string,string>("NAME", target)); //.userLookupByName(cxn, target, maxRex); result = new UserArray(matches); } catch (Exception e) { result.fault = new FaultTO(e.Message); } return result; }