users@jax-rpc.java.net

Re: Handler Chain weirdness

From: Kevin Jones <kevinj_at_DEVELOP.COM>
Date: Thu, 02 Oct 2003 18:18:19 +0100

Talking to myself again :)

The way I understand this know is that a given config file should only
have two chains, one for the server and one for the client. On the
server side handlers are either explicitly associated with a client
through the role attribute or implicitly associated with the 'next' role
either through no attribute or by setting the value of role to be
"http://schemas.xmlsoap.org/soap/actor/next". This means that
(logically)

<handlerChains>
  <chain runAt="server" roles="http://kevinj.develop.com urn:uri" >
     <handler className="com.develop.SimpleHandler"/>
  </chain>
  <chain runAt="server" >
     <handler className="com.develop.SimpleHandler"/>
  </chain>
</handlerChain>

is the same as

<handlerChains>
  <chain runAt="server" roles="http://kevinj.develop.com urn:uri
http://schemas.xmlsoap.org/soap/actor/next" >
     <handler className="com.develop.SimpleHandler"/>
  </chain>
</handlerChain>

Is that assumption correct?

The reason I ask is that a schema I tracked down on the web for the
jaxrpc-ri.xml file (I think it's part of the SunOne developers
documentation) has this entry

<xsd:complexType name="handlerChainsType">
   <xsd:sequence>
      <xsd:element name="chain" type="tns:chainType" minOccurs="0"
maxOccurs="unbounded"/>
  </xsd:sequence>
</xsd:complexType>

Which states I can have many chain elements. In the RI later chain
elements replace those listed previously. Is this a bug or should the
schema be maxOccurs="2".

Thanks again,

Kevin Jones
Developmentor
www.develop.com

> -----Original Message-----
> From: Public discussion on JAX-RPC
> [mailto:JAXRPC-INTEREST_at_JAVA.SUN.COM] On Behalf Of Kevin Jones
> Sent: 02 October 2003 14:21
> To: JAXRPC-INTEREST_at_JAVA.SUN.COM
> Subject: Re: Handler Chain weirdness
>
>
> OK, course I figured this out (I think) as soon as I posted
> the message.
> I need to do this
>
> <handlerChains>
> <chain runAt="server" roles="http://kevinj.develop.com urn:uri" >
>
> <handler className="com.develop.SimpleHandler"
> headers="ns1:SomeActorHeader"
> xmlns:ns1="http://echoservice.develop.com/types">
> </handler>
>
> </chain>
>
> If that is correct, how do I associate a chain with no actor (ultimate
> recipient)?
>
> Thanks,
>
> Kevin Jones
> Developmentor
> www.develop.com
>
> > -----Original Message-----
> > From: Public discussion on JAX-RPC
> > [mailto:JAXRPC-INTEREST_at_JAVA.SUN.COM] On Behalf Of Kevin Jones
> > Sent: 02 October 2003 14:10
> > To: JAXRPC-INTEREST_at_JAVA.SUN.COM
> > Subject: Handler Chain weirdness
> >
> >
> > I'm trying to configure two handler chains for the same endpoint for
> > different actors and I'm seeing weird behaviour.
> >
> > I have this:
> >
> > <handlerChains>
> > <chain runAt="server" roles="http://kevinj.develop.com">
> >
> > <handler className="com.develop.SimpleHandler"
> > headers="ns1:SomeActorHeader"
> > xmlns:ns1="http://echoservice.develop.com/types">
> > </handler>
> >
> > </chain>
> >
> > <chain runAt="server" roles="urn:someuri">
> > <handler className="com.develop.SimpleHandler2"
> > headers="ns1:SomeHeader"
> > xmlns:ns1="http://echoservice.develop.com/types">
> > <property name="name" value="server2"/>
> > </handler>
> > </chain>
> > </handlerChains>
> >
> > So, I have two handler classes and two chains. If I send a
> > SOAP message
> > that looks like this
> >
> > <env:Envelope xmlns:ns0="http://echoservice.develop.com/types">
> > <env:Header>
> > <ns0:SomeActorHeader env:actor="http://kevinj.develop.com"
> > env:mustUnderstand="1"/>
> >
> > then *only* the *second* handler gets called (SimpleHandler2), even
> > though it is configured for urn:someuri and even though it doesn't
> > return the QName of the SomeActorHeader. In fact I don't see
> > SimpleHandler1 called at all so the runtime can't even know that
> > SomeActorHeader (which is a mustUnderstand header) will be processed
> > somewhere.
> >
> > Should multiple handler chains work? (this is in the 1.2 JWSDP BTW),
> >
> > Kevin Jones
> > Developmentor
> > www.develop.com
> >
>