從下面的代碼片段中,我該如何擺脫(xml節點)< wsu:Expires >標記?我想擺脫它,或者把它作爲一個空的元素傳遞出去。它是objClient.RequestSoapContext.Security.Timestamp.Expires中的只讀屬性。任何幫助表示讚賞。擺脫WS安全標頭中的Expires節點(xml)
<wsse:Security soap:mustUnderstand="1">
<wsu:Timestamp wsu:Id="Timestamp-26d09d54-10ef-4141-aa2c-11c75ed8172b">
<wsu:Created>2010-03-08T15:32:16Z</wsu:Created>
<wsu:Expires>2010-03-08T15:37:16Z</wsu:Expires>
</wsu:Timestamp>
<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="SecurityToken-7c9b80ec-98e9-4e41-af2e-ad37070cbdd3">
<wsse:Username>bubba</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">dsfdfsdfsfs+-dasdf=</wsse:Password>
<wsse:Nonce>QQ3C4HUfO2CyGx7HrjzMzg==</wsse:Nonce>
<wsu:Created>2010-03-08T15:32:16Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
我發現和落實工作:http://blogs.msdn.com/dhrubach/archive/2008/06/16/modifying-the-security-header-generated-by-wse-runtime.aspx - 它不適合我
注意工作:使用在我上面貼的鏈接描述的方法仍在工作。
編輯2:我現在可以使用聲明手動生成大部分頭文件。如何將其插入到安全頭部XML
您的程序是否希望擺脫客戶端到期的Web服務,還是Web服務客戶端想要忽略服務器到期? – 2010-03-10 19:56:32
我的服務是通過此請求的客戶端。 – Developer 2010-03-10 20:07:59
請問爲什麼要這樣做?如果沒有其他的話,到期是防禦重放攻擊的防禦。 – quillbreaker 2010-03-15 22:30:25