You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Jongjin Choi (JIRA)" <ax...@ws.apache.org> on 2005/03/12 06:01:52 UTC

[jira] Commented: (AXIS-1864) MessageContext In Handler not Change...

     [ http://issues.apache.org/jira/browse/AXIS-1864?page=comments#action_60684 ]
     
Jongjin Choi commented on AXIS-1864:
------------------------------------

Try one of these:
1. use JAX-RPC Handler insteadof Axis handler if JAX-RPC handler can be applied to your case.

2. If you should use Axis handler, use SOAPPart's getAsDocument() when getting the message and modify the message with DOM API, then use SOAPPart's setCurrentMessage(byte[], SOAPPart.FORM_BYTES) when setting the modified message. 
You can refer to the WSDoAllSender.java of WSS4J.

  

> 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