After an hour more of debugging I released this was my fault. I need
to add the Timestamp action:
WSS4JInHandler wss4jHandler = new WSS4JInHandler();
wss4jHandler.setProperty("action", "UsernameToken Timestamp");
wss4jHandler.setProperty("passwordCallbackClass",
PasswordHandler.class.getName());
xfire.addInHandler(wss4jHandler);
Sorry for the post.
cheers,
Andrew
On May 1, 2006, at 6:32 PM, Andrew Wright wrote:
hey,
When connecting to a .NET client I am receive this fault:
System.Web.Services.Protocols.SoapHeaderException : WSS4JInHandler:
security processing failed (actions mismatch)
at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse
(SoapClientMessage message, WebResponse response, Stream
responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke
(String methodName, Object[] parameters)
What appears to be the issue is that XFire is expecting the
elements in the <wsse:Security> section to be in a specific order,
and does not expect to receive the Timestamp element first.
Here is a sample xml message generated from .NET
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
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/>
<wsa:MessageID>uuid:d07db572-86cf-4c7b-85ba-cfa1917999e7</
wsa:MessageID>
<wsa:ReplyTo>
<wsa:Address>http://schemas.xmlsoap.org/ws/2004/03/
addressing/role/anonymous</wsa:Address>
</wsa:ReplyTo>
<wsa:To>http://localhost:8080/services/ContentService</wsa:To>
<wsse:Security soap:mustUnderstand="1">
<wsu:Timestamp wsu:Id="Timestamp-37fa69f6-b4b9-4f6a-
ae67-bd77199b67b3">
<wsu:Created>2006-04-24T20:52:19Z</wsu:Created>
<wsu:Expires>2006-04-24T20:57:19Z</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-70819b8b-cd06-4604-
b3df-846c5187e845">
<wsse:Username>admin</wsse:Username>
<wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/
oasis-200401-wss-username-token-profile-1.0#PasswordText"
>admin</wsse:Password>
<wsse:Nonce>T2dHOiPDW ec0X13g3pPsmA==</wsse:Nonce>
<wsu:Created>2006-04-24T20:52:19Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soap:Header>
<soap:Body>
<getForumCategory xmlns="http://jivesoftware.com/
webservices/">
<in0>1</in0>
</getForumCategory>
</soap:Body>
</soap:Envelope>
It appears axis had similar problem at one point in time:
http://mail-archives.apache.org/mod_mbox/ws-wss4j-dev/200602.mbox/%
[EMAIL PROTECTED]
cheers,
Andrew