Exemple #1
0
 internal static StatusResponseType SubmitHelper(string NodeURL, string secToken, string dataFlow, string flowOperation, byte[] doc, string docName, DocumentFormatType docFormat, string docID)
 {
     try
     {
         AttachmentType att1 = new AttachmentType();
         att1.Value = doc;
         NodeDocumentType doc1 = new NodeDocumentType();
         doc1.documentName = docName;
         doc1.documentFormat = docFormat;
         doc1.documentId = docID;
         doc1.documentContent = att1;
         NodeDocumentType[] docArray = new NodeDocumentType[1];
         docArray[0] = doc1;
         Submit sub1 = new Submit();
         sub1.securityToken = secToken;
         sub1.transactionId = "";
         sub1.dataflow = dataFlow;
         sub1.flowOperation = flowOperation;
         sub1.documents = docArray;
         NetworkNode2 nn = new NetworkNode2();
         nn.SoapVersion = SoapProtocolVersion.Soap12;
         nn.Url = NodeURL;
         return nn.Submit(sub1);
     }
     catch (SoapException sExept)
     {
         db_Ref.InsertT_OE_SYS_LOG("WQX", sExept.Message.SubStringPlus(0, 1999));
         return null;
     }
 }
Exemple #2
0
        internal static StatusResponseType SolicitHelper(string NodeURL, string secToken, string dataFlow, string request, int? rowID, int? maxRows, List<ParameterType> pars)
        {
            try
            {
                NetworkNode2 nn = new NetworkNode2();
                nn.Url = NodeURL;
                nn.SoapVersion = SoapProtocolVersion.Soap12;

                Solicit s1 = new Solicit();
                s1.securityToken = secToken;
                s1.dataflow = dataFlow;
                s1.request = request;

                ParameterType[] ps = new ParameterType[pars.Count];
                int i = 0;
                System.Xml.XmlQualifiedName parType = new System.Xml.XmlQualifiedName("string", "http://www.w3.org/2001/XMLSchema");
                foreach (ParameterType par in pars)
                {
                    if (par.parameterEncoding == null) par.parameterEncoding = EncodingType.None;
                    ps[i] = par;
                    i++;
                }

                s1.parameters = ps;

                return nn.Solicit(s1);
            }
            catch (SoapException sExept)
            {
                db_Ref.InsertT_OE_SYS_LOG("WQX", sExept.Message.SubStringPlus(0, 1999));
                return null;
            }
        }
Exemple #3
0
        internal static ResultSetType QueryHelper(string NodeURL, string secToken, string dataFlow, string request, int? rowID, int? maxRows, List<ParameterType> pars)
        {
            try
            {
                NetworkNode2 nn = new NetworkNode2();
                nn.Url = NodeURL;
                nn.SoapVersion = SoapProtocolVersion.Soap12;

                Query q1 = new Query();
                q1.securityToken = secToken;
                q1.dataflow = dataFlow;
                q1.request = request;
                q1.rowId = (rowID ?? 0).ToString();
                q1.maxRows = (maxRows ?? -1).ToString();

                ParameterType[] ps = new ParameterType[pars.Count];
                int i = 0;
                System.Xml.XmlQualifiedName parType = new System.Xml.XmlQualifiedName("string", "http://www.w3.org/2001/XMLSchema");
                foreach (ParameterType par in pars)
                {
                    if (par.parameterEncoding == null) par.parameterEncoding = EncodingType.None;
                    ps[i] = par;
                    i++;
                }

                q1.parameters = ps;

                return nn.Query(q1);
            }
            catch (SoapException sExept)
            {
                db_Ref.InsertT_OE_SYS_LOG("ERROR", sExept.Message.SubStringPlus(0, 1999));   //logging an authentication failure

                //special handling of an unauthorized
                if (sExept.Message.SubStringPlus(0, 9) == "ORA-20997")
                {
                    ResultSetType rs = new ResultSetType();
                    rs.rowId = "-99";
                    return rs;
                }

                return null;
            }
        }
Exemple #4
0
 internal static StatusResponseType GetStatusHelper(string NodeURL, string secToken, string transID)
 {
     try
     {
         NetworkNode2 nn = new NetworkNode2();
         nn.Url = NodeURL;
         GetStatus gs1 = new GetStatus();
         gs1.securityToken = secToken;
         gs1.transactionId = transID;
         return nn.GetStatus(gs1);
     }
     catch
     {
         return null;
     }
 }
Exemple #5
0
 internal static NodeDocumentType[] DownloadHelper(string NodeURL, string secToken, string dataFlow, string transID)
 {
     try
     {
         NetworkNode2 nn = new NetworkNode2();
         nn.Url = NodeURL;
         Download dl1 = new Download();
         dl1.securityToken = secToken;
         dl1.dataflow = dataFlow;
         dl1.transactionId = transID;
         return nn.Download(dl1);
     }
     catch
     {
         return null;
     }
 }
Exemple #6
0
 /// <summary>
 /// Calls Exchange Network authenticate method
 /// </summary>
 /// <returns>Security token if valid or empty string if failed</returns>
 internal static string AuthHelper(string userID, string credential, string authMethod, string domain, string NodeURL)
 {
     NetworkNode2 nn = new NetworkNode2();
     nn.Url = NodeURL;
     Authenticate auth1 = new Authenticate();
     auth1.userId = userID;
     auth1.credential = credential;
     auth1.authenticationMethod = authMethod;
     auth1.domain = domain;
     try
     {
         AuthenticateResponse resp = nn.Authenticate(auth1);
         return resp.securityToken;
     }
     catch (SoapException sExept)
     {
         db_Ref.InsertT_OE_SYS_LOG("ERROR", sExept.Message.SubStringPlus(0, 1999));   //logging an authentication failure
         return "";
     }
 }