camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: null expression for setting body to null?
Date Mon, 18 Nov 2013 13:58:41 GMT
Hi

Yeah we could add that ${null} function to the simple language.
Then we dont introduce a new DSL which likely is overkill for a not so
often use-case.



On Mon, Nov 18, 2013 at 2:35 PM, Aki Yoshida <elakito@gmail.com> wrote:
> One use case is for a request-response scenario using a jaxws provider
> (at camel-cosnumer) and when you want to return a null to this
> endpoint so that it can return an HTTP 202 response to the caller
> instead of returning some xml data which was in the body (i.e., using
> the rule described in jaws spec)
>
> Jaxws spec
> 5.1.1 Invocation
> A Provider based service instance’s invoke method is called for each
> message received for the service.
> When an invoke method returns null, it is considered that no response
> needs to be sent by service.
>
> regards, aki
>
>
> 2013/11/18 Claus Ibsen <claus.ibsen@gmail.com>:
>> What is the use-case for setting the body as null ?
>>
>> On Mon, Nov 18, 2013 at 11:59 AM, Aki Yoshida <elakito@gmail.com> wrote:
>>> I would like to set the body to null using xml and would like do
>>> something as simple as
>>> <setBody><simple>${null}</simple></setBody>
>>>
>>> I experimented with this idea and added this null-expression to the
>>> simple expression builder so that this expression works.
>>>
>>> But I was not sure if there is already another way to do this without
>>> introducing this expression. I know a workaround to set the body to
>>> null by using something non-existent (e.g., ${header.ugly}), but that
>>> is ugly.
>>>
>>> So if there is no other way, I would like to add this simple
>>> expression to camel.
>>>
>>> regards, aki
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> Red Hat, Inc.
>> Email: cibsen@redhat.com
>> Twitter: davsclaus
>> Blog: http://davsclaus.com
>> Author of Camel in Action: http://www.manning.com/ibsen



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Mime
View raw message