Thanks for the help, this was very useful
Now I have a different question related to this. When trying to get an element 
from the message context, is there an easy way to do that? or do I have to 
parse the message manually?
Thanks

Date: Wed, 29 May 2013 09:37:14 -0400
From: [email protected]
To: [email protected]
Subject: Re: Deploying a handler


  
    
  
  
    Why don't you read one of the articles
      I sent you?

      

      Deepal

    
    
      
        
          
            
              
                
                  
                    
                      Deepal
                          jayasinghe,

                          

                        
                      Can I know
                        what is the benefit you will get if we will go
                        through the modules.

                        

                      
                    I saw the
                      steps, it tells to follow the bellow steps

                      

                    
                    
                      MyService
                          with a
                          Logging Module
                        
                          Step1
                              : LoggingModule
                              Class
                          Step2
                              : LogHandler
                          Step3
                              : module.xml
                          Step4:
Modify
                              the "axis2.xml"
                          Step5
                              :
                              Modify the "services.xml
                          Step6
                              : Packaging
                          Step7
                              : Deploy
                              the Module in Axis2
                        
                      
                    
                    Actually I don't have the knowledge of the module,
                    for that reason I am asking this.

                    

                  
                  From my understanding,

                  

                
                If you want to log only soap message what is going out
                and coming in, use a simple handler which is the
                subclass of AbstractHandler

                

              
              get the soap message from the messageContext. And
              configure the same class in axis2.xml and deploy.

              

            
            If you can clarify me what is the disadvantage here, for
            that reason we will go through the module, I will be great
            thankful to you.

            

          
          Thanks,

        
        Satya

      
      

        

        On Wed, May 29, 2013 at 12:16 PM,
          Abdelrahman Almahmoud <[email protected]>
          wrote:

          
            
              Thanks for your time, the comments are very
                helpful
                

                
                Just to clarify, you suggested that changing the
                  Axis2.xml is not needed when writing modules but the
                  first guide is doing that
                If possible, I would like the module to activate on
                  a single service

                  

                  
                  So far this is what I have,
                  

                  
                  the SimpleModule.java  which I assume is mostly
                    default
                  

                  
                  
                    package abd;
                    

                    
                    import org.apache.axis2.AxisFault;
                    import
                      org.apache.axis2.context.ConfigurationContext;
                    import
                      org.apache.axis2.description.AxisDescription;
                    import org.apache.axis2.description.AxisModule;
                    import org.apache.axis2.modules.Module;
                    import org.apache.neethi.Assertion;
                    import org.apache.neethi.Policy;
                    

                    
                    public class SimpleModule implements Module{
                    

                    
                        public void init(ConfigurationContext
                      configContext, AxisModule module) throws AxisFault
                      {
                        }
                    

                    
                        public void engageNotify(AxisDescription
                      axisDescription) throws AxisFault {
                        }
                    

                    
                        public void shutdown(ConfigurationContext
                      configurationContext) throws AxisFault {
                        }
                        
                        public String[] getPolicyNamespaces() {
                            return null;    
                        }
                    

                    
                        public void applyPolicy(Policy policy,
                      AxisDescription axisDescription) throws AxisFault
                      {
                        }
                               
                        public boolean
                      canSupportAssertion(Assertion assertion) {
                            return true;
                        }
                    }
                    

                    
                    

                    
                    The SimpleHandler.java which I pasted before
                      and the module.xml 
                    

                    
                    
                      <module name="SimpleModule"
                        class="abd.SimpleModule">
                          <InFlow>
                              <handler name="InFlowLogHandler"
                        class="abd.SimpleHandler">
                                  <order phase="TestPhase"/>
                              </handler>
                          </InFlow>
                      

                      
                          <OutFlow>
                              <handler name="OutFlowLogHandler"
                        class="abd.SimpleHandler">
                                  <order phase="TestPhase"/>
                              </handler>
                          </OutFlow>
                      

                      
                          <OutFaultFlow>
                              <handler
                        name="FaultOutFlowLogHandler"
                        class="abd.SimpleHandler">
                                  <order phase="TestPhase"/>
                              </handler>
                          </OutFaultFlow>
                      

                      
                          <InFaultFlow>
                              <handler
                        name="FaultInFlowLogHandler"
                        class="abd.SimpleHandler">
                                  <order phase="TestPhase"/>
                              </handler>
                          </InFaultFlow>
                      </module>
                    
                    

                    
                    The contents of the bin folder are 
                    

                    
                    abd                >  .class files
                    META-INF    > module.xml
                    

                    
                     

                      
                        Date: Tue, 28 May 2013 14:41:40 -0400
                        

                          From: [email protected]

                          To: [email protected]

                          Subject: Re: Deploying a handler

                          

                          What is confusing ?

                            

                            You can add handlers either using modules or
                            by editing axis2.xml, however we do not
                            recommend changes to axis2.xml. That is why
                            we introduced the concepts of modules, where
                            user can deploy customs handlers without
                            changing any global configurations.

                            

                            Deepal

                          
                          
                            
                              This is confusing now so, I will test the
                                  previous method tomorrow just for
                                  testing, but I will give the modules a
                                  more detailed look for the final
                                  deployment 
                              

                                

                                
                                  Date: Tue, 28 May 2013 11:24:27
                                  -0400

                                  From: [email protected]

                                  To: [email protected]

                                  Subject: Re: Deploying a handler

                                  

                                  NOPE, you do not need to modify
                                    axis2.xml.

                                    

                                    Deepal

                                  
                                  
                                    yes it will work and
                                      you need to modify the axis2.xml
                                      as well

                                    
                                    

                                      

                                      On Tue, May 28, 2013 at 6:36
                                        PM, Deepal jayasinghe 
<[email protected]>
                                        wrote:

                                        
                                          
                                            The way you deploy
                                              handlers in Axis2 is using
                                              the concept call Module.
                                              Please follow following
                                              tutorial to get a good
                                              understanding how to do
                                              that.

                                              
http://axis.apache.org/axis2/java/core/docs/modules.html

                                              
http://www.packtpub.com/article/apache-axis2-web-services-writing-module

                                                  

                                                  Deepal

                                                
                                            
                                              
                                                
                                                  Hello,
                                                    

                                                    
                                                    I wrote my own
                                                      simple handler
                                                      which I want to
                                                      deploy. This
                                                      handler is the
                                                      first to work on
                                                      inflowing SOAP
                                                      messages and as
                                                      such I modified
                                                      the configuration
                                                      to have it in the
                                                      inflow section.
                                                    My question is,
                                                      how do I build and
                                                      deploy this
                                                      handler? 
                                                    

                                                    
                                                    Thanks
                                                  
                                                
                                                

                                              
                                            
                                          
                                        
                                      
                                      

                                    
                                  
                                  

                                
                              
                            
                          
                          

                        
                      
                    
                  
                
              
            
          
        
        

      
    
    
                                          

Reply via email to