MessageContext In Handler not Change...
---------------------------------------

         Key: AXIS-1864
         URL: http://issues.apache.org/jira/browse/AXIS-1864
     Project: Axis
        Type: Bug
  Components: Basic Architecture  
    Versions: 1.2RC3    
 Environment: WEBLOGIC 6.1
    Reporter: oh dong won



Some Question on Axis Handler 
My Service is.. very simple like this..
   ..............
   public class HelloWorld {
    public HelloWorld() {
    }
    public String getHelloWorldMessage(String test1,String test2) {
        
        System.out.println("test1  : " + test1);
        System.out.println("test2 : "  + test2);
        .......
        .. some.. DB job.
        ..
        return test1;
    }
  }


very Simple.( input:2 output: 1) 
but Client side send inputparam with base64encoded..

In Service side, I can't add decoding method because copyright , zipped JAR, 
and ETC
(and I wish to use axis Handler)
therefor I use Axis Handler Like this..
..
..
public class HandlerTest extends BasicHandler {

    public HandlerTest() {
    }

    public void invoke(org.apache.axis.MessageContext messageContext) throws 
org.apache.axis.AxisFault {
        System.out.println("***********  Handler1 START*************");         
   
        String logfilename = "";
        try{
            SOAPEnvelope envelope = 
messageContext.getCurrentMessage().getSOAPEnvelope();
            

            //////////////
            // get RPCElement 
            RPCElement pel = (RPCElement) envelope.getFirstBody();
            Vector v = pel.getParams();
            int nSize = v.size();
            logMessage(logfilename,"nSize :" + nSize);
            
            ////////////////
            // get All RPC input Param 
            for(int i = 0 ; i < nSize ; i++ ){
                RPCParam parmTest = (RPCParam)v.get(i);   // get 
RPCParam(Value, Name)
                String vVALUE = (String) parmTest.getValue(); 
                String vNAME  = (String) parmTest.getName();
                
                logMessage(logfilename,"vNAME  :" + vNAME);
                logMessage(logfilename,"vVALUE :" + vVALUE);
                
                //////////////////////
                // base64decoidng....
                String vdecodedValue = new String( Base64.decode( 
(String)parmTest.getValue()) );
                logMessage(logfilename,"vdecodedValue :" + vdecodedValue);
                
                /////////////
                // setting value
                parmTest.setValue(vdecodedValue);  
                
                vVALUE = (String) parmTest.getValue();
                logMessage(logfilename,"After decode :" + vVALUE);
            }
            messageContext.getCurrentMessage().saveChanges();
            Message mess = messageContext.getCurrentMessage();
            
            mess.writeTo(System.out); // NOT CHANGE XML(Not decoded....)
            .....
            
 
Why Not Change messagecontext?
messagecontext in Invoke Method is read ONLY?





-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira

Reply via email to