【发布时间】:2018-08-22 12:17:40
【问题描述】:
不幸的是,我对C#一无所知,我只是尝试翻译下面的一段代码。
var body = Document.SelectSingleNode("//soap:Body/*[1]", Manager);
这里选择了哪个元素? 是<ds:KeyInfo>?
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<xenc:EncryptedData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" Id="ED-1B758D26C51BFCD86614340101135852" Type="http://www.w3.org/2001/04/xmlenc#Content">
<xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"/>
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<wsse:SecurityTokenReference xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsse11="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd" wsse11:TokenType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#EncryptedKey">
<wsse:Reference URI="#EK-1B758D26C51BFCD86614340101135741"/>
</wsse:SecurityTokenReference>
</ds:KeyInfo>
<xenc:CipherData>
<xenc:CipherValue></xenc:CipherValue>
</xenc:CipherData>
</xenc:EncryptedData>
</soap:Body>
</soap:Envelope>
【问题讨论】:
-
你尝试的时候发生了什么?
-
如前所述.. 我不是 C# 开发人员.. 我不能
-
这与C#无关。它只是 XPath 并选择 的第一个子节点 (
-
@clarkk 试图在我的回答中向您解释。正如 Cetin Basoz 所说,这确实与 C# 无关。