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 8C9C99988 for ; Wed, 12 Nov 2014 14:57:26 +0000 (UTC) Received: (qmail 78093 invoked by uid 500); 12 Nov 2014 14:57:13 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 78044 invoked by uid 500); 12 Nov 2014 14:57:13 -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 78028 invoked by uid 99); 12 Nov 2014 14:57:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Nov 2014 14:57:12 +0000 X-ASF-Spam-Status: No, hits=0.2 required=5.0 tests=PLING_QUERY,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.192.42] (HELO mail-qg0-f42.google.com) (209.85.192.42) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Nov 2014 14:56:47 +0000 Received: by mail-qg0-f42.google.com with SMTP id i50so9059288qgf.1 for ; Wed, 12 Nov 2014 06:56:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=altiuz.cl; s=google; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=+3DUb7CdhNl6goI0KfvRjSGkjU7GZrmf/ZUrVduutSE=; b=RFiZG2hRAPk50oNsYPtfOoJ9B6bCpnKzq0AKkxSdQU3Kea9V/ZbXRhsPw80JoXfKDX kUWeTYxd2NfZ7BdKI2BrUN8VoVhGV5gq8voumjI9mQ9U6Ohqn7Z4QG9lkKmo4lA46psA J1j3PgYXIdXqsTVwvNjMMTBbpV77f/7et7o+s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:content-transfer-encoding:message-id:references:to; bh=+3DUb7CdhNl6goI0KfvRjSGkjU7GZrmf/ZUrVduutSE=; b=RybzvgrkxEPsAhbS3e+t9gA9XemVbgfV59ZZiUu/V/az5D7p0sYvSOrldutoTcIwJd NLJnv0BVIvmXPXMz/dZEKigOmjYAyrKRCAMZaAOKGXXnJxwWvrlevf2JgUvqpoBIeps2 KyNBXJzU4fnjGkCkw8IOzdhCeoJ9WlrALwzlYMu4TiBcxFV/jYqtyXt92gm/IEnE2Day uKVjidJADOO22ehxo7RyIkD+ocLnKHsvNX5Uufjn7LJypomEbGMuAg1QGNM6lCUhovGV LmqocKEkAdfHUT0O+yYKKbRSPefp3muUWi8YB4sNYQ6ZKn6ezSsBm4YQzDZwlgMhOIH7 3LAQ== X-Gm-Message-State: ALoCoQnCITwGzXIl79rpNTXiHEGdpwcoSmcdu8511Z44RW2rQlRkZZg2KkpvlEZcsihseviAbWjd X-Received: by 10.140.91.245 with SMTP id z108mr48356323qgd.5.1415804205572; Wed, 12 Nov 2014 06:56:45 -0800 (PST) Received: from [192.168.10.164] ([186.67.51.53]) by mx.google.com with ESMTPSA id w9sm21227973qaw.9.2014.11.12.06.56.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Nov 2014 06:56:44 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: xmlsecurity endpoint output not "lasting"!?!?!? From: Gonzalo Vasquez In-Reply-To: Date: Wed, 12 Nov 2014 11:56:36 -0300 Content-Transfer-Encoding: quoted-printable Message-Id: <0AE001E6-6386-4720-AFEF-54DAE094B9ED@altiuz.cl> References: <14C09C44-915E-4E69-9B49-7AAC2D8C3548@altiuz.cl> To: users@camel.apache.org X-Mailer: Apple Mail (2.1878.6) X-Virus-Checked: Checked by ClamAV on apache.org Willem, Switching to 2.15-SNAPSHOT made my day, as it provides support for the = parentXpath parameter in the xmlsecurity endpoint. Although = documentation is not correct as it says that the parentXpath has a = String argument, it's not correct, as it expects a = javax.xml.crypto.dsig.spec.XPathFilterParameterSpec parameter, that can = be instantiated using something like: And the later referenced using the pound sign (#) in the endpoint = declaration as in: Using this parameter I no longer need to create nor a dynamic endpoint, = nor a choice/when condition, so I've managed to implement a workaround = for the reported issue. If I happen to have sometime I'll make a test = case and submit it to Jira. Regards, Gonzalo V=C3=A1squez S=C3=A1ez Gerente Investigaci=C3=B3n y Desarrollo (R&D) Altiuz Soluciones Tecnol=C3=B3gicas de Negocios Ltda. Av. Nueva Tajamar 555 Of. 802, Las Condes - CP 7550099 +56 2 335 2461 gvasquez@altiuz.cl http://www.altiuz.cl http://www.altiuzreports.com =20 El 12-11-2014, a las 7:46, Willem Jiang = escribi=C3=B3: > Here are some information about it. > If you can still reproduce the error, you can create a JIRA[2] and = submit a small test case for it. >=20 >=20 > [1]http://camel.apache.org/maven-2-snapshot-repository-in-pom.html > [2]http://issues.apache.org/jira/browse/CAMEL >=20 > -- =20 > Willem Jiang >=20 > Red Hat, Inc. > Web: http://www.redhat.com > Blog: http://willemjiang.blogspot.com (English) > http://jnn.iteye.com (Chinese) > Twitter: willemjiang =20 > Weibo: =E5=A7=9C=E5=AE=81willem >=20 >=20 >=20 > On November 12, 2014 at 6:03:45 PM, Gonzalo Vasquez = (gvasquez@altiuz.cl) wrote: >> Hi, I'm using 2.14.0, as I haven't been able to find a newer with = Maven, is >> there a special repository for snapshots? >>=20 >> On Wednesday, November 12, 2014, Willem Jiang =20 >> wrote: >>=20 >>> Hi >>>=20 >>> Which version of Camel are you using? >>> I cannot reproduce the error with Apache Camel master branch (Camel >>> 2.15-SNAPSHOT). >>>=20 >>> Regards, >>>=20 >>> -- >>> Willem Jiang >>>=20 >>> Red Hat, Inc. >>> Web: http://www.redhat.com >>> Blog: http://willemjiang.blogspot.com (English) >>> http://jnn.iteye.com (Chinese) >>> Twitter: willemjiang >>> Weibo: =E5=A7=9C=E5=AE=81willem >>>=20 >>>=20 >>>=20 >>> On November 12, 2014 at 6:20:13 AM, Gonzalo Vasquez = (gvasquez@altiuz.cl >>> ) wrote: >>>> Hi everybody, >>>>=20 >>>> I'm having trouble with the output of the xmlsecurity endpoint. I >>> suppose the obvious >>>> is to get the signed xml as in the body of the next endpoint, but = it >>> seems a bit odd that it's >>>> only kept as is if where a "local variable" as used in formal >>> programming languages, such >>>> as variables defined in if/while/for loops, and no longer exists = upon >>> exit. >>>>=20 >>>>=20 >>>> Have I been clear of what is happening, or am I too messy in the >>> explanation? >>>>=20 >>>> What I need is to use an endpoint such as: >>>>=20 >>>>> /> >>>>=20 >>>>=20 >>>>=20 >>>> As I need a flexible parentLocalName, I've tried two approaches: >>>>=20 >>>>=20 >>>>=20 >>> = xmlsecurity:sign://enveloped?keyAccessor=3D#keyAccessor&parentLocalName=3D= ${in.header.rootName} =20 >>>>=20 >>>>=20 >>>> And: >>>>=20 >>>>=20 >>>>=20 >>>>=20 >>>> ${in.header.rootName} =3D=3D 'factura' >>>>=20 >>>>>=20 >>> = uri=3D"xmlsecurity:sign://enveloped?keyAccessor=3D#keyAccessor&parentLocal= Name=3Dfactura" =20 >>>> /> >>>>=20 >>>>=20 >>>>=20 >>>>=20 >>>>=20 >>>> ${in.header.rootName} =3D=3D 'notaDebito' >>>>=20 >>>>>=20 >>> = uri=3D"xmlsecurity:sign://enveloped?keyAccessor=3D#keyAccessor&parentLocal= Name=3DnotaDebito" =20 >>>> /> >>>>=20 >>>>=20 >>>>=20 >>>>=20 >>>>=20 >>>> ${in.header.rootName} =3D=3D 'comprobanteRetencion' >>>>=20 >>>>>=20 >>> = uri=3D"xmlsecurity:sign://enveloped?keyAccessor=3D#keyAccessor&parentLocal= Name=3DcomprobanteRetencion" =20 >>>> /> >>>>=20 >>>>=20 >>>>=20 >>>>=20 >>>>=20 >>>> The first approach is the one I prefer, but it doesn't actually = work as >>> expected as the >>>> outside the "recipientList" the output body is the same as the = input >>> (i.e. no Signature >>>> node), but within the receipientList I can get the correctly signed >>> content. >>>>=20 >>>> Although the second approach works, it's really messy because = there's >>> too much duplicate >>>> code due to the same problem described before, as also the signed >>> content (body) is only >>>> present within the when tags, and not on the outside/end of the = whole >>> choice tag. >>>>=20 >>>> A workaround would be to redirect inside the recipientList to = another >>> route using a direct >>>> uri, but my doubt is if this is a bug in the xmlsecurity endpoint, = am I >>> doing something wrong >>>> or something else? >>>>=20 >>>> Attached is the whole spring/camel xml file for you to review. >>>>=20 >>>> Regards, >>>> Gonzalo V=C3=A1squez S=C3=A1ez >>>> Gerente Investigaci=C3=B3n y Desarrollo (R&D) >>>> Altiuz Soluciones Tecnol=C3=B3gicas de Negocios Ltda. >>>> Av. Nueva Tajamar 555 Of. 802, Las Condes - CP 7550099 >>>> +56 2 335 2461 >>>> gvasquez@altiuz.cl =20 >>>> http://www.altiuz.cl >>>> http://www.altiuzreports.com >>>>=20 >>>>=20 >>>>=20 >>>=20 >>>=20 >>=20 >=20