0 Replies Latest reply on Apr 10, 2014 2:19 AM by akashjohal

    Apache Rampart not working with JBoss 6

    akashjohal

      Hello,

       

      I am using Axis 2 1.5.4 to deploy webservices on JBoss 6.0.0 and using Apache Rampart 1.5.2 to implement UserName Token security for the webservices.

      My services gets deployed successfully and i can see the webservices policy in the wsdl.

       

      But when I launch the webservice through SOAP UI , it does not ask for any security information and directly calls my webservice method and does not even invoke the PasswordCallBackHandler class..

      The same service and security works with tomcat but not with JBoss.

       

      Sample from my wsdl:


      <?xml version="1.0" encoding="UTF-8" ?>  

      - <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://ws.apache.org/axis2" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://ws.apache.org/axis2"

      - <wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="UsernameToken"

      - <wsp:ExactlyOne> 

      - <wsp:All> 

      - <sp:SupportingTokens xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"

      - <wsp:Policy> 

        <sp:UsernameToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient" />  

        </wsp:Policy> 

        </sp:SupportingTokens> 

        </wsp:All> 

        </wsp:ExactlyOne> 

        </wsp:Policy>


      Below is my services.xml:


      <service> 

      <module ref="rampart" /> 

       

          <parameter name="ServiceClass" locked="false">SimpleService</parameter> 

          <operation name="echo"

              <messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/> 

          </operation>     

       

      <wsp:Policy wsu:Id="UsernameToken" xmlns:wsu= 

          "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" 

          xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"

        <wsp:ExactlyOne> 

          <wsp:All> 

            <sp:SupportingTokens 

                xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"

              <wsp:Policy> 

                <sp:UsernameToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient"/> 

              </wsp:Policy> 

            </sp:SupportingTokens> 

             

             <ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy"

                  <ramp:passwordCallbackClass>MyHandler</ramp:passwordCallbackClass> 

             </ramp:RampartConfig> 

          </wsp:All> 

      </wsp:ExactlyOne> 

      </wsp:Policy> 

      </service>


      Am i missing some configurations from jboss?

      Please help me in resolving the issue as i am totally stuck.