Hi
all,
I have this
code:
System.setProperty("axis.ClientConfigFile",
"conf/client_deploy.wsdd");
call = (Call)
service.createCall();
//set the end point URL of the service
call.setTargetEndpointAddress(webServiceURL);
call.setProperty(WSHandlerConstants.USER,"16c73ab6-b892-458f-abf5-2f875f74882e");
call.setProperty(WSHandlerConstants.ACTION,"Signature Encrypt");
call.setProperty(WSHandlerConstants.SIG_PROP_FILE,"crypto.properties");
PWCallback pcb = new PWCallback();
call.setProperty(WSHandlerConstants.PW_CALLBACK_REF,pcb);
//send SOAPMessage to the destination
log.info("Invoking Axis with message...");
log.info("\n\nSENT MESSAGE\n====================\n" + XMLUtilities.formatXMLString(messageToSend.getAsString()) + "\n====================\n\n");
call.invoke(messageToSend);
//set the end point URL of the service
call.setTargetEndpointAddress(webServiceURL);
call.setProperty(WSHandlerConstants.USER,"16c73ab6-b892-458f-abf5-2f875f74882e");
call.setProperty(WSHandlerConstants.ACTION,"Signature Encrypt");
call.setProperty(WSHandlerConstants.SIG_PROP_FILE,"crypto.properties");
PWCallback pcb = new PWCallback();
call.setProperty(WSHandlerConstants.PW_CALLBACK_REF,pcb);
//send SOAPMessage to the destination
log.info("Invoking Axis with message...");
log.info("\n\nSENT MESSAGE\n====================\n" + XMLUtilities.formatXMLString(messageToSend.getAsString()) + "\n====================\n\n");
call.invoke(messageToSend);
Where call is an
axis call. Both my client and server use the same class to send SOAP Messages to
a url.
The problem I
have found is that if i load tomcat (which holds my "destination") and when a
client uses this method to send a message to the "destination" (which is a web
service in tomcat), on the very first attempt (when i have just loaded up the
tomcat server), it fails to encrpyt the outgoing message and so my destination
throws a fault saying "security header not found". However, when i retry
and send the message (ie I re-run the client but i DONT restart tomcat), it
encrypts it.
This doesnt make any
sense to me. Is this a bug in wss4j in that axis can sometimes fail to load the
handler?
If you need any more
info, please let me know. I am no expert tho!
Thanks
Shahzad
