cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hannes Holtzhausen <hannes.holtzhau...@gmail.com>
Subject Re: Oneway service operations using simple frontend
Date Mon, 26 Jul 2010 19:36:20 GMT
Thanks for the help Daniel.

Replying to the list so that everybody can benefit from this.

Cheers
Hannes

On Mon, Jul 26, 2010 at 9:16 PM, Daniel Kulp <dkulp@apache.org> wrote:
> On Monday 26 July 2010 3:14:09 pm Hannes Holtzhausen wrote:
>> Aahh, now I see the problem.
>>
>> Would I be able to register my AbstractServiceConfiguration implementation
>> using a spring configuration, possibly using the simple:serviceFactory
>> element?
>
> Yep.  See:
>
> http://svn.apache.org/repos/asf/cxf/trunk/systests/databinding/src/test/resources/webapp/WEB-INF/beans.xml
>
> for an example.  You would need to have the DefaultServiceConfiguration
> in there as well as you are specifying the full list.
>
> Dan
>
>
>
>
>>
>> Thanks for the help
>> Hannes
>>
>> On Mon, Jul 26, 2010 at 8:56 PM, Daniel Kulp <dkulp@apache.org> wrote:
>> > The version in DefaultServiceConfiguration doesn't work:
>> >
>> > m.getReturnType().getClass().equals(void.class)
>> >
>> > will always return FALSE.   It should have just been:
>> >
>> > m.getReturnType().equals(void.class)
>> >
>> > But it's WAY to late to change this now.   You would need to create the
>> > subclass and register it on the factory in the list as the first item so
>> > your version that returns correct is hit before the
>> > DefaultServiceConfiguration (which should already be in the list).
>> >
>> > Dan
>> >
>> > On Monday 26 July 2010 2:52:02 pm Hannes Holtzhausen wrote:
>> >> Thanks Daniel.
>> >>
>> >> I have been battling with this one for a while.  I actually looked at
>> >> the code for the DefaultServiceConfiguration's hasOutMessage and it
>> >> looked ok to me. So I just assumed that I was missing some
>> >> configuration somewhere to make it work.
>> >>
>> >> -----DefaultServiceConfiguration extract-----
>> >>  @Override
>> >>     public Boolean hasOutMessage(Method m) {
>> >>         if (m.getReturnType().getClass().equals(void.class) &&
>> >> m.getExceptionTypes().length == 0) {
>> >>             return false;
>> >>         }
>> >>         return true;
>> >>     }
>> >> ------End DefaultServiceConfiguration extract-----
>> >>
>> >>
>> >> I quickly looked at the ReflectionServiceFactoryBean's hasOutMessage
>> >> and it loops through a list
>> >> of AbstactServiceConfiguration instances and returns the value from
>> >> the first non-null hasOutMessage
>> >> response.
>> >>
>> >> So, it should work if I add the DefaultServiceConfiguration to the
>> >> list of configurations employed by the
>> >> service factory?
>> >>
>> >> Is there a way to add an AbstractServiceConfiguration implementation
>> >> to the factory via a spring configuration?
>> >>
>> >> Thanks
>> >> Hannes
>> >>
>> >> On Mon, Jul 26, 2010 at 8:22 PM, Daniel Kulp <dkulp@apache.org> wrote:
>> >> > With the factory, you can register a subclass of
>> >> > AbstractServiceConfiguration that just has the method:
>> >> >
>> >> >    @Override
>> >> >    public Boolean hasOutMessage(Method m) {
>> >> >        if (m.getReturnType().equals(void.class)
>> >> >          && m.getExceptionTypes().length == 0) {
>> >> >            return false;
>> >> >        }
>> >> >        return true;
>> >> >    }
>> >> >
>> >> > and that should do it.
>> >> >
>> >> > I THOUGHT that was the default for the simple frontend, but there is
a
>> >> > bug in the DefaultServiceConfiguration that is preventing that logic
>> >> > from working correctly.    I'm kind of on the fence on changing that
>> >> > now as that would affect anyone with void return methods and this bug
>> >> > has been in CXF for, well, pretty much forever.      :-(
>> >> >
>> >> > Dan
>> >> >
>> >> > On Saturday 24 July 2010 6:18:02 am Hannes Holtzhausen wrote:
>> >> >> Hi
>> >> >>
>> >> >> I have a service interface that looks like follows:
>> >> >>
>> >> >> public interface MyService
>> >> >> {
>> >> >>   public void doWork(MyWork work);
>> >> >> }
>> >> >>
>> >> >> By default the doWork interface operation would have 2 messages
>> >> >> associated with it
>> >> >> in the generated WSDL when using the simple frontend e.g:
>> >> >>
>> >> >> <wsdl:message name="doWork">
>> >> >>     <wsdl:part element="tns:doWork" name="parameters">
>> >> >>     </wsdl:part>
>> >> >>   </wsdl:message>
>> >> >>   <wsdl:message name="doWorkResponse">
>> >> >>     <wsdl:part element="tns:doWorkResponse" name="parameters">
>> >> >>     </wsdl:part>
>> >> >>   </wsdl:message>
>> >> >>
>> >> >> Are there any configuration options available that will
>> >> >> force the simple frontend to exclude the <method name>Response
>> >> >> messages from the generated WSDL for all interface operations with
>> >> >> a void return type?
>> >> >>
>> >> >> Thanks
>> >> >> Hannes
>> >> >
>> >> > --
>> >> > Daniel Kulp
>> >> > dkulp@apache.org
>> >> > http://dankulp.com/blog
>> >
>> > --
>> > Daniel Kulp
>> > dkulp@apache.org
>> > http://dankulp.com/blog
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://dankulp.com/blog
>

Mime
View raw message