isRpcAvailable() public method

public isRpcAvailable ( ConnectionSet cxns, string target, string context ) : IndexedHashtable
cxns gov.va.medora.mdo.dao.ConnectionSet
target string
context string
return IndexedHashtable
Exemplo n.º 1
0
        public TextTO isRpcAvailable(string sitecode, string target, string context)
        {
            TextTO result = new TextTO();
            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 (context == "")
            {
                result.fault = new FaultTO("Missing context");
            }
            if (result.fault != null)
            {
                return result;
            }

            if (sitecode == null)
            {
                sitecode = mySession.ConnectionSet.BaseSiteId;
            }

            try
            {
                AbstractConnection cxn = mySession.ConnectionSet.getConnection(sitecode);
                ToolsApi api = new ToolsApi();
                string s = api.isRpcAvailable(cxn, target, context);
                result = new TextTO(s);
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e.Message);
            }
            return result;
        }