You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Yinwei David Liu <Yi...@MorganStanley.com> on 2011/04/12 02:57:21 UTC
Can CXF support multiple response?
Hi cxf-users,
I would like to know what you think if CXF can support multiple response
in its service?
Currently, one CXF service can only return one Response message for each
Request. However, there are some use case that we want one request have
multiple response messages. E.g. my service gets a jms request from a
client, and then, it will reply 3 response messages to a JMS queue.
Is there any consideration to support multiple response message for this
kind of use case?
David
Re: Can CXF support multiple response?
Posted by Johan Edstrom <se...@gmail.com>.
Using camel this would be very easy to setup.
Doing it in straight CXF doesn't really make "sense", it is more of
a ESB/BUS/FLOW/EIP type of thing.
/je
On Apr 11, 2011, at 8:16 PM, Yinwei David Liu wrote:
> Hi Freeman,
>
> Thanks for your reply.
>
>> I don't think CXF can support one request with multiple response.
> Could you please help me to understand why CXF cannot support this feature?
>
> JMS transport is an example, I also want to use a long-live transport (local
> transport, jms tcp) to send multiple response message, ( e.g. I send request
> to a cxf webservice to ask service sending some data to the client every
> minute. )
>
> Regarding the example *client creating a callback object by passing an
> EndpointReferenceType to the server*, it sounds interesting, could you
> please point out the example name so that I can check it? thanks again.
>
> David
>
> On Tue, Apr 12, 2011 at 10:06 AM, Freeman Fang <fr...@gmail.com>wrote:
>
>> Hi,
>>
>> I don't think CXF can support one request with multiple response.
>> However, per your requirement, asides from the normal response, you can
>> always send any message to the JMS queue with JMS api in your service
>> implementations.
>> Another option is that you can use callback, which means client creating a
>> callback object by passing an EndpointReferenceType to the server, then the
>> server can act as a client and callback for any times, we have callback
>> examples shipped with kit, you may need take a look.
>>
>> Freeman
>>
>> On 2011-4-12, at 上午8:57, Yinwei David Liu wrote:
>>
>> Hi cxf-users,
>>>
>>> I would like to know what you think if CXF can support multiple response
>>> in its service?
>>>
>>> Currently, one CXF service can only return one Response message for each
>>> Request. However, there are some use case that we want one request have
>>> multiple response messages. E.g. my service gets a jms request from a
>>> client, and then, it will reply 3 response messages to a JMS queue.
>>>
>>> Is there any consideration to support multiple response message for this
>>> kind of use case?
>>>
>>> David
>>>
>>
>> ---------------------------------------------
>> Freeman Fang
>>
>> FuseSource
>> Email:ffang@fusesource.com
>> Web: fusesource.com
>> Twitter: freemanfang
>> Blog: http://freemanfang.blogspot.com
>> Connect at CamelOne May 24-26
>> The Open Source Integration Conference
>>
>>
>>
>>
>>
>>
>>
>>
>>
Re: Can CXF support multiple response?
Posted by Yinwei David Liu <Yi...@MorganStanley.com>.
Thanks Freeman & Johan. I will check both callback and camel.
David
On Tue, Apr 12, 2011 at 10:25 AM, Freeman Fang <fr...@gmail.com>wrote:
> Hi,
>
> The callback example is in
>
> CXF_HOME/samples/callback
>
> Or as Johan mentioned, use Apache Camel[1] to control more flexible and
> complex flow.
>
> [1]http://camel.apache.org/
>
> Freeman
>
> On 2011-4-12, at 上午10:16, Yinwei David Liu wrote:
>
> Hi Freeman,
>
> Thanks for your reply.
>
> > I don't think CXF can support one request with multiple response.
> Could you please help me to understand why CXF cannot support this feature?
>
> JMS transport is an example, I also want to use a long-live transport
> (local transport, jms tcp) to send multiple response message, ( e.g. I send
> request to a cxf webservice to ask service sending some data to the client
> every minute. )
>
> Regarding the example *client creating a callback object by passing an
> EndpointReferenceType to the server*, it sounds interesting, could you
> please point out the example name so that I can check it? thanks again.
>
> David
>
> On Tue, Apr 12, 2011 at 10:06 AM, Freeman Fang <fr...@gmail.com>wrote:
>
>> Hi,
>>
>> I don't think CXF can support one request with multiple response.
>> However, per your requirement, asides from the normal response, you can
>> always send any message to the JMS queue with JMS api in your service
>> implementations.
>> Another option is that you can use callback, which means client creating a
>> callback object by passing an EndpointReferenceType to the server, then the
>> server can act as a client and callback for any times, we have callback
>> examples shipped with kit, you may need take a look.
>>
>> Freeman
>>
>> On 2011-4-12, at 上午8:57, Yinwei David Liu wrote:
>>
>> Hi cxf-users,
>>>
>>> I would like to know what you think if CXF can support multiple
>>> response
>>> in its service?
>>>
>>> Currently, one CXF service can only return one Response message for each
>>> Request. However, there are some use case that we want one request have
>>> multiple response messages. E.g. my service gets a jms request from a
>>> client, and then, it will reply 3 response messages to a JMS queue.
>>>
>>> Is there any consideration to support multiple response message for this
>>> kind of use case?
>>>
>>> David
>>>
>>
>> ---------------------------------------------
>> Freeman Fang
>>
>> FuseSource
>> Email:ffang@fusesource.com
>> Web: fusesource.com
>> Twitter: freemanfang
>> Blog: http://freemanfang.blogspot.com
>> Connect at CamelOne May 24-26
>> The Open Source Integration Conference
>>
>>
>>
>>
>>
>>
>>
>>
>>
>
> ---------------------------------------------
> Freeman Fang
>
> FuseSource
> Email:f <de...@fusesource.com>fang@fusesource.com
> Web: fusesource.com
> Twitter: freemanfang
> Blog: http://freemanfang.blogspot.com
> Connect at CamelOne <http://camelone.com/> May 24-26
> The Open Source Integration Conference
>
>
>
>
>
>
>
>
>
Re: Can CXF support multiple response?
Posted by Freeman Fang <fr...@gmail.com>.
Hi,
The callback example is in
CXF_HOME/samples/callback
Or as Johan mentioned, use Apache Camel[1] to control more flexible
and complex flow.
[1]http://camel.apache.org/
Freeman
On 2011-4-12, at 上午10:16, Yinwei David Liu wrote:
> Hi Freeman,
>
> Thanks for your reply.
>
> > I don't think CXF can support one request with multiple response.
> Could you please help me to understand why CXF cannot support this
> feature?
>
> JMS transport is an example, I also want to use a long-live
> transport (local transport, jms tcp) to send multiple response
> message, ( e.g. I send request to a cxf webservice to ask service
> sending some data to the client every minute. )
>
> Regarding the example *client creating a callback object by passing
> an EndpointReferenceType to the server*, it sounds interesting,
> could you please point out the example name so that I can check it?
> thanks again.
>
> David
>
> On Tue, Apr 12, 2011 at 10:06 AM, Freeman Fang
> <fr...@gmail.com> wrote:
> Hi,
>
> I don't think CXF can support one request with multiple response.
> However, per your requirement, asides from the normal response, you
> can always send any message to the JMS queue with JMS api in your
> service implementations.
> Another option is that you can use callback, which means client
> creating a callback object by passing an EndpointReferenceType to
> the server, then the server can act as a client and callback for any
> times, we have callback examples shipped with kit, you may need take
> a look.
>
> Freeman
>
> On 2011-4-12, at 上午8:57, Yinwei David Liu wrote:
>
> Hi cxf-users,
>
> I would like to know what you think if CXF can support multiple
> response
> in its service?
>
> Currently, one CXF service can only return one Response message for
> each
> Request. However, there are some use case that we want one request
> have
> multiple response messages. E.g. my service gets a jms request from a
> client, and then, it will reply 3 response messages to a JMS queue.
>
> Is there any consideration to support multiple response message for
> this
> kind of use case?
>
> David
>
> ---------------------------------------------
> Freeman Fang
>
> FuseSource
> Email:ffang@fusesource.com
> Web: fusesource.com
> Twitter: freemanfang
> Blog: http://freemanfang.blogspot.com
> Connect at CamelOne May 24-26
> The Open Source Integration Conference
>
>
>
>
>
>
>
>
>
---------------------------------------------
Freeman Fang
FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
Connect at CamelOne May 24-26
The Open Source Integration Conference
Re: Can CXF support multiple response?
Posted by Yinwei David Liu <Yi...@MorganStanley.com>.
Thanks Dan.
Agree that those specifications are request/response oriented which only
allow one request to get one response. However, I think one request and
multiple response is a common feature that most app will need it, and it is
very useful in the realtime application because we want server to push data
into client.
To have two separate services could resolve the issue, however, I am
concerned on the complexity of programming model that developers have to
remember that two service are actually *one* service. Also, Camel could be
an option, however, it add another layer on top of service, and its requires
a bit more knowledge one camel.
Although cxf does not support it at this moment, I hope cxf can provide a
easy way to replied multiple responses in the future, thanks again.
David
On Tue, Apr 12, 2011 at 3:54 PM, Daniel Kulp <dk...@apache.org> wrote:
> On Monday 11 April 2011 10:16:15 PM Yinwei David Liu wrote:
> > Hi Freeman,
> >
> > Thanks for your reply.
> >
> > > I don't think CXF can support one request with multiple response.
> >
> > Could you please help me to understand why CXF cannot support this
> feature?
>
> It's mostly due to the specifications that CXF implements. WSDL, JAX-WS,
> etc... are very request/response. Client creates a request, gets a
> response,
> moves on... WSDL doesn't really have a way to model single request,
> multi
> reponse.
>
> This would NORMALLY be modelled as two separate services that likely use
> one-
> way semantics. The "client" would bring up a service and get a reference
> to
> it. When it calles the service, it would pass that reference along with
> the
> rest of the request data. The service would then call back on that
> service
> as needed.
>
> Dan
>
> >
> > JMS transport is an example, I also want to use a long-live transport
> > (local transport, jms tcp) to send multiple response message, ( e.g. I
> > send request to a cxf webservice to ask service sending some data to the
> > client every minute. )
> >
> > Regarding the example *client creating a callback object by passing an
> > EndpointReferenceType to the server*, it sounds interesting, could you
> > please point out the example name so that I can check it? thanks again.
> >
> > David
> >
> > On Tue, Apr 12, 2011 at 10:06 AM, Freeman Fang
> <fr...@gmail.com>wrote:
> > > Hi,
> > >
> > > I don't think CXF can support one request with multiple response.
> > > However, per your requirement, asides from the normal response, you
> can
> > > always send any message to the JMS queue with JMS api in your service
> > > implementations.
> > > Another option is that you can use callback, which means client
> creating
> > > a callback object by passing an EndpointReferenceType to the server,
> > > then the server can act as a client and callback for any times, we have
> > > callback examples shipped with kit, you may need take a look.
> > >
> > > Freeman
> > >
> > > On 2011-4-12, at 上午8:57, Yinwei David Liu wrote:
> > > Hi cxf-users,
> > >
> > >> I would like to know what you think if CXF can support multiple
> > >> response
> > >>
> > >> in its service?
> > >>
> > >> Currently, one CXF service can only return one Response message for
> > >> each
> > >>
> > >> Request. However, there are some use case that we want one request
> have
> > >> multiple response messages. E.g. my service gets a jms request from a
> > >> client, and then, it will reply 3 response messages to a JMS queue.
> > >>
> > >> Is there any consideration to support multiple response message for
> > >> this
> > >>
> > >> kind of use case?
> > >>
> > >> David
> > >
> > > ---------------------------------------------
> > > Freeman Fang
> > >
> > > FuseSource
> > > Email:ffang@fusesource.com
> > > Web: fusesource.com
> > > Twitter: freemanfang
> > > Blog: http://freemanfang.blogspot.com
> > > Connect at CamelOne May 24-26
> > > The Open Source Integration Conference
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://dankulp.com/blog
> Talend - http://www.talend.com
>
Re: Can CXF support multiple response?
Posted by Daniel Kulp <dk...@apache.org>.
On Monday 11 April 2011 10:16:15 PM Yinwei David Liu wrote:
> Hi Freeman,
>
> Thanks for your reply.
>
> > I don't think CXF can support one request with multiple response.
>
> Could you please help me to understand why CXF cannot support this feature?
It's mostly due to the specifications that CXF implements. WSDL, JAX-WS,
etc... are very request/response. Client creates a request, gets a response,
moves on... WSDL doesn't really have a way to model single request, multi
reponse.
This would NORMALLY be modelled as two separate services that likely use one-
way semantics. The "client" would bring up a service and get a reference to
it. When it calles the service, it would pass that reference along with the
rest of the request data. The service would then call back on that service
as needed.
Dan
>
> JMS transport is an example, I also want to use a long-live transport
> (local transport, jms tcp) to send multiple response message, ( e.g. I
> send request to a cxf webservice to ask service sending some data to the
> client every minute. )
>
> Regarding the example *client creating a callback object by passing an
> EndpointReferenceType to the server*, it sounds interesting, could you
> please point out the example name so that I can check it? thanks again.
>
> David
>
> On Tue, Apr 12, 2011 at 10:06 AM, Freeman Fang
<fr...@gmail.com>wrote:
> > Hi,
> >
> > I don't think CXF can support one request with multiple response.
> > However, per your requirement, asides from the normal response, you can
> > always send any message to the JMS queue with JMS api in your service
> > implementations.
> > Another option is that you can use callback, which means client creating
> > a callback object by passing an EndpointReferenceType to the server,
> > then the server can act as a client and callback for any times, we have
> > callback examples shipped with kit, you may need take a look.
> >
> > Freeman
> >
> > On 2011-4-12, at 上午8:57, Yinwei David Liu wrote:
> > Hi cxf-users,
> >
> >> I would like to know what you think if CXF can support multiple
> >> response
> >>
> >> in its service?
> >>
> >> Currently, one CXF service can only return one Response message for
> >> each
> >>
> >> Request. However, there are some use case that we want one request have
> >> multiple response messages. E.g. my service gets a jms request from a
> >> client, and then, it will reply 3 response messages to a JMS queue.
> >>
> >> Is there any consideration to support multiple response message for
> >> this
> >>
> >> kind of use case?
> >>
> >> David
> >
> > ---------------------------------------------
> > Freeman Fang
> >
> > FuseSource
> > Email:ffang@fusesource.com
> > Web: fusesource.com
> > Twitter: freemanfang
> > Blog: http://freemanfang.blogspot.com
> > Connect at CamelOne May 24-26
> > The Open Source Integration Conference
--
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com
Re: Can CXF support multiple response?
Posted by Yinwei David Liu <Yi...@MorganStanley.com>.
Hi Freeman,
Thanks for your reply.
> I don't think CXF can support one request with multiple response.
Could you please help me to understand why CXF cannot support this feature?
JMS transport is an example, I also want to use a long-live transport (local
transport, jms tcp) to send multiple response message, ( e.g. I send request
to a cxf webservice to ask service sending some data to the client every
minute. )
Regarding the example *client creating a callback object by passing an
EndpointReferenceType to the server*, it sounds interesting, could you
please point out the example name so that I can check it? thanks again.
David
On Tue, Apr 12, 2011 at 10:06 AM, Freeman Fang <fr...@gmail.com>wrote:
> Hi,
>
> I don't think CXF can support one request with multiple response.
> However, per your requirement, asides from the normal response, you can
> always send any message to the JMS queue with JMS api in your service
> implementations.
> Another option is that you can use callback, which means client creating a
> callback object by passing an EndpointReferenceType to the server, then the
> server can act as a client and callback for any times, we have callback
> examples shipped with kit, you may need take a look.
>
> Freeman
>
> On 2011-4-12, at 上午8:57, Yinwei David Liu wrote:
>
> Hi cxf-users,
>>
>> I would like to know what you think if CXF can support multiple response
>> in its service?
>>
>> Currently, one CXF service can only return one Response message for each
>> Request. However, there are some use case that we want one request have
>> multiple response messages. E.g. my service gets a jms request from a
>> client, and then, it will reply 3 response messages to a JMS queue.
>>
>> Is there any consideration to support multiple response message for this
>> kind of use case?
>>
>> David
>>
>
> ---------------------------------------------
> Freeman Fang
>
> FuseSource
> Email:ffang@fusesource.com
> Web: fusesource.com
> Twitter: freemanfang
> Blog: http://freemanfang.blogspot.com
> Connect at CamelOne May 24-26
> The Open Source Integration Conference
>
>
>
>
>
>
>
>
>
Re: Can CXF support multiple response?
Posted by Freeman Fang <fr...@gmail.com>.
Hi,
I don't think CXF can support one request with multiple response.
However, per your requirement, asides from the normal response, you
can always send any message to the JMS queue with JMS api in your
service implementations.
Another option is that you can use callback, which means client
creating a callback object by passing an EndpointReferenceType to the
server, then the server can act as a client and callback for any
times, we have callback examples shipped with kit, you may need take a
look.
Freeman
On 2011-4-12, at 上午8:57, Yinwei David Liu wrote:
> Hi cxf-users,
>
> I would like to know what you think if CXF can support multiple
> response
> in its service?
>
> Currently, one CXF service can only return one Response message for
> each
> Request. However, there are some use case that we want one request
> have
> multiple response messages. E.g. my service gets a jms request from a
> client, and then, it will reply 3 response messages to a JMS queue.
>
> Is there any consideration to support multiple response message for
> this
> kind of use case?
>
> David
---------------------------------------------
Freeman Fang
FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
Connect at CamelOne May 24-26
The Open Source Integration Conference