Hi, Deepal:
 
Thanks a lot for your information.  messageContext.getParameter() is good enough.
But how to get MessageContext from axis2 service?
 
In axis2 (axis2-0-91.jar), the API "MessageContext.getCurrentContext()" doesn't exist.   How to get MessageContext for axis2? Do I miss anything?
 
Thanks,
Jen-Ya
-----------------------------------------------------------------------------------------------------
Hi Jen;

The first and correct way is  messageContext.getParamter(String prename),  but you \
can only called this method after  dispatching taking place. The second way is you \
can get those parameter by applying following procedure.

  1. get the Axis
  2. service =  axisConfig.get(Service)
  3. service.get(paramterName)
  4. operation = service.getOpeartion(Opiate);
  5. operation.getParamter(paramtername)

But the second way has some problem because top level parameter can override by \
bottom level parameter , in this way those override parameter wont be visible.

Thanks,
Deepal


From: Jen-Ya Ku
Sent: Wednesday, September 21, 2005 3:29 PM
To: [email protected]
Cc: Jen-Ya Ku
Subject: Axis2 - how to get service/operation level parameter

Hi, All:
 
In Axis2, is it possible to define service level or operation level parameter for each service?
For example, can I have service.xml like following?
-----------------------------------------------------------------
<service name="MyService">
      ...
       <parameter name="my-service-level-parameter-name">my-parameter-value</parameter>
    -----
    <operation name="ixxx">     
            <parameter name="my-operation-level-parameter">my-parameter-value</parameter>
     </operation>
  </service>
-----------------------------------------------------------------
Also, which API I should use to get these parameters from my service in Axis2 (MessageContext.getCurrentContext seems gone in Axis2) ? 
 
Thanks for your help.
 
Thanks,
Jen-Ya
 
 

Reply via email to