Beispiel #1
0
        private static string createEventXMLForWPCDataFetch(
            string dateTime,
            string ipAddress,
            string username
            )
        {
            WBXXml xmlResult = new WBXXml();

            // Add Policy Data Element
            xmlResult.addElement(
                null,
                Constants.WBX_XML.XML_POLICY_DATA_ELEMENT_NAME
                );

            // Add the timestamp property
            xmlResult.addPair(
                Constants.BASE_EVENT_XML_FIELDS.TIME_STAMP.FATHER_ELEMENT,
                Constants.BASE_EVENT_XML_FIELDS.TIME_STAMP.NAME,
                dateTime
                );

            // Add the IP Address property
            xmlResult.addPair(
                Constants.BASE_EVENT_XML_FIELDS.IP_ADDRESS.FATHER_ELEMENT,
                Constants.BASE_EVENT_XML_FIELDS.IP_ADDRESS.NAME,
                ipAddress
                );

            // Add the username property
            xmlResult.addPair(
                Constants.BASE_EVENT_XML_FIELDS.USER_NAME.FATHER_ELEMENT,
                Constants.BASE_EVENT_XML_FIELDS.USER_NAME.NAME,
                username
                );

            return(xmlResult.ToString());
        }
Beispiel #2
0
        private static void addWSSEvent(
            WBXXml eventsXMLToSend,
            string eventXPath,
            Hashtable pairNameHsh,
            string[] eventDetails
            )
        {
            string tempStr = null;

            #region Add business data

            string businessDataXPath = eventXPath + "/businessdata";

            #region Business Service Origin
            tempStr =
                eventDetails[(int)pairNameHsh["businessServiceOrigin"]];

            if (!string.IsNullOrEmpty(tempStr))
            {
                eventsXMLToSend.addPair(
                    businessDataXPath,
                    "businessServiceOrigin",
                    tempStr
                    );
            }
            #endregion

            #region Item Location
            tempStr =
                eventDetails[(int)pairNameHsh["itemLocation"]];

            if (!string.IsNullOrEmpty(tempStr))
            {
                eventsXMLToSend.addPair(
                    businessDataXPath,
                    "itemLocation",
                    tempStr
                    );
            }
            #endregion

            #endregion

            #region Add policy data

            string policyDataXPath = eventXPath + "/policydata";

            #region User Action
            tempStr =
                eventDetails[(int)pairNameHsh["userAction"]];

            if (!string.IsNullOrEmpty(tempStr))
            {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "userAction",
                    tempStr
                    );
            }
            #endregion

            #region User Agent
            tempStr =
                eventDetails[(int)pairNameHsh["userAgent"]];

            if (!string.IsNullOrEmpty(tempStr))
            {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "userAgent",
                    tempStr
                    );
            }
            #endregion

            #region Authentication
            tempStr =
                eventDetails[(int)pairNameHsh["authentication"]];

            if (!string.IsNullOrEmpty(tempStr))
            {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "authentication",
                    tempStr
                    );
            }
            #endregion

            #region Custom Action
            tempStr =
                eventDetails[(int)pairNameHsh["customAction"]];

            if (!string.IsNullOrEmpty(tempStr))
            {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "customAction",
                    tempStr
                    );
            }
            #endregion

            #region Item Id
            tempStr =
                eventDetails[(int)pairNameHsh["itemId"]];

            if (!string.IsNullOrEmpty(tempStr))
            {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "itemId",
                    tempStr
                    );
            }
            #endregion

            #region Item Type
            tempStr =
                eventDetails[(int)pairNameHsh["itemType"]];

            if (!string.IsNullOrEmpty(tempStr))
            {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "itemType",
                    tempStr
                    );
            }
            #endregion

            #region Event Data
            tempStr =
                eventDetails[(int)pairNameHsh["eventData"]];

            if (!string.IsNullOrEmpty(tempStr))
            {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "eventData",
                    tempStr
                    );
            }
            #endregion

            #region Event Source
            tempStr =
                eventDetails[(int)pairNameHsh["eventSource"]];

            if (!string.IsNullOrEmpty(tempStr))
            {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "eventSource",
                    tempStr
                    );
            }
            #endregion

            #region Location Type
            tempStr =
                eventDetails[(int)pairNameHsh["locationType"]];

            if (tempStr != null)
            {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "locationType",
                    tempStr
                    );
            }
            #endregion

            #region Ip Address
            tempStr =
                eventDetails[(int)pairNameHsh["IpAddress"]];

            if (!string.IsNullOrEmpty(tempStr))
            {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "IpAddress",
                    tempStr
                    );
            }
            #endregion

            #region Machine Name
            tempStr =
                eventDetails[(int)pairNameHsh["machineName"]];

            if (tempStr != null)
            {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "machineName",
                    tempStr
                    );
            }
            #endregion

            #region TimeStamp
            tempStr =
                eventDetails[(int)pairNameHsh["TimeStamp"]];

            if (tempStr != null)
            {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "TimeStamp",
                    tempStr
                    );
            }
            #endregion

            #region Site Id
            tempStr =
                eventDetails[(int)pairNameHsh["siteId"]];

            if (!string.IsNullOrEmpty(tempStr))
            {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "siteId",
                    tempStr
                    );
            }
            #endregion

            #region Source Name
            tempStr =
                eventDetails[(int)pairNameHsh["sourceName"]];

            if (tempStr != null)
            {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "sourceName",
                    tempStr
                    );
            }
            #endregion

            #region User Name
            tempStr =
                eventDetails[(int)pairNameHsh["UserName"]];

            if (!string.IsNullOrEmpty(tempStr))
            {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "UserName",
                    tempStr
                    );
            }
            #endregion

            #region User Domain
            tempStr =
                eventDetails[(int)pairNameHsh["userDomain"]];

            if (tempStr != null)
            {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "userDomain",
                    tempStr
                    );
            }
            #endregion

            #region WSS UserId
            tempStr =
                eventDetails[(int)pairNameHsh["wssUserId"]];

            if (!string.IsNullOrEmpty(tempStr))
            {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "wssUserId",
                    tempStr
                    );
            }
            #endregion

            #region User Domain
            tempStr =
                eventDetails[(int)pairNameHsh["wssGroups"]];

            if (tempStr != null)
            {
                eventsXMLToSend.addMultiattribute(
                    policyDataXPath,
                    "wssGroups",
                    tempStr.Split(Constants.MULTIATTRIBUTE_DELIMITER)
                    );
            }
            #endregion

            #endregion
        }
Beispiel #3
0
        private static void addSAPR3Event(
            WBXXml eventsXMLToSend,
            string eventXPath,
            Hashtable pairNameHsh,
            string[] eventDetails
            )
        {
            string tempStr = null;

            #region Add business data

            string businessDataXPath = eventXPath + "/businessdata";

            #region Transaction ID
            tempStr =
                eventDetails[(int)pairNameHsh["TransactionId"]];

            if (!string.IsNullOrEmpty(tempStr))
            {
                eventsXMLToSend.addPair(
                    businessDataXPath,
                    "TransactionId",
                    tempStr
                    );
            }
            #endregion

            #region Report Name
            tempStr =
                eventDetails[(int)pairNameHsh["ReportName"]];

            if (!string.IsNullOrEmpty(tempStr))
            {
                eventsXMLToSend.addPair(
                    businessDataXPath,
                    "ReportName",
                    tempStr
                    );
            }
            #endregion

            #region Dynpro Number
            tempStr =
                eventDetails[(int)pairNameHsh["DynproNumber"]];

            if (!string.IsNullOrEmpty(tempStr))
            {
                eventsXMLToSend.addPair(
                    businessDataXPath,
                    "DynproNumber",
                    tempStr
                    );
            }
            #endregion

            #endregion

            #region Add policy data

            string policyDataXPath = eventXPath + "/policydata";

            #region Server Name
            tempStr =
                eventDetails[(int)pairNameHsh["ServerName"]];

            if (!string.IsNullOrEmpty(tempStr))
            {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "ServerName",
                    tempStr
                    );
            }
            #endregion

            #region Timestamp
            tempStr =
                eventDetails[(int)pairNameHsh["TimeStamp"]];

            if (!string.IsNullOrEmpty(tempStr))
            {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "TimeStamp",
                    tempStr
                    );
            }
            #endregion

            #region Ip Address
            tempStr =
                eventDetails[(int)pairNameHsh["IpAddress"]];

            if (!string.IsNullOrEmpty(tempStr))
            {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "IpAddress",
                    tempStr
                    );
            }
            #endregion

            #region Sap User
            tempStr =
                eventDetails[(int)pairNameHsh["SapUser"]];

            if (!string.IsNullOrEmpty(tempStr))
            {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "SapUser",
                    tempStr
                    );
            }
            #endregion

            #region Terminal Id
            tempStr =
                eventDetails[(int)pairNameHsh["TerminalId"]];

            if (!string.IsNullOrEmpty(tempStr))
            {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "TerminalId",
                    tempStr
                    );
            }
            #endregion

            #region Connection Type
            tempStr =
                eventDetails[(int)pairNameHsh["ConnectionType"]];

            if (!string.IsNullOrEmpty(tempStr))
            {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "ConnectionType",
                    tempStr
                    );
            }
            #endregion

            #region User Name
            tempStr =
                eventDetails[(int)pairNameHsh["UserName"]];

            if (tempStr != null)
            {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "UserName",
                    tempStr
                    );
            }
            #endregion

            #endregion
        }
Beispiel #4
0
        private static void addSAPR3Event(
            WBXXml eventsXMLToSend,
            string eventXPath,
            Hashtable pairNameHsh,
            string[] eventDetails
            )
        {
            string tempStr = null;

            #region Add business data

            string businessDataXPath = eventXPath + "/businessdata";

            #region Transaction ID
            tempStr =
                eventDetails[(int)pairNameHsh["TransactionId"]];

            if (!string.IsNullOrEmpty(tempStr)) {
                eventsXMLToSend.addPair(
                    businessDataXPath,
                    "TransactionId",
                    tempStr
                );
            }
            #endregion

            #region Report Name
            tempStr =
                eventDetails[(int)pairNameHsh["ReportName"]];

            if (!string.IsNullOrEmpty(tempStr)) {
                eventsXMLToSend.addPair(
                    businessDataXPath,
                    "ReportName",
                    tempStr
                );
            }
            #endregion

            #region Dynpro Number
            tempStr =
                eventDetails[(int)pairNameHsh["DynproNumber"]];

            if (!string.IsNullOrEmpty(tempStr)) {
                eventsXMLToSend.addPair(
                    businessDataXPath,
                    "DynproNumber",
                    tempStr
                );
            }
            #endregion

            #endregion

            #region Add policy data

            string policyDataXPath = eventXPath + "/policydata";

            #region Server Name
            tempStr =
                eventDetails[(int)pairNameHsh["ServerName"]];

            if (!string.IsNullOrEmpty(tempStr)) {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "ServerName",
                    tempStr
                );
            }
            #endregion

            #region Timestamp
            tempStr =
                eventDetails[(int)pairNameHsh["TimeStamp"]];

            if (!string.IsNullOrEmpty(tempStr)) {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "TimeStamp",
                    tempStr
                );
            }
            #endregion

            #region Ip Address
            tempStr =
                eventDetails[(int)pairNameHsh["IpAddress"]];

            if (!string.IsNullOrEmpty(tempStr)) {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "IpAddress",
                    tempStr
                );
            }
            #endregion

            #region Sap User
            tempStr =
                eventDetails[(int)pairNameHsh["SapUser"]];

            if (!string.IsNullOrEmpty(tempStr)) {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "SapUser",
                    tempStr
                );
            }
            #endregion

            #region Terminal Id
            tempStr =
                eventDetails[(int)pairNameHsh["TerminalId"]];

            if (!string.IsNullOrEmpty(tempStr)) {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "TerminalId",
                    tempStr
                );
            }
            #endregion

            #region Connection Type
            tempStr =
                eventDetails[(int)pairNameHsh["ConnectionType"]];

            if (!string.IsNullOrEmpty(tempStr)) {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "ConnectionType",
                    tempStr
                );
            }
            #endregion

            #region User Name
            tempStr =
                eventDetails[(int)pairNameHsh["UserName"]];

            if (tempStr != null) {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "UserName",
                    tempStr
                );
            }
            #endregion

            #endregion
        }
Beispiel #5
0
        private static void addWSSEvent(
            WBXXml eventsXMLToSend,
            string eventXPath,
            Hashtable pairNameHsh,
            string[] eventDetails
            )
        {
            string tempStr = null;

            #region Add business data

            string businessDataXPath = eventXPath + "/businessdata";

            #region Business Service Origin
            tempStr =
                eventDetails[(int)pairNameHsh["businessServiceOrigin"]];

            if (!string.IsNullOrEmpty(tempStr)) {
                eventsXMLToSend.addPair(
                    businessDataXPath,
                    "businessServiceOrigin",
                    tempStr
                );
            }
            #endregion

            #region Item Location
            tempStr =
                eventDetails[(int)pairNameHsh["itemLocation"]];

            if (!string.IsNullOrEmpty(tempStr)) {
                eventsXMLToSend.addPair(
                    businessDataXPath,
                    "itemLocation",
                    tempStr
                );
            }
            #endregion

            #endregion

            #region Add policy data

            string policyDataXPath = eventXPath + "/policydata";

            #region User Action
            tempStr =
                eventDetails[(int)pairNameHsh["userAction"]];

            if (!string.IsNullOrEmpty(tempStr)) {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "userAction",
                    tempStr
                );
            }
            #endregion

            #region User Agent
            tempStr =
                eventDetails[(int)pairNameHsh["userAgent"]];

            if (!string.IsNullOrEmpty(tempStr)) {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "userAgent",
                    tempStr
                );
            }
            #endregion

            #region Authentication
            tempStr =
                eventDetails[(int)pairNameHsh["authentication"]];

            if (!string.IsNullOrEmpty(tempStr)) {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "authentication",
                    tempStr
                );
            }
            #endregion

            #region Custom Action
            tempStr =
                eventDetails[(int)pairNameHsh["customAction"]];

            if (!string.IsNullOrEmpty(tempStr)) {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "customAction",
                    tempStr
                );
            }
            #endregion

            #region Item Id
            tempStr =
                eventDetails[(int)pairNameHsh["itemId"]];

            if (!string.IsNullOrEmpty(tempStr)) {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "itemId",
                    tempStr
                );
            }
            #endregion

            #region Item Type
            tempStr =
                eventDetails[(int)pairNameHsh["itemType"]];

            if (!string.IsNullOrEmpty(tempStr)) {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "itemType",
                    tempStr
                );
            }
            #endregion

            #region Event Data
            tempStr =
                eventDetails[(int)pairNameHsh["eventData"]];

            if (!string.IsNullOrEmpty(tempStr)) {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "eventData",
                    tempStr
                );
            }
            #endregion

            #region Event Source
            tempStr =
                eventDetails[(int)pairNameHsh["eventSource"]];

            if (!string.IsNullOrEmpty(tempStr)) {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "eventSource",
                    tempStr
                );
            }
            #endregion

            #region Location Type
            tempStr =
                eventDetails[(int)pairNameHsh["locationType"]];

            if (tempStr != null) {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "locationType",
                    tempStr
                );
            }
            #endregion

            #region Ip Address
            tempStr =
                eventDetails[(int)pairNameHsh["IpAddress"]];

            if (!string.IsNullOrEmpty(tempStr)) {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "IpAddress",
                    tempStr
                );
            }
            #endregion

            #region Machine Name
            tempStr =
                eventDetails[(int)pairNameHsh["machineName"]];

            if (tempStr != null) {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "machineName",
                    tempStr
                );
            }
            #endregion

            #region TimeStamp
            tempStr =
                eventDetails[(int)pairNameHsh["TimeStamp"]];

            if (tempStr != null) {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "TimeStamp",
                    tempStr
                );
            }
            #endregion

            #region Site Id
            tempStr =
                eventDetails[(int)pairNameHsh["siteId"]];

            if (!string.IsNullOrEmpty(tempStr)) {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "siteId",
                    tempStr
                );
            }
            #endregion

            #region Source Name
            tempStr =
                eventDetails[(int)pairNameHsh["sourceName"]];

            if (tempStr != null) {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "sourceName",
                    tempStr
                );
            }
            #endregion

            #region User Name
            tempStr =
                eventDetails[(int)pairNameHsh["UserName"]];

            if (!string.IsNullOrEmpty(tempStr)) {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "UserName",
                    tempStr
                );
            }
            #endregion

            #region User Domain
            tempStr =
                eventDetails[(int)pairNameHsh["userDomain"]];

            if (tempStr != null) {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "userDomain",
                    tempStr
                );
            }
            #endregion

            #region WSS UserId
            tempStr =
                eventDetails[(int)pairNameHsh["wssUserId"]];

            if (!string.IsNullOrEmpty(tempStr)) {
                eventsXMLToSend.addPair(
                    policyDataXPath,
                    "wssUserId",
                    tempStr
                );
            }
            #endregion

            #region User Domain
            tempStr =
                eventDetails[(int)pairNameHsh["wssGroups"]];

            if (tempStr != null) {
                eventsXMLToSend.addMultiattribute(
                    policyDataXPath,
                    "wssGroups",
                    tempStr.Split(Constants.MULTIATTRIBUTE_DELIMITER)
                );
            }
            #endregion

            #endregion
        }
Beispiel #6
0
        private static string createEventXMLForWPCDataFetch(            
            string dateTime,
            string ipAddress,
            string username
            )
        {
            WBXXml xmlResult = new WBXXml();

            // Add Policy Data Element
            xmlResult.addElement(
                null,
                Constants.WBX_XML.XML_POLICY_DATA_ELEMENT_NAME
            );

            // Add the timestamp property
            xmlResult.addPair(
                Constants.BASE_EVENT_XML_FIELDS.TIME_STAMP.FATHER_ELEMENT,
                Constants.BASE_EVENT_XML_FIELDS.TIME_STAMP.NAME,
                dateTime
            );

            // Add the IP Address property
            xmlResult.addPair(
                Constants.BASE_EVENT_XML_FIELDS.IP_ADDRESS.FATHER_ELEMENT,
                Constants.BASE_EVENT_XML_FIELDS.IP_ADDRESS.NAME,
                ipAddress
            );

            // Add the username property
            xmlResult.addPair(
                Constants.BASE_EVENT_XML_FIELDS.USER_NAME.FATHER_ELEMENT,
                Constants.BASE_EVENT_XML_FIELDS.USER_NAME.NAME,
                username
            );

            return xmlResult.ToString();
        }