Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D146E264A for ; Sun, 1 May 2011 15:35:36 +0000 (UTC) Received: (qmail 85907 invoked by uid 500); 1 May 2011 15:35:36 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 85868 invoked by uid 500); 1 May 2011 15:35:35 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 85860 invoked by uid 99); 1 May 2011 15:35:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 May 2011 15:35:35 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of marco2008@gmx.com designates 213.165.64.42 as permitted sender) Received: from [213.165.64.42] (HELO mailout-eu.gmx.com) (213.165.64.42) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 01 May 2011 15:35:27 +0000 Received: (qmail 17196 invoked by uid 0); 1 May 2011 15:35:05 -0000 Received: from 87.0.7.240 by rms-eu009.v300.gmx.net with HTTP Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" Date: Sun, 01 May 2011 15:35:04 +0000 From: "Marco Rossi" Message-ID: <20110501153504.35590@gmx.com> MIME-Version: 1.0 Subject: REST web service - multiple parametes To: "Camel User" X-Authenticated: #115773404 X-Flags: 0001 X-Mailer: GMX.com Web Mailer x-registered: 0 X-GMX-UID: zQzUIpU1MydhEIvajGxlKe5jaGRhZprm X-Virus-Checked: Checked by ClamAV on apache.org Hi all,  I'm creating a RESTful web service, but I don't understand how to manage multiple parameters in the exchange message. My idea is that if multiple parameters are passed to the service, I can find some sort of hashmap, indexed by parameter name, in the body of the message created by the REST endpoint, but this doesn't happen. Reading from the source code, method org.apache.camel.component.cxf.jaxrs.DefaultCxfRsBinding.populateExchangeFromCxfRsRequest(...), I see that a "Object[] paramArray" (that has only parameters values and not names) is saved in the message body with "camelMessage.setBody(new MessageContentsList(paramArray))". Am I missing something or multiple parameters are really passed as *positional* parameter of an Object[] array? I'm using Camel 2.7.1 with the following definition (I've pasted only the relevant portion) @Provider @Produces("application/json") public class DocumentListRest  {  @GET  @Path("/document/{userId}/{documentId}")  public Document getDocument(@PathParam("userId") long userId, @PathParam("documentId") long documentId) {    return null;  // Is it ok if I return null?  } } my Spring configuration is: [...]                        ${in.header.operationName} == 'getDocument'  [...]   Tracing gave me the follwing output: (route1) from(cxfrs://bean:rsServer) --> choice <<< Pattern:InOut, Headers:{CamelAcceptContentType=*/*, Content-Type=null, Accept=*/*, CamelHttpUri=/server/document/23/234, CamelHttpMethod=GET, connection=Keep-Alive, CamelCxfRsResponseClass=class xxx.yyy.bean.Document, CamelCxfRsOperationResourceInfoStack=[org.apache.cxf.jaxrs.model.MethodInvocationInfo@3b48a8e6], CamelHttpPath=document/23/234, user-agent=Wget/1.12 (linux-gnu), operationName=getDocument, CamelCxfRsResponseGenericType=class xxx.yyy.bean.Document, host=localhost:8080}, BodyType:org.apache.cxf.message.MessageContentsList, Body:23 Thanks, Marco