private string L7p_SetVariable(XmlNode xNode) { StringBuilder sB = new StringBuilder(450); string sVariableToSet = xNode.AA_AttributeValueXPAth("L7p:VariableToSet/@stringValue", _man); string sBase64Encoded = xNode.AA_AttributeValueDecodeBase64("L7p:Base64Expression/@stringValue", _man); string sDatatype = xNode.AA_AttributeValueXPAth("L7p:DataType/@stringValue", _man); string sContentType = xNode.AA_AttributeValueXPAth("L7p:ContentType/@stringValue", _man); string sEnabled = xNode.AA_AttributeValueXPAth("L7p:Enabled/@booleanValue", _man); sB.Append(sVariableToSet); sB.Append("="); sB.Append(sBase64Encoded); sB.Append("| "); if (sEnabled != string.Empty) { sB.Append("Enabledl"); sB.Append(":"); sB.Append(sEnabled); sB.Append("| "); } if (sDatatype != string.Empty) { sB.Append("DataType"); sB.Append(":"); sB.Append(sDatatype); sB.Append("| "); } if (sContentType != string.Empty) { sB.Append("ContentType"); sB.Append(":"); sB.Append(sContentType); sB.Append("| "); } sB.AppendLine(); return(sB.ToString()); //Console.WriteLine(n.InnerText); }
public void Process() { //get alll comments XmlNodeList xnList = _xNode.SelectNodes("L7p:ExtraHeaders/L7p:item", _man); foreach (XmlNode xn in xnList) { _hasKeys = true; string sKey = xn.AA_AttributeValueXPAth("L7p:Key/@stringValue", _man); string sValue = xn.AA_AttributeValueXPAth("L7p:Value/@stringValue", _man); sbX.Append(" #"); sbX.Append(sKey); sbX.Append(":"); sbX.Append(sValue); sbX.Append("; "); } _sContent = _xNode.AA_AttributeValueXPAth("L7p:Content/@stringValue", _man); _sContentType = _xNode.AA_AttributeValueXPAth("L7p:ContentType/@stringValue", _man); _sHttpStatus = _xNode.AA_AttributeValueXPAth("L7p:HttpStatus/@stringValue", _man); _includePolicyDownloadUrl = _xNode.AA_AttributeValueXPAth("L7p:IncludePolicyDownloadURL/@booleanValue", _man); _errorLevel = _xNode.AA_AttributeValueXPAth("L7p:ErrorLevel/@errorLevel", _man); }
public void Process() { //get alll comments XmlNodeList xnList = _xNode.SelectNodes("L7p:AssertionComment", _man); foreach (XmlNode xn in xnList) { L7PAssertionComment oC = new L7PAssertionComment(xn, _man); oC.Process(); sbX.AppendLine(oC.ToString()); } _sName = _xNode.AA_AttributeValueXPAth("L7p:EncapsulatedAssertionConfigName/@stringValue", _man); _sGuid = _xNode.AA_AttributeValueXPAth("L7p:EncapsulatedAssertionConfigGuid/@stringValue", _man); //get alll comments XmlNodeList xnItems = _xNode.SelectNodes("L7p:Parameters/L7p:entry", _man); foreach (XmlNode xi in xnItems) { _hasKeys = true; string sKey = xi.AA_AttributeValueXPAth("L7p:key/@stringValue", _man); string sValue = xi.AA_AttributeValueXPAth("L7p:value/@stringValue", _man); _sbTemp.Append(" #"); _sbTemp.Append(sKey); _sbTemp.Append(":"); _sbTemp.Append(sValue); _sbTemp.Append("; "); } }
/// <summary> /// analyse and format comparision assertion /// TODO: fix when multiple items are part of the predicates /// </summary> /// <param name="xNode"></param> /// <returns></returns> private string L7p_ComparisonAssertion(XmlNode xNode) { StringBuilder sB = new StringBuilder(450); StringBuilder sTemp = new StringBuilder(450); string sExpression1 = xNode.AA_AttributeValueXPAth("L7p:Expression1/@stringValue", _man); XmlNodeList xnList = xNode.SelectNodes("L7p:Predicates/L7p:item", _man); foreach (XmlNode xn in xnList) { for (int i = 0; i < xn.Attributes.Count; i++) { string sName = xn.Attributes[i].Name; string sVal = xn.Attributes[i].Value; switch (sName) { case "dataType": break; case "binary": string sCaseSen = "(case sensitive)"; string sRValue = string.Empty; string sNegated = string.Empty; string sEq = "is equal to"; for (int j = 0; j < xn.ChildNodes.Count; j++) { string sWname = xn.ChildNodes[j].Name; string sWval = xn.Attributes[i].Value; switch (sWname) { case "L7p:CaseSensitive": sCaseSen = xn.ChildNodes[j].AA_AttributeValue("booleanValue"); if (sCaseSen == "false") { sCaseSen = String.Empty; } break; case "L7p:RightValue": sRValue = xn.ChildNodes[j].AA_AttributeValue("stringValue"); break; case "L7p:Negated": sNegated = xn.ChildNodes[j].AA_AttributeValue("booleanValue"); if (sNegated == "true") { sEq = "is not equal to"; } break; } } sTemp.Append(sEq); sTemp.Append(" "); sTemp.Append(sRValue); sTemp.Append(" "); sTemp.Append(sCaseSen); sTemp.Append(" "); break; default: break; } } } sB.Append(sExpression1); sB.Append(" "); sB.Append(sTemp.ToString()); sB.Append(" ;If Multivalued all values must pass "); return(sB.ToString()); }