http://ws.apache.org/axis2/1_3/api/org/apache/axis2/jaxws/description/xml/handler/HandlerChainType.html

The handler-chain element defines the handlerchain. 

Handlerchain can be defined such that the
 handlers in the handlerchain operate on ALL ports of a service, 
on a specific port, 
or on a LIST of
 protocol-bindings. 
The choice of elements service-name-pattern, port-name-pattern, and
 protocol-bindings are used to specify whether the handlers in the 
handler-chain are for a
 service, port or protocol binding. 

If none of these choices are specified with the handler-chain
 element, then the handlers specified in the handler-chain will be applied on 
everything.
 

 

 

 
Java class for handler-chainType complex type.
 

 
The following schema fragment specifies the expected content contained within 
this class.
 

 
 <complexType name="handler-chainType">
   <complexContent>
     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType";>
       <sequence>
         <choice minOccurs="0">
           <element name="service-name-pattern" 
type="{http://www.w3.org/2001/XMLSchema}QName"/>
           <element name="port-name-pattern" 
type="{http://www.w3.org/2001/XMLSchema}QName"/>
           <element name="protocol-bindings" 
type="{http://java.sun.com/xml/ns/javaee}protocol-bindingListType"/>
         </choice>
         <element name="handler" 
type="{http://java.sun.com/xml/ns/javaee}handlerType";
 maxOccurs="unbounded"/>
       </sequence>
       <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID"; />
     </restriction>
   </complexContent>
 </complexType>
as you have none of these specified you fallback  to <handlerChains> defined in 
web.xml as something like
   <handlerChains>
      <chain runAt="server"> 
        <handler className="service.ServerHandler1"
            headers="ns1:loginfo"
            xmlns:ns1="http://example.com/headerprops";>
          <property name="name" value="server1"/>
        </handler>

        <handler className="service.ServerHandler2">
          <property name="name" value="server2"/>
        </handler>
      </chain>
    </handlerChains>
    </endpoint>

http://www.theserverside.com/news/thread.tss?thread_id=33831

what have you defined for handlerChains?
Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




> Date: Wed, 9 Sep 2009 11:17:08 -0700
> From: [email protected]
> To: [email protected]
> Subject: Axis2, Jax-WS, and @HandlerChain
> 
> 
> We are starting to develop web services using Axis2 v1.5 with JAX-WS
> annotations.  We'd like to set up JAX-WS handlers using the @HandlerChain
> annotation but I can't seem to get the handler(s) to fire.  No matter where
> I put handlers.xml in my .aar it never falls into
> AuthenticationSOAPHandler.handleMessage().  What am I missing?  My code is
> as follows:
> 
> //My web service class
> @HandlerChain(file="handlers.xml", name="handlers")
> @WebService(serviceName="MyService")
> public class MyService {
> 
>       @WebMethod
>       public int add(int a, int b) {
>               return a + b;
>       }
> }
> 
> //My handlers.xml
> <javaee:handler-chains xmlns:javaee="http://java.sun.com/xml/ns/javaee";
> xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
>     <javaee:handler-chain name="handlers">
>         <javaee:handler>
>            
> <javaee:handler-name>AuthenticationSOAPHandler</javaee:handler-name>
>            
> <javaee:handler-class>com.test.ws.AuthenticationSOAPHandler</javaee:handler-class>
>         </javaee:handler>
>     </javaee:handler-chain>
> </javaee:handler-chains>
> 
> //AuthenticationSOAPHandler class
> public class AuthenticationSOAPHandler implements
> SOAPHandler<SOAPMessageContext>{
> 
>     public boolean handleMessage(SOAPMessageContext context) {
>         return true;
>     }
> 
>     public boolean handleFault(SOAPMessageContext context) {
>         return false;
>     }
> 
>     public Set<QName> getHeaders() {
>         return null;
>     }
> 
>     public void close(MessageContext context) {
>         //Clean up any resources here
>     }
> }
> 
> -- 
> View this message in context: 
> http://www.nabble.com/Axis2%2C-Jax-WS%2C-and-%40HandlerChain-tp25370562p25370562.html
> Sent from the Axis - User mailing list archive at Nabble.com.
> 

_________________________________________________________________
With Windows Live, you can organize, edit, and share your photos.
http://www.windowslive.com/Desktop/PhotoGallery

Reply via email to