Hi to all
 
I desesperatly try to use the security module but I can't
 
i use the axis2 files from the svn repository
 
I use the samples\security example . I follow all the instructions in the readme file but it fails
 
the two problems are the following
 
1/ the axis2.conf in the client_repo is not used by the client (according to the docs a default axis2.xml should be used but
I don't know where it is)
the soap message is sent to the server but security headers are missing and the server rejects the message because of this
 
2/ if I modify the Client (the modifed file is joined to this mail) to force it to use the axis2 file I got another error :
 
ant securitySample give the following logs
 
Buildfile: build.xml
 
securitySample:
log4j:WARN No appenders could be found for logger (org.apache.axiom.om.impl.builder.StAXOMBuilder).
log4j:WARN Please initialize the log4j system properly.
  org.apache.axis2.phaseresolver.PhaseException: Invalid phases please recheck axis2.xml PreDispatch for the handler AddressingFinalInHandler
     at org.apache.axis2.phaseresolver.PhaseHolder.addHandler(PhaseHolder.java:66)
     at org.apache.axis2.description.AxisOperation.engageModule(AxisOperation.java:128)
     at org.apache.axis2.description.AxisService.engageModule(AxisService.java:361)
     at org.apache.axis2.description.AxisServiceGroup.engageModule(AxisServiceGroup.java:139)
     at org.apache.axis2.engine.AxisConfiguration.addServiceGroup(AxisConfiguration.java:188)
     at org.apache.axis2.engine.AxisConfiguration.addService(AxisConfiguration.java:159)
     at org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:90)
     at sample.security.Client.main(Client.java:49)
 
If somebody could help me it would be very nice
 
Thanks in advance
 
Bruno Ricci

Attachment: Client.java
Description: Binary data

<axisconfig name="AxisJava2.0">

    <!-- Engage the addressing module -->
    <module ref="addressing"/>
    
    <!-- Engage the security module -->
    <module ref="security"/>

    <!-- Test with addressing and MTOM: Client's Configuration:START-->

    <parameter name="OutflowSecurity">
      <action>
        <items>Timestamp Signature Encrypt</items>
        <user>alice</user>
        <passwordCallbackClass>sample.security.PWCallback</passwordCallbackClass>
        <signaturePropFile>sec.properties</signaturePropFile>
        <signatureKeyIdentifier>SKIKeyIdentifier</signatureKeyIdentifier>
        <encryptionKeyIdentifier>SKIKeyIdentifier</encryptionKeyIdentifier>
        <encryptionUser>bob</encryptionUser>
        <signatureParts>{Element}{http://www.w3.org/2005/08/addressing}To;{Element}{http://www.w3.org/2005/08/addressing}ReplyTo;{Element}{http://www.w3.org/2005/08/addressing}MessageID;
        {Element}{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp</signatureParts>

        <optimizeParts>//xenc:EncryptedData/xenc:CipherData/xenc:CipherValue</optimizeParts>
      </action>
    </parameter>

    <parameter name="InflowSecurity">
      <action>
        <items>Timestamp Signature Encrypt</items>
        <passwordCallbackClass>sample.security.PWCallback</passwordCallbackClass>
        <signaturePropFile>sec.properties</signaturePropFile>
      </action>
    </parameter>

    <!-- Test with addressing and MTOM: Client's Configuration:END-->

    <!-- ================================================= -->
    <!-- Parameters -->
    <!-- ================================================= -->
    <parameter name="hotdeployment" locked="false">true</parameter>
    <parameter name="hotupdate" locked="false">false</parameter>
    <parameter name="enableMTOM" locked="false">true</parameter>
    <!-- Uncomment this to enable REST support -->
    <!--    <parameter name="enableREST" locked="false">true</parameter>-->


    <parameter name="userName" locked="false">admin</parameter>
    <parameter name="password" locked="false">axis2</parameter>

    <!-- ================================================= -->
    <!-- Message Receivers -->
    <!-- ================================================= -->
    <!--This is the Deafult Message Receiver for the system , if you want to have MessageReceivers for -->
    <!--all the other MEP implement it and add the correct entry to here , so that you can refer from-->
    <!--any operation -->
    <!--Note : You can ovride this for particular service by adding the same element with your requirement-->
    <messageReceivers>
        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only";
                         class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out";
                         class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
    </messageReceivers>
    <!-- ================================================= -->
    <!-- Transport Ins -->
    <!-- ================================================= -->
    <transportReceiver name="http"
                       class="org.apache.axis2.transport.http.SimpleHTTPServer">
        <parameter name="port" locked="false">6060</parameter>
        <!--If you want to give your own host address for EPR generation-->
        <!--uncommet following paramter , and set as you required.-->
        <!--<parameter name="hostname" locked="false">http://myApp.com/ws</parameter>-->
    </transportReceiver>

    <transportReceiver name="tcp"
                       class="org.apache.axis2.transport.tcp.TCPServer">
        <parameter name="port" locked="false">6061</parameter>
        <!--If you want to give your own host address for EPR generation-->
        <!--uncommet following paramter , and set as you required.-->
        <!--<parameter name="hostname" locked="false">tcp://myApp.com/ws</parameter>-->
    </transportReceiver>

    <!-- ================================================= -->
    <!-- Transport Outs -->
    <!-- ================================================= -->

    <transportSender name="tcp"
                     class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
    <transportSender name="local"
                     class="org.apache.axis2.transport.local.LocalTransportSender"/>
    <transportSender name="jms"
                     class="org.apache.axis2.transport.jms.JMSSender"/>
    <transportSender name="http"
                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
        <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
        <parameter name="Transfer-Encoding" locked="false">chunked</parameter>
    </transportSender>
    <transportSender name="https"
                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
        <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
        <parameter name="Transfer-Encoding" locked="false">chunked</parameter>
    </transportSender>

    <!-- ================================================= -->
    <!-- Phases  -->
    <!-- ================================================= -->
    <phaseOrder type="inflow">
        <!--  System pre defined phases       -->
        <phase name="TransportIn"/>
        <phase name="PreDispatch"/>
        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
            <handler name="RequestURIBasedDispatcher"
                     class="org.apache.axis2.engine.RequestURIBasedDispatcher">
                <order phase="Dispatch"/>
            </handler>

            <handler name="SOAPActionBasedDispatcher"
                     class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
                <order phase="Dispatch"/>
            </handler>

            <handler name="AddressingBasedDispatcher"
                     class="org.apache.axis2.engine.AddressingBasedDispatcher">
                <order phase="Dispatch"/>
            </handler>

            <handler name="SOAPMessageBodyBasedDispatcher"
                     class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
                <order phase="Dispatch"/>
            </handler>
            <handler name="InstanceDispatcher"
                     class="org.apache.axis2.engine.InstanceDispatcher">
                <order phase="PostDispatch"/>
            </handler>
        </phase>
        <!--  System pre defined phases       -->
        <!--   After Postdispatch phase module author or or service author can add any phase he want      -->
        <phase name="OperationInPhase"/>
    </phaseOrder>
    <phaseOrder type="outflow">
        <!--      user can add his own phases to this area  -->
        <phase name="OperationOutPhase"/>
        <!--system predefined phase-->
        <!--these phase will run irrespective of the service-->
        <phase name="PolicyDetermination"/>
        <phase name="MessageOut"/>
    </phaseOrder>
    <phaseOrder type="INfaultflow">
        <!--      user can add his own phases to this area  -->
        <phase name="OperationInFaultPhase"/>
    </phaseOrder>
    <phaseOrder type="Outfaultflow">
        <!--      user can add his own phases to this area  -->
        <phase name="OperationOutFaultPhase"/>
        <phase name="PolicyDetermination"/>
        <phase name="MessageOut"/>
    </phaseOrder></axisconfig>

Reply via email to