cancel
Showing results for 
Search instead for 
Did you mean: 

Axis2 C Rampart WS security policy

samuelzero
Champ in-the-making
Champ in-the-making
Hi,
I automatically created the stub with the Axis2/c WSDL2C tool . Of course, whit the authentication service I retrive the ticket. Now I've to attach the ws headers:


  <deployment xmlns='http://xml.apache.org/axis/wsdd/'
               xmlns:java='http://xml.apache.org/axis/wsdd/providers/java'>
      <transport name='http'
                 pivot='java:org.apache.axis.transport.http.HTTPSender'/>
      <globalConfiguration >
         <requestFlow >
            <handler type='java:org.apache.ws.axis.security.WSDoAllSender' >
               <parameter name='action' value='UsernameToken'/>
               <parameter name='user' value='ticket'/>
               <parameter name='passwordCallbackClass'
                value='org.alfresco.example.webservice.sample.WebServiceSample1'/>
               <parameter name='passwordType' value='PasswordText'/>
            </handler>
         </requestFlow >
      </globalConfiguration>
    </deployment>

How can I translate this policy into axis2.xml style policy?
1 REPLY 1

samuelzero
Champ in-the-making
Champ in-the-making
Well,Here is the file "policy.xml" in oasis ws-soap-message-security thath operate for a client written using Axis2/C libraries:


<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
    <wsp:ExactlyOne>
        <wsp:All>
            <sp:AsymmetricBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
                <wsp:Policy>
                    <sp:InitiatorToken>
                        <wsp:Policy>
                            <sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
                                <wsp:Policy>
                                    <sp:WssX509V3Token10/>
                                </wsp:Policy>
                            </sp:X509Token>
                        </wsp:Policy>
                    </sp:InitiatorToken>
                    <sp:RecipientToken>
                        <wsp:Policy>
                            <sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
                                <wsp:Policy>
                                    <sp:WssX509V3Token10/>
                                </wsp:Policy>
                            </sp:X509Token>
                        </wsp:Policy>
                    </sp:RecipientToken>
                    <sp:Layout>
                        <wsp:Policy>
                            <sp:Strict/>
                        </wsp:Policy>
                    </sp:Layout>
                    <sp:IncludeTimestamp/>
                </wsp:Policy>
            </sp:AsymmetricBinding>
            <sp:SignedSupportingTokens 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/Always'/>
            </wsp:Policy>
            </sp:SignedSupportingTokens>
            <rampc:RampartConfig xmlns:rampc="http://ws.apache.org/rampart/c/policy">
                <rampc:User>ticket</rampc:User>
                <rampc:PasswordType>PlainText</rampc:PasswordType>
              <rampc:PasswordCallbackClass>/home/samuelzero/workspace/AlfrescoAX2C/src/libtickets.so.1.0.1</rampc:PasswordCallbackClass>
            </rampc:RampartConfig>
        </wsp:All>
    </wsp:ExactlyOne>
</wsp:Policy>

where <rampcSmiley TongueasswordCallbackClass> links to a library that fetch a buffer that contains the result of Authentication Service.