You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wss4j-dev@ws.apache.org by he...@alice.it on 2006/06/23 15:19:26 UTC
[WSS4J 1.5] WsDoAllReceiver No action defined for signature
Hi all,
I've a problem with WsDoAllSender class
I defined a class that set option of the client because I can't use client.wsdd:
package PerformWSSecurity;
import java.util.Hashtable;
import org.apache.axis.AxisEngine;
import org.apache.axis.ConfigurationException;
import org.apache.axis.SimpleTargetedChain;
import org.apache.axis.configuration.SimpleProvider;
import org.apache.ws.axis.security.WSDoAllSender;
import org.apache.ws.security.handler.WSHandlerConstants;
public class MyEngineConfiguration extends SimpleProvider {
public MyEngineConfiguration() {
super();
this.deployTransport("http", new SimpleTargetedChain(new org.apache.axis.transport.http.HTTPSender()));
//parameters
Hashtable<String, Object> opts = new Hashtable<String, Object>();
opts.put(AxisEngine.PROP_DISABLE_PRETTY_XML, Boolean.TRUE);
this.setGlobalOptions(opts);
//requestFlow
org.apache.ws.axis.security.WSDoAllSender w = new WSDoAllSender();
w.setOption(WSHandlerConstants.SIG_PROP_FILE, "cryptoSender.properties");
w.setOption(WSHandlerConstants.SIG_KEY_ID, "DirectReference");
w.setOption(WSHandlerConstants.ACTION, WSHandlerConstants.SIGNATURE);
this.setGlobalResponse(w);
}
public void configureEngine(AxisEngine engine) throws
ConfigurationException {
engine.refreshGlobalOptions();
}
}
because the client have to crypt message with the cryptosender.properties and send the reference of certificate, the action that have to do is Signature but I don't find how do this action, if i use this
w.setOption(WSHandlerConstants.ACTION, WSHandlerConstants.SIGNATURE);
returns: WSDoAllSender: Empty username for specified action
If i don't use: WSDoAllSender: No action defined, of couse.
So I think that this action is specied for username token, but I'm not using username token
How can I specify that the action to do is Signature??
I put the deploy of my server side:
<!-- Use this file to deploy some handlers/chains and services -->
<!-- Two ways to do this: -->
<!-- java org.apache.axis.client.AdminClient deploy.wsdd -->
<!-- after the axis server is running -->
<!-- or -->
<!-- java org.apache.axis.utils.Admin client|server deploy.wsdd -->
<!-- from the same directory that the Axis engine runs -->
<deployment
xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<!-- Services from PerformWSService WSDL service -->
<service name="PerformWService" provider="java:RPC" style="rpc" use="encoded">
<requestFlow>
<handler type="java:org.apache.ws.axis.security.WSDoAllReceiver">
<parameter name="action" value="Signature"/>
<parameter name="signaturePropFile" value="cryptoReceiver.properties"/>
</handler>
</requestFlow>
<parameter name="wsdlTargetNamespace" value="urn:PerformWService"/>
<parameter name="wsdlServiceElement" value="PerformWSService"/>
<parameter name="wsdlServicePort" value="PerformWService"/>
<parameter name="className" value="PerformWS.PerformWServiceSoapBindingSkeleton"/>
<parameter name="wsdlPortType" value="PerformWS"/>
<parameter name="typeMappingVersion" value="1.2"/>
<parameter name="allowedMethods" value="*"/>
<parameter name="scope" value="Session"/>
</service>
</deployment>
Thanks all for help