users@jax-rpc.java.net

Handling mustUnderstand Headers

From: Kevin Jones <kevinj_at_DEVELOP.COM>
Date: Thu, 02 Oct 2003 13:49:41 +0100

In the JAXRPC RI:

If I add a handler chain for a specific actor and set a mustUnderstand
header for that actor, the handler specifies that it handles the header
by returning the QName of the header in the getHeaders method.

How do I specify that a mustUnderstand header with no actor has been
processed. I have a handler chain specified like this

<chain runAt="server">
     <handler className="com.develop.SimpleHandler"/>
</chain>

(BTW, I've tried the configuration both with and without a 'headers'
attribute)

I assumed that this would be equivalent to the handler for the 'ultimate
recipient'. In the handlers getHeaders method I do this

public QName[] getHeaders()
{
    return new QName[]{new QName("http://echoservice.develop.com/types",
"SomeHeader")};
}

and the request contains this

<env:Envelope xmlns:ns0="http://echoservice.develop.com/types">
  <env:Header>
    <ns0:SomeHeader env:mustUnderstand="1"/>
  </env:Header>

I see the handler being called both on the request and the response
side, but my implementation *isn't* executed, and the JAXRPC runtime
throws a 'mustUnderstand' exception.

So, how do I tell the runtime that I've processed this header?

Kevin Jones
Developmentor
www.develop.com