I need to implement a jax-ws client.
Here is what the provider docs say about security
Currently, we use the SOAP Message Security version 1.0 specification at http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0.pdf
This standard uses two other from W3C norm:
XMLENC (http://www.w3.org/TR/2002/REC-xmlenc-core-20021210/)
and XMLDSIG (http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/)For the signature, a “SecurityTokenReference” using a direct “reference” specifying “URI” and “valueType” of X509 is mandatory. For the enciphering, we recommend it too, but also we support in order of preference a reference to a keyIdentifier, a X509IssuerSerial or a keyName.
The enciphered and signed block has to be the “body” tag.
We recommend to use: “rsa-sha1” for signature, “rsa-1_5” for encrypting key and “tripledes-cbc” for encrypting body.
So I came up with following policy (generated from netbeans). But... it doens't look right to me. The web service isn't reachable yet, but I'm not sure that the spec versions match. I read a lot on the subject, but I'm still somewhat confused. Does this policy look ok?
<wsp1:Policy wsu:Id="ListeOperationsPeriodeSoapBindingSoapPolicy">
<wsp1:ExactlyOne>
<wsp1:All>
<sp:TransportBinding>
<wsp1:Policy>
<sp:TransportToken>
<wsp1:Policy>
<sp:HttpsToken RequireClientCertificate="false"/>
</wsp1:Policy>
</sp:TransportToken>
<sp:Layout>
<wsp1:Policy>
<sp:Lax/>
</wsp1:Policy>
</sp:Layout>
<sp:AlgorithmSuite>
<wsp1:Policy>
<sp:TripleDesRsa15/>
</wsp1:Policy>
</sp:AlgorithmSuite>
</wsp1:Policy>
</sp:TransportBinding>
<sp:Wss10/>
<sp:EndorsingSupportingTokens>
<wsp1:Policy>
<sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
<wsp1:Policy>
<sp:WssX509V3Token10/>
</wsp1:Policy>
</sp:X509Token>
</wsp1:Policy>
</sp:EndorsingSupportingTokens>
</wsp1:All>
</wsp1:ExactlyOne>
</wsp1:Policy>
<wsp:Policy wsu:Id="ListeOperationsPeriodeSoapBindingSoap_perform_Input_Policy">
<wsp:ExactlyOne>
<wsp:All>
<sp1:SignedEncryptedSupportingTokens>
<wsp:Policy>
<sp1:X509Token sp1:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
<wsp:Policy>
<sp1:WssX509V3Token10/>
</wsp:Policy>
</sp1:X509Token>
</wsp:Policy>
</sp1:SignedEncryptedSupportingTokens>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
EDIT: I couldn't get it to send the expected message with wsit-yet. As an example, using Netbeans wizard, I couldn't get an encrypted header without using addressing. Is it supposed to be possible?
I hacked something with an old axis 1 class and wss4j, it works but it's ugly and I'd rather use something more future-proof.
Maybe you want to try with CXF instead of WSIT? http://cxf.apache.org/docs/ws-security.html