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/27 10:21:02 UTC

[WSS4J 1.5] WSDoAllReceiver: Request does not contain required Security header

Hi all,

I've tried to send sign message to my server 
With your help I've resolved a lot of problem but now I don't understand why It doesn't work

My server deploy.wsdd of the server is this:
<!-- 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>

my cryptoReceiver.properties is:
org.apache.ws.security.crypto.merlin.file=cacerts.jks
org.apache.ws.security.crypto.merlin.keystore.type=JKS
org.apache.ws.security.crypto.merlin.keystore.password=1234567890

Now the client have tha class that invoke the method:
ritorno="Nel try "; 
			
			PerformWSSecServiceLocator l=new PerformWSSecServiceLocator(new MyEngineConfiguration());
			 ritorno=ritorno+"creato il locator ";
			 PerformWSSecuritySoapBindingStub stub =(PerformWSSecuritySoapBindingStub) l.getPerformWSSecurity();
			 ritorno=ritorno+"creato lo stub ";
			 ritorno=stub.outputStr(host,usr,pass,com);

MyEngineConfiguration is this:

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.ACTION, WSHandlerConstants.SIGNATURE);
       w.setOption(WSHandlerConstants.USER, "167deb1fb811921fce0fe7890db0b9da93225867");
       w.setOption(WSHandlerConstants.PW_CALLBACK_CLASS,"PWCallback");
       w.setOption(WSHandlerConstants.SIG_PROP_FILE, "cryptoSender.properties");
       w.setOption(WSHandlerConstants.SIG_KEY_ID, "DirectReference");
       w.setOption(WSHandlerConstants.MUST_UNDERSTAND, "false");
       
       
       this.setGlobalResponse(w);

    }

    @Override
    public void configureEngine(AxisEngine engine) throws
ConfigurationException {
        engine.refreshGlobalOptions();
    }
}

but when Run the main it return always this error:
WSDoAllReceiver: Request does not contain required Security header

I don't understan why!!!

Please help me

Thanks all
Hermann

R: [WSS4J 1.5] WSDoAllReceiver: Request does not contain required Security header

Posted by he...@alice.it.
Hi Martin,

if I move the class in another package for example and start the main it returns an error because it doesn't find the class

If I move the class PWcallback in a package ex. Clas that I created and modify
w.setOption(WSHandlerConstants.PW_CALLBACK_CLASS,"Clas,PWCallback");

It return always the same error,  that request does not contain security header.
How can I resolve this error??

Thanks 
Hermann


-----Messaggio originale-----
Da: Martin Kuba [mailto:makub@ics.muni.cz]
Inviato: mar 27/06/2006 10.45
A: hescot@alice.it
Cc: wss4j-dev@ws.apache.org
Oggetto: Re: [WSS4J 1.5] WSDoAllReceiver: Request does not contain required Security header
 
hescot@alice.it wrote:
>        w.setOption(WSHandlerConstants.PW_CALLBACK_CLASS,"PWCallback");

Just a small remark - Java does not allow a class in the
unnamed package (i.e. not in a specific package)
http://java.sun.com/docs/books/jls/third_edition/html/packages.html#103097
to be accessed from a class in a named package. So
your class PWCallback is not accesible.

Martin
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Supercomputing Center Brno             Martin Kuba
Institute of Computer Science    email: makub@ics.muni.cz
Masaryk University             http://www.ics.muni.cz/~makub/
Botanicka 68a, 60200 Brno, CZ     mobil: +420-603-533775
--------------------------------------------------------------


R: [WSS4J 1.5] WSDoAllReceiver: Request does not contain required Security header

Posted by he...@alice.it.
Hi Martin,

if I move the class in another package for example and start the main it returns an error because it doesn't find the class

If I move the class PWcallback in a package ex. Clas that I created and modify
w.setOption(WSHandlerConstants.PW_CALLBACK_CLASS,"Clas,PWCallback");

It return always the same error,  that request does not contain security header.
How can I resolve this error??

Thanks 
Hermann


-----Messaggio originale-----
Da: Martin Kuba [mailto:makub@ics.muni.cz]
Inviato: mar 27/06/2006 10.45
A: hescot@alice.it
Cc: wss4j-dev@ws.apache.org
Oggetto: Re: [WSS4J 1.5] WSDoAllReceiver: Request does not contain required Security header
 
hescot@alice.it wrote:
>        w.setOption(WSHandlerConstants.PW_CALLBACK_CLASS,"PWCallback");

Just a small remark - Java does not allow a class in the
unnamed package (i.e. not in a specific package)
http://java.sun.com/docs/books/jls/third_edition/html/packages.html#103097
to be accessed from a class in a named package. So
your class PWCallback is not accesible.

Martin
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Supercomputing Center Brno             Martin Kuba
Institute of Computer Science    email: makub@ics.muni.cz
Masaryk University             http://www.ics.muni.cz/~makub/
Botanicka 68a, 60200 Brno, CZ     mobil: +420-603-533775
--------------------------------------------------------------


Re: [WSS4J 1.5] WSDoAllReceiver: Request does not contain required Security header

Posted by Martin Kuba <ma...@ics.muni.cz>.
hescot@alice.it wrote:
>        w.setOption(WSHandlerConstants.PW_CALLBACK_CLASS,"PWCallback");

Just a small remark - Java does not allow a class in the
unnamed package (i.e. not in a specific package)
http://java.sun.com/docs/books/jls/third_edition/html/packages.html#103097
to be accessed from a class in a named package. So
your class PWCallback is not accesible.

Martin
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Supercomputing Center Brno             Martin Kuba
Institute of Computer Science    email: makub@ics.muni.cz
Masaryk University             http://www.ics.muni.cz/~makub/
Botanicka 68a, 60200 Brno, CZ     mobil: +420-603-533775
--------------------------------------------------------------

Re: [WSS4J 1.5] WSDoAllReceiver: Request does not contain required Security header

Posted by Martin Kuba <ma...@ics.muni.cz>.
hescot@alice.it wrote:
>        w.setOption(WSHandlerConstants.PW_CALLBACK_CLASS,"PWCallback");

Just a small remark - Java does not allow a class in the
unnamed package (i.e. not in a specific package)
http://java.sun.com/docs/books/jls/third_edition/html/packages.html#103097
to be accessed from a class in a named package. So
your class PWCallback is not accesible.

Martin
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Supercomputing Center Brno             Martin Kuba
Institute of Computer Science    email: makub@ics.muni.cz
Masaryk University             http://www.ics.muni.cz/~makub/
Botanicka 68a, 60200 Brno, CZ     mobil: +420-603-533775
--------------------------------------------------------------