Hi

No, you must not change the MustUnderstandChecker.

You must add a handler that will process your custom header. You have two 
things to do:

1/ Write the handler class

The simplest way to do so is to write a class that extends the AbstratHandler 
provider by Axis (look up in the API docs for fully qualified name). Override 
the invoke method. In it's body you will proceed the header the way you have to.
Return InvocationResponse.CONTINUE if the header is OK, 
InvocationResponse.ABORT in other cases.

2/ Declare your handler class in axis configuration.

Edit the conf/axis2.xml file, and declare your handler in the inflow 
declaration (tag <phaseOrder type="InFlow">), where the comments tells you to 
do it , like thos for example:

after the comment like this:

<!--   After Postdispatch phase module author or service author can add any 
phase he want      -->
<!-- Samuel Rossille -->
        <phase name="myCustomPhase">
                <handler name="myCustomHandler"                                 
class="org.example.MyCustomHandler"/>
      </phase>


Tell me if you need more help.

Regards,

Samuel Rossille
-----Message d'origine-----
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 1 novembre 2007 16:57
À : ROSSILLE Samuel
Objet : RE: Axis2: howto handle custom mustUnderstand Headers

Hi Samuel,

I saw your response in the newsgroup below. I still don't quite understand how 
to configure it. Did you modify the MustUnderstandChecker or did you extend the 
class and put the code in below? If the latter, did you then configure that 
class in the axis2.xml handlers? Is there a document that talks about this?

Thanks in advance for all your help,

Thanks,
Rob

ROSSILLE Samuel wrote:
> 
> Hi
> 
> messageContext.getEnvelope().getHeader().examineAllHeaderBlocks()
> gives you an Iterator over all the SOAPHeaderBlock of the message
> 
> hb.getMustUnderstand()
> tells you if a the SOAPHeaderBlock hb must be understood.
> 
> hb.setProcessed()
> tells Axis that your program understands a the SOAPHeaderBlock hb and has
> correctly completed it's processing. 
> 
> Regards
> Samuel Rossille
> 
> -----Message d'origine-----
> De : Andreas Schultz [mailto:[EMAIL PROTECTED] 
> Envoyé : mardi 16 octobre 2007 15:54
> À : axis-user@ws.apache.org
> Objet : Axis2: howto handle custom mustUnderstand Headers
> 
> Hi all,
> 
> I need to handle custom header fields that have the mustUnderstand
> attribute set to true(1).
> Currently such an invocation triggers a fault:
> org.apache.axis2.AxisFault: Must Understand check failed for header : MyID
> 
> Searching the maillinglist has turned up a references to a
> MustUnderstandChecker, but i don't understand how i tell it what
> header elements are supported.
> 
> Is there a magic trick to tell axis which headers my service likes?
> 
> Regards
> Andreas
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
Quoted from: 
http://www.nabble.com/Axis2%3A-howto-handle-custom-mustUnderstand-Headers-tf4634363.html#a13235540

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to