Hi,

 

I am trying to convert our web service application from axis to axis2. I have a handler to do the authorization based on the object passed in.

 

Previously when using Axis, I retrieved ‘RPCElement’ and ‘RPCParam’ objects from OMElement and do the following:

 

----------------------------------------------------------------

import org.apache.axis.AxisFault;

import org.apache.axis.MessageContext;

import org.apache.axis.handlers.BasicHandler;

import org.apache.axis.message.RPCElement;

import org.apache.axis.message.RPCParam;

import org.apache.axis.message.SOAPEnvelope;

import org.apache.axis.transport.http.HTTPConstants;

import org.xml.sax.SAXException; 

 

void doAuthorization(SOAPEnvlope envlope){

 

               // retrieve the soap envelope

        Vector bodyElements = null;

        Enumeration e0 = null;         

         

        bodyElements = envlope.getBodyElements(); 

        while (e0.hasMoreElements()) {

                // recurse through the soap body and retrieve the

                // rpc elements, the rpc elements contain the

                // embeded objects which were returned from the service

                RPCElement rpcElement = (RPCElement) e0.nextElement();

                Vector params = rpcElement.getParams();

                Enumeration e1 = params.elements();

 

                while (e1.hasMoreElements()) {

                    RPCParam rpcParam = (RPCParam) e1.nextElement();

                    Object param = null;

                    param = rpcParam.getObjectValue();

                if(param instanceof SOME_SERVICE_OBJ) {

 

                    // perform some service authorization

                    // ...

 

                   }

                   else {

 

                   // do nothing

                   }

             }

       }

}

-------------------------------------------------------------------------------

Now in Axis2, I cannot find any similar RPC classes which are as convenient as “RPCElement” and “RPCParam” in axis. With help of such classes, we can easily retrive RPCParam’s object value (might be a very complex structure) from SOAP message and do some sort of authorization based on its object value’s runtime class (seeing the red highlighted part of the code.)

 

 

Any idea? Any help is highly appreciated.

 

Liping

 




The information contained in this e-mail message is intended only
for the personal and confidential use of the recipient(s) named
above. This message may be an attorney-client communication and/or
work product and as such is privileged and confidential. If the
reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are
hereby notified that you have received this document in error and
that any review, dissemination, distribution, or copying of this
message is strictly prohibited. If you have received this
communication in error, please notify us immediately by e-mail, and
delete the original message.

Reply via email to