Bruce Barnett-2 wrote:
> 
> Instead of 
> 
>  outProps.put(WSHandlerConstants.ACTION, "UsernameToken Signature");
> 
> wouldn't it be preferrable to use the following form?
>   outProps.put(WSHandlerConstants.ACTION,
> WSHandlerConstants.USERNAME_TOKEN + " " + 
>                                                                               
>   WSHandlerConstants.SIGNATURE);
> 
> I don't  know if ACTION  is case sensitive, but  the second avoids
> sily spelling errors discovered at runtime. :-)
> 

Yes and no, but mostly yes.  The problem is that when you do Spring
configuration, you need to use the string literals ("UsernameToken
Signature"), not those constants.  The constants are better when coding
because any errors are caught compile-time, whereas relying on strings in
risky as you say.  (Indeed, especially if you misspell "encrypt" and perhaps
your message ends up not getting encrypted.)  The string literals do help
though when you're quickly moving back and forth between Spring config and
API usage, as no conversion lookups would be needed.

Glen

-- 
View this message in context: 
http://www.nabble.com/Suggested-wiki-documentation-change-for-multiple-actions-tp18724649p18739549.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to