We are a little outside my expertise, but I'd advise:
Define a bean class that gets the CXF bug injected.
@Resource
public void setBus(Bus bus) {
if (this.bus != bus) {
this.bus = bus;
registerWithBindingManager();
}
And put the code in there. What I don't know is how to make sure that you
get called at the right time: after the handler registry is set up. There
are other people who, with any luck, will chime in.
On Sat, Oct 24, 2009 at 10:52 AM, vickatvuuch <[email protected]> wrote:
>
> can it be done from the config file?
>
> so far I was using beans.xml to configure everything - bus and endpoints,
> interceptors, etc.
>
>
> bimargulies wrote:
> >
> > org.apache.cxf.transport.http.QueryHandlerRegistryImpl
> >
> > Walk the bus:
> >
> > for (QueryHandler qh :
> > bus.getExtension(QueryHandlerRegistry.class).getHandlers()) {
> > }
> >
> > and when you find the regular handler, replace it with yours.
> >
> > And perhaps open a JIRA suggesting that QueryHandlerRegistryImpl be
> > friendlier to customization here.
> >
> >
> > On Sat, Oct 24, 2009 at 10:17 AM, vickatvuuch <[email protected]>
> wrote:
> >
> >>
> >> Thanks!
> >>
> >> it sounds promising; do you mind sharing how to tell the bus that it
> >> should
> >> run my handler?
> >>
> >> Thanks,
> >> -Vitaly
> >>
> >>
> >> bimargulies wrote:
> >> >
> >> > The handler is registered as an object on the bus. You can register
> >> yours
> >> > instead.
> >> >
> >> > On Fri, Oct 23, 2009 at 6:19 PM, vickatvuuch <[email protected]>
> >> wrote:
> >> >
> >> >>
> >> >> Some digging led me to the WSDLQueryHandler.updateDoc method.
> >> >> I could add my header elements as a sibling of each input element in
> >> >> there;
> >> >> now the question is how can I override WSDLQueryHandler with my
> >> >> implementation? is it possible to give CXF my derived class that
> >> extends
> >> >> WSDLQueryHandler?
> >> >>
> >> >>
> >> >> vickatvuuch wrote:
> >> >> >
> >> >> > Hi CXF gurus!
> >> >> >
> >> >> > I need to add a custom header element to all my endpoints as a
> place
> >> >> for
> >> >> > client to stick a session token.
> >> >> >
> >> >> > For example I need to add this message xml element once:
> >> >> >
> >> >> > <wsdl:message name="Authentication">
> >> >> > <wsdl:part name="Authentication" type="tns1:SessionInfo"/>
> >> >> > </wsdl:message><br/>
> >> >> >
> >> >> > and a chunk of xml in bold below, to every port and every
> >> >> operation:<br/>
> >> >> >
> >> >> > <wsdl:operation name="getFoo">
> >> >> > <wsdlsoap:operation soapAction="getFoo"/>
> >> >> > <wsdl:input name="getFoo">
> >> >> > <wsdlsoap:body
> >> >> > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> >> >> use="encoded"/>
> >> >> > <wsdlsoap:header message="impl:Authentication"
> >> >> > part="Authentication"
> >> >> > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> >> >> use="encoded"/>
> >> >> > </wsdl:input>
> >> >> >
> >> >> > I'm debugging it at the WSDLManager level and wonder if there is a
> >> >> better
> >> >> > way to do it?
> >> >> > May be a plug in or through an interceptor?
> >> >> >
> >> >> > Any help is very much appreciated.
> >> >> >
> >> >> > Thanks,
> >> >> > -Vitaly
> >> >> >
> >> >> >
> >> >> >
> >> >>
> >> >> --
> >> >> View this message in context:
> >> >> http://www.nabble.com/Custom-WSDL-header-tp26030841p26034038.html
> >> >> Sent from the cxf-user mailing list archive at Nabble.com.
> >> >>
> >> >>
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Custom-WSDL-header-tp26030841p26039401.html
> >> Sent from the cxf-user mailing list archive at Nabble.com.
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/CXF-custom-WSDL-header-or-customizing-WSDLQueryHandler-document-tp26030841p26039721.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>