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 <[email protected]>: > What is the use-case for setting the body as null ? > > On Mon, Nov 18, 2013 at 11:59 AM, Aki Yoshida <[email protected]> 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: [email protected] > Twitter: davsclaus > Blog: http://davsclaus.com > Author of Camel in Action: http://www.manning.com/ibsen
