> But this interceptor sees NO headers at all (it gets an empty list
> from SoapMessage.getHeaders()).
What "phase" is your testSoapInterceptor set to run in? That's important.
The headers are read in the READ phase, so it would need to run after that at
some point. Most likely, you would want it in the USER_PROTOCOL phase.
> I wonder if that's because they're
> not in the schema so JAXB doesn't know how to decode them?
No. At this point, they would just be DOM's. Thus, JAXB wouldn't apply yet.
It's most likely a phase thing.
Dan
On Wednesday 19 November 2008 5:26:13 pm Aaron Mulder wrote:
> I'm using a Spring (2.5.6) CXF (2.1.3) service set up with something like
> this:
>
> <jaxws:endpoint
> id="soapService"
> implementor="#myService"
> address="/MyService" />
>
> I'd like to add a filter/interceptor/handler to read some arbitrary
> SOAP headers and decide whether to let the processing continue. The
> WSDL/Schema for the service is ignorant of these headers and their
> associated data types.
>
> I first tried to add a CXF interceptor like this:
>
> <jaxws:endpoint
> id="soapService"
> implementor="#myService"
> address="/MyService">
> <jaxws:inInterceptors>
> <ref bean="testSoapInterceptor" />
> </jaxws:inInterceptors>
> </jaxws:endpoint>
>
> But this interceptor sees NO headers at all (it gets an empty list
> from SoapMessage.getHeaders()). I wonder if that's because they're
> not in the schema so JAXB doesn't know how to decode them?
>
> Anyway, then I tried adding a JAX-WS handler. I marked up my service
> implementation bean like this:
>
> @HandlerChain(file="soapHandlers.xml")
> public class MyServiceImpl implements MyService {
> ...
>
> Then I created a soapHandlers.xml in the same package directory as that
> class:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <jws:handler-chains xmlns:jws="http://java.sun.com/xml/ns/javaee">
> <jws:handler-chain>
> <jws:handler>
>
> <jws:handler-class>sample.soap.ServerHandler</jws:handler-class>
> </jws:handler>
> </jws:handler-chain>
> </jws:handler-chains>
>
> But this just seems to be ignored. At runtime I get no messages about
> the JAX-WS handler being created or applied, and I get no output from
> the hander's handleMessage method at all.
>
> I'm running out of ideas. What's the best way to do this?
>
> Thanks,
> Aaron
--
Daniel Kulp
[EMAIL PROTECTED]
http://dankulp.com/blog