You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Hannes Holtzhausen <ha...@gmail.com> on 2010/07/24 12:18:02 UTC
Oneway service operations using simple frontend
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
Re: Oneway service operations using simple frontend
Posted by Hannes Holtzhausen <ha...@gmail.com>.
Hi
Thanks for the reply.
It is however possible to annotate the service interface
with the @Oneway annotation when using the JAX-WS frontend.
This has the effect of removing the doWorkResponse message
and the output element from the soap binding i.e the @Oneway
annotation causes the JAX-WS frontend to generate a fire and
forget interface.
I was enquiring whether there is an equivalent configuration when
using the simple frontend to achieve the same as the
@Oneway annotation when using the JAX-WS frontend.
Sorry, my first post might not have made this very clear.
Hannes
On Mon, Jul 26, 2010 at 6:25 PM, Glen Mazza <gl...@gmail.com> wrote:
>
> The addition of doWorkResponse is probably dictated by the JAX-WS
> specification that CXF has to implement. Also, removal of the
> doWorkResponse would probably harm interoperability (and portability of)
> SOAP clients, because they rely on the WSDL to generate needed artifacts.
> WSDL 2.0 doesn't use wsdl:messages at all, so your concern may go away with
> the new standard (assuming WSDL 2.0 will ever become the standard.)
>
> Glen
>
>
> 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
>>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Oneway-service-operations-using-simple-frontend-tp1960887p2228242.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
Re: Oneway service operations using simple frontend
Posted by Glen Mazza <gl...@gmail.com>.
The addition of doWorkResponse is probably dictated by the JAX-WS
specification that CXF has to implement. Also, removal of the
doWorkResponse would probably harm interoperability (and portability of)
SOAP clients, because they rely on the WSDL to generate needed artifacts.
WSDL 2.0 doesn't use wsdl:messages at all, so your concern may go away with
the new standard (assuming WSDL 2.0 will ever become the standard.)
Glen
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
>
--
View this message in context: http://cxf.547215.n5.nabble.com/Oneway-service-operations-using-simple-frontend-tp1960887p2228242.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Oneway service operations using simple frontend
Posted by Daniel Kulp <dk...@apache.org>.
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
Re: Oneway service operations using simple frontend
Posted by Hannes Holtzhausen <ha...@gmail.com>.
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 <dk...@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 <dk...@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 <dk...@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
>