init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
36
Kreta.EESZTInterface/XmlHelper.cs
Normal file
36
Kreta.EESZTInterface/XmlHelper.cs
Normal file
|
@ -0,0 +1,36 @@
|
|||
using System.Xml;
|
||||
|
||||
namespace Kreta.EESZTInterface
|
||||
{
|
||||
public class XmlHelper
|
||||
{
|
||||
public const string EncryptedDataElementName = "EncryptedData";
|
||||
public const string EncryptedKeyElementName = "EncryptedKey";
|
||||
public const string SecurityElementName = "Security";
|
||||
public const string RequestSecurityTokenElementName = "RequestSecurityToken";
|
||||
public const string HeaderElementName = "Header";
|
||||
public const string BodyElementName = "Body";
|
||||
public const string SignatureElementName = "Signature";
|
||||
|
||||
public static XmlElement GetElement(string element, string elementNS, XmlElement doc)
|
||||
{
|
||||
var list = doc.GetElementsByTagName(element, elementNS);
|
||||
return list.Count == 0 ? null : (XmlElement)list[0];
|
||||
}
|
||||
|
||||
public static XmlElement GetElementId(XmlDocument doc, string id)
|
||||
{
|
||||
XmlElement idElem = null;
|
||||
|
||||
if (idElem == null)
|
||||
{
|
||||
XmlNamespaceManager nsManager = new XmlNamespaceManager(doc.NameTable);
|
||||
nsManager.AddNamespace("wsu", Namespaces.wsuNs);
|
||||
|
||||
idElem = doc.SelectSingleNode("//*[@wsu:Id=\"" + id + "\"]", nsManager) as XmlElement;
|
||||
}
|
||||
|
||||
return idElem;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue