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 D4A149633 for ; Mon, 16 Apr 2012 17:33:33 +0000 (UTC) Received: (qmail 88471 invoked by uid 500); 16 Apr 2012 17:33:33 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 88387 invoked by uid 500); 16 Apr 2012 17:33:33 -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 88379 invoked by uid 99); 16 Apr 2012 17:33:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Apr 2012 17:33:33 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of atgroxx@gmail.com designates 209.85.210.52 as permitted sender) Received: from [209.85.210.52] (HELO mail-pz0-f52.google.com) (209.85.210.52) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Apr 2012 17:33:25 +0000 Received: by dake40 with SMTP id e40so9082430dak.25 for ; Mon, 16 Apr 2012 10:33:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=NoxHc6zz04MwJptK41gNOuj/Po/v8NrQtXozO0kcpLI=; b=PGx0mTz2APbkTrucS4lyRIDQmh96nCl9BpPBRMGzRCsrXSBUtWNVVQfgVm3AtJEhY4 6jGdQ+HE45QgbDGqmfyoSAnC5TXbxPn3FOHoGIQHp4dxhumGQ/cGfB4OzTv5QG49xzfJ jWtGuKSggkF92CoyGGQ70TDw2V6Bcoow4xAOtqOZg/CrnGLxJtGuEOmUGq5qzLaEbYns S1TwVZH2ozsbUMMPRPGImnASCIilX14aS1llUUD90rzUdRcJtm8U8vJuGztViUziX0vm 77VEj9XQA0OgyiqU4EgBnu3/OJNdU2C70IhBgmwkp/XBf4wBtFl0BVhjyKz/kY4M8hOR HZZg== MIME-Version: 1.0 Received: by 10.68.213.41 with SMTP id np9mr29285849pbc.85.1334597584297; Mon, 16 Apr 2012 10:33:04 -0700 (PDT) Received: by 10.68.12.232 with HTTP; Mon, 16 Apr 2012 10:33:04 -0700 (PDT) In-Reply-To: References: Date: Mon, 16 Apr 2012 18:33:04 +0100 Message-ID: Subject: Re: Camel Jaxb- Not able to unmarshall a xml From: atg roxx To: users@camel.apache.org Content-Type: multipart/alternative; boundary=e89a8ff1bfa8ee1f7b04bdcf36cf --e89a8ff1bfa8ee1f7b04bdcf36cf Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Chirstian, After making all the changes suggested by you. Everything is working fine. But I have some issue here. I have to go and add namespace at each and every variable of the generated classes. This is big pain. Also if the wsdl get changed then then this process of adding name space at each and every element has to be repeated again. Is there any work around for this. -cheers, atg roxx On Mon, Apr 16, 2012 at 5:56 PM, atg roxx wrote: > Hi Christian, > > I got the solution for the previous question asked by me : > > You have to simply add the following in the package-info.java > > @javax.xml.bind.annotation.XmlSchema(namespace =3D " > http://www.camel.apache.org/jaxb/example/order/1" , > > xmlns =3D { > @XmlNs(namespaceURI =3D " http://www.camel.apache.org/jaxb/example/order/= 1 ", > prefix =3D "ns1"), > @XmlNs(namespaceURI =3D http://www.camel.apache.org/jaxb/example/address= /1 ", > prefix =3D "ns2") > }, > elementFormDefault =3D javax.xml.bind.annotation.XmlNsForm.QUALIFIED) > } > > > > -cheers, > atg roxx > > On Mon, Apr 16, 2012 at 4:32 PM, atg roxx wrote: > >> Hi Christian, >> >> Thansk for the link. >> >> I run the test case given by you. It works fine but >> >> while marshalling I can see the below xml and if you notice we dont hav= e >> namespace for or element. >> >> >> >> > xmlns:ns2=3D"http://www.camel.apache.org/jaxb/example/address/1"> >> 1 >> >> Main Street >> 3a >> 65843 >> Sulzbach >> >> >> >> -cheers, >> atg roxx >> >> On Mon, Apr 16, 2012 at 4:02 PM, Christian M=FCller < >> christian.mueller@gmail.com> wrote: >> >>> It's in SVN: >>> >>> https://svn.apache.org/repos/asf/camel/trunk/components/camel-jaxb/src/= test/java/org/apache/camel/example/ >>> >>> Best, >>> Christian >>> >>> On Mon, Apr 16, 2012 at 11:41 AM, atg roxx wrote: >>> >>> > Hi Christian, >>> > >>> > Could you please provide the code for the Order and Address class. >>> > >>> > >>> > -Regards, >>> > atg roxx >>> > >>> > On Sun, Apr 15, 2012 at 12:37 PM, Christian M=FCller < >>> > christian.mueller@gmail.com> wrote: >>> > >>> > > The interesting part is how do you define the >>> > > "jaxbGetProductPriceOffersRequest"? >>> > > However, I added a unit test to make sure it works and to show how >>> [1]. I >>> > > hope with this example you are able to solve your issue. >>> > > >>> > > [1] >>> > > >>> > > >>> > >>> https://svn.apache.org/repos/asf/camel/trunk/components/camel-jaxb/src/= test/java/org/apache/camel/converter/jaxb/JaxbDataFormatMultipleNamespacesT= est.java >>> > > >>> > > Best, >>> > > Christian >>> > > >>> > > On Fri, Apr 13, 2012 at 5:11 PM, atg roxx wrote= : >>> > > >>> > > > Hi Arnaud, >>> > > > >>> > > > Yes we have different namespace for GetProductPriceOffers and >>> > > > partner/request element also the classes corresponding to them ha= ve >>> > their >>> > > > respective namespace. >>> > > > >>> > > > Still I am not able unmarshall. >>> > > > >>> > > > My Camel Version is 2.8.2 >>> > > > I am doing marshalling and unmarshalling in the following way: >>> > > > from(Constants.ROUTE_GETPRODUCTPRICEOFFERS) >>> > > > .to(Constants.LOG_IN_INFO_WITH_HEADERS) >>> > > > .convertBodyTo(String.class) >>> > > > .unmarshal(jaxbGetProductPriceOffersRequest) >>> > > > .to(Constants.LOG_IN_INFO_WITH_HEADERS) >>> > > > .marshal(jaxbGetProductPriceOffersRequest) >>> > > > .log("after marshalling") >>> > > > .to(Constants.LOG_IN_INFO_WITH_HEADERS) >>> > > > .process(new MondialRequestProcessor(userId, password)) >>> > > > .log("Finished processing >>> > > > >>> "+MondialConstants.GETPRODUCTPRICEOFFERS+Constants.LOG_CORRELATIONID); >>> > > > >>> > > > >>> > > > --cheers, >>> > > > atg roxx >>> > > > On Fri, Apr 13, 2012 at 12:20 PM, DEPREZ Arnaud AWL-IT < >>> > > > arnaud.deprez@atos.net> wrote: >>> > > > >>> > > > > Maybe it's a problem of namespaces. >>> > > > > >>> > > > > Can you tell me if you use different namespaces for >>> > > GetProductPriceOffers >>> > > > > and partner/request element ? >>> > > > > If they are different, it must be specified in your JAXB java >>> class >>> > > > model. >>> > > > > >>> > > > > KR, >>> > > > > >>> > > > > Arnaud Deprez >>> > > > > >>> > > > > >>> > > > > -----Original Message----- >>> > > > > From: Christian M=FCller [mailto:christian.mueller@gmail.com] >>> > > > > Sent: vendredi 13 avril 2012 12:58 >>> > > > > To: users@camel.apache.org >>> > > > > Subject: Re: Camel Jaxb- Not able to unmarshall a xml >>> > > > > >>> > > > > Which version of Camel do you use? >>> > > > > How do you use the JAXB Marschaller/Unmarschaller (explicitly o= r >>> via >>> > > the >>> > > > > FallbackTypeConverter)? >>> > > > > Could you share your code? >>> > > > > >>> > > > > Best, >>> > > > > Christian >>> > > > > >>> > > > > Sent from a mobile device >>> > > > > Am 13.04.2012 12:45 schrieb "atg roxx" : >>> > > > > >>> > > > > > Hi Guys, >>> > > > > > >>> > > > > > I am facing a problem. >>> > > > > > >>> > > > > > I am using camel jaxb to marshall and unmarshall java objects >>> which >>> > > is >>> > > > > > working fine for me till now. >>> > > > > > But now I got a special case where I am not able to properly >>> > > unmarshall >>> > > > > an >>> > > > > > xml whose class have mulitple namespace (different for root >>> element >>> > > and >>> > > > > sub >>> > > > > > elements). >>> > > > > > >>> > > > > > sample xml : >>> > > > > > >>> > > > > > Class corresponding to each is having different >>> > namespace. >>> > > > > > >>> > > > > > I am using JaxbDataFormat for this unmarshalling and setting >>> the >>> > > > > partclass >>> > > > > > name to the root element. >>> > > > > > >>> > > > > > >>> > > > > > >>> > > > > > abc >>> > > > > > xyz >>> > > > > > >>> > > > > > >>> > > > > > >>> > > > > > >>> > > > > > >>> > > > > > >>> > > > > > GB >>> > > > > > >>> > > > > > GB >>> > > > > > >>> > > > > > Sample Hotel Chain >>> > > > > > 2011-08-19T04:55:02-04:00 >>> > > > > > >>> 2011-08-24T04:55:02-04:00 >>> > > > > > Mariott >>> > > > > > 5 >>> > > > > > 1 >>> > > > > > 0 >>> > > > > > 0 >>> > > > > > 1 >>> > > > > > 0 >>> > > > > > 2 >>> > > > > > >>> > > > > > >>> > > > > > >>> > > > > > >>> > > > > > >>> > > > > > >>> > > > > > I am able to unmarshall it but when i check the object >>> created, I >>> > > found >>> > > > > > that the and object are not set to values >>> in >>> > the >>> > > > xml >>> > > > > > but are set to null. >>> > > > > > >>> > > > > > >>> > > > > > Could anyone let me know what can be the issue or how to >>> resolve >>> > > this . >>> > > > > > >>> > > > > > >>> > > > > > --cheers, >>> > > > > > atg roxx >>> > > > > > >>> > > > > >>> > > > > >>> > > > > Atos Worldline SA/NV - Chaussee de Haecht 1442 Haachtsesteenweg >>> > > > > - 1130 Brussels - Belgium >>> > > > > RPM-RPR Bruxelles-Brussel - TVA-BTW BE 0418.547.872 >>> > > > > Bankrekening-Compte Bancaire-Bank Account 310-0269424-44 >>> > > > > BIC BBRUBEBB - IBAN BE55 3100 2694 2444 >>> > > > > >>> > > > > "The information contained in this e-mail and any attachment >>> thereto >>> > is >>> > > > > confidential and may contain information which is protected by >>> > > > intellectual >>> > > > > property rights. >>> > > > > This information is intended for the exclusive use of the >>> > recipient(s) >>> > > > > named above. >>> > > > > This e-mail does not constitute any binding relationship or off= er >>> > > toward >>> > > > > any of the addressees. >>> > > > > If you are not one of the addressees , one of their employees o= r >>> a >>> > > proxy >>> > > > > holder entitled to hand over this message to the addressee(s), >>> any >>> > use >>> > > of >>> > > > > the information contained herein (e.g. reproduction, divulgatio= n, >>> > > > > communication or distribution,...) is prohibited. >>> > > > > If you have received this message in error, please notify the >>> sender >>> > > and >>> > > > > destroy it immediately after. >>> > > > > The integrity and security of this message cannot be guaranteed >>> and >>> > it >>> > > > may >>> > > > > be subject to data corruption, interception and unauthorized >>> > amendment, >>> > > > for >>> > > > > which we accept no liability." >>> > > > > >>> > > > > >>> > > > >>> > > >>> > >>> >> >> > --e89a8ff1bfa8ee1f7b04bdcf36cf--