// public UserArray cprsUserLookup(string sitecode, string target) { UserArray result = new UserArray(); string msg = MdwsUtils.isAuthorizedConnection(mySession, sitecode); if (msg != "OK") { result.fault = new FaultTO(msg); } if (result.fault != null) { return result; } if (sitecode == null) { sitecode = mySession.ConnectionSet.BaseSiteId; } try { AbstractConnection cxn = mySession.ConnectionSet.getConnection(sitecode); UserApi api = new UserApi(); User[] matches = api.providerLookup(cxn, new KeyValuePair<string,string>("NAME",target)); result = new UserArray(matches); } catch (Exception e) { result.fault = new FaultTO(e.Message); } 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; }