All geeks will say that WSE is out of date .. This is normal for me right now .. Just trying to find a solution to my problem Trying to use the Java web service using WSE. In the outbound soap request, the protection has an additional node timestamp. My soap removal request is as follows
<soap:Header> <wsa:Action wsu:Id="Id-6209d12b-20bf-407e-ac72-533d0f671a2c"></wsa:Action> <wsa:MessageID wsu:Id="Id-280fe225-2f80-4f37-b5d4-120146fc7dec">urn:uuid:a427b687-6f52-4689-9df2-c2e3c6d9ea1a</wsa:MessageID>< wsa:ReplyTo wsu:Id="Id-bc623f16-761c-4e03-a23e-aa70bd9b8d34"><wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address></wsa:ReplyTo> <wsa:To wsu:Id="Id-b8607eed-cb9e-426b-a5dc-51d7855c32e1">https://service100.emedny.org:9047/MHService</wsa:To> <wsse:Security soap:mustUnderstand="1"> <wsu:Timestamp wsu:Id="Timestamp-cbeb0310-93bf-4f39-a44d-3516b32b40e6"><wsu:Created>2013-06-20T20:19:47Z</wsu:Created><wsu:Expires>2013-06-20T20:24:47Z</wsu:Expires></wsu:Timestamp><wsse:BinarySecurityToken ValueType></BinarySecurityToken>....</soap:Header>
.. I am trying to remove the elements action, messageid, replyto, timestamp
So, the outgoing should look like
<soap:Header> <wsse:Security soap:mustUnderstand="1" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <wsse:BinarySecurityToken........> </soap:header>
How to remove 4 elements + node timestamp from security.I use WSE3.0. Sorry, but not Wcf rt now. This is what I tried.
Step1 Create a custom policy assertion by deriving from Microsoft.Web.Services3.Design.PolicyAssertion. namespace UsernameAssertionLibrary { public class UsernameClientAssertion : SecurityPolicyAssertion, PolicyAssertion { private string username; private string password; public UsernameClientAssertion(string username, string password) { this.username = username; this.password = password; } public override SoapFilter CreateClientOutputFilter(FilterCreationContext context) { return new ClientOutputFilter(this, context); } public override SoapFilter CreateClientInputFilter(FilterCreationContext context) {
I do not get any errors. There is a warning in the policy file that the Element policy has an invalid child element usernameassertion.List of possible elements ....... Security timestamp element, ActionId, mesageId, replyTo, wsa elements are still displayed in the outgoing soap. What I miss here.
source share