C#将binarysecuritytoken和security标记添加到XML SOAP文档

时间:2018-04-05 19:45:26

标签: c# xml soap

我有一个XmlDocument个对象。如何向文档添加标记,以便输出包含以下XML?

我可以添加元素,其中包含从导出的证书生成的 base64 编码值,但这似乎不太理想。

<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
     <wsse:BinarySecurityToken EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509PKIPathv1" wsu:Id="X509-1AFD1B43221516987374001369">{encoded token}</wsse:BinarySecurityToken>
</wsse:Security>

0 个答案:

没有答案