利用WSE 加密SOAP报文(2)
一个加密后的SOAP 报文下面的SOAP报文示例有一个payment节点,含有一些敏感的客户信息.
OAP:Envelope SOAP:xmlsn="http://www.w3.org/2002/12/SOAP-envelope">
<SOAP:Header>
...
</SOAP:Header>
<SOAP:Body>
...
<x:Order Type="Purchase" x:xmlns="http://example.com/order">
<x:Payment Type="CreditCard">
<x:CreditCard Type="Visa">
<x:CardNumber>123456789123456</CardNumber>
<x:ExperationDate>1108</ExperationDate>
</x:CreditCard>
</x:Payment>
...
</x:Order>
...
</SOAP:Body>
</SOAP:Envelope>
因为payment节点含有敏感的数据,所以它应该被加密.下面的例子显示了相同的信息,但是payment节点被EncryptedData节点代替了.EncryptedData节点内含有对payment 节点内部内容加密后的密文. EncryptedData节点是参考自security头中的DataReference 节点的
<SOAP:Envelope SOAP:xmlsn="http://www.w3.org/2002/12/SOAP-envelope"
xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
xmlns:xsig="http://www.w3.org/2000/09/xmldsig#"
xmlns:WSse="http://schemas.xmlSOAP.org/WS/2002/04/secext">
<SOAP:Header>
<WSse:Security>
<xenc:ReferenceList>
<xenc:DataReference URI="#OrderID"/>
</xenc:ReferenceList>
</WSse:Security> ...
</SOAP:Header>
<SOAP:Body>
补充:asp.net教程,WebService