WS-security破坏了SOAP消息中的签名

时间:2012-08-31 10:28:01

标签: .net web-services soap digital-signature wse

我需要用一个特定的cryptoprovider签署肥皂信息。所以我编写了一个 SoapExtension 子类,它在阶段 SoapMessageStage.AfterSerialize 中添加数字签名,并在阶段 SoapMessageStage.BeforeDeserialize 中验证它。服务器端工作正常,但客户端存在问题:添加签名后,总会添加一些新的ws-security元素,签名变得不正确。改变优先级无效。有:

soap:Envelope

xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing" 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">

soap:Header

<wsa:Action>ServerTest/TestMultiply</wsa:Action><wsa:MessageID>uuid:6ea73f70-8164-4e5a-8f8c-17853eadfba2</wsa:MessageID><wsa:ReplyTo><wsa:Address>http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous</wsa:Address></wsa:ReplyTo><wsa:To>http://mylocalhost:31791/WebServiceEstate.asmx</wsa:To><wsse:Security><wsu:Timestamp wsu:Id="Timestamp-50be5708-32ab-4014-81d4-7b0b82ff6262"><wsu:Created>2012-08-31T09:49:51Z</wsu:Created><wsu:Expires>2012-08-31T09:54:51Z</wsu:Expires></wsu:Timestamp></wsse:Security>

如何在添加此ws-securiry数据后应用singnature?

1 个答案:

答案 0 :(得分:1)

从WSE 2.0迁移到WSE 3.0后问题已解决