Return-Path: Delivered-To: apmail-incubator-cxf-dev-archive@locus.apache.org Received: (qmail 29858 invoked from network); 16 Dec 2006 14:41:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Dec 2006 14:41:48 -0000 Received: (qmail 17113 invoked by uid 500); 16 Dec 2006 14:41:39 -0000 Delivered-To: apmail-incubator-cxf-dev-archive@incubator.apache.org Received: (qmail 17073 invoked by uid 500); 16 Dec 2006 14:41:39 -0000 Mailing-List: contact cxf-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-dev@incubator.apache.org Received: (qmail 17064 invoked by uid 99); 16 Dec 2006 14:41:39 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Dec 2006 06:41:39 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [66.249.82.229] (HELO wx-out-0506.google.com) (66.249.82.229) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Dec 2006 06:41:28 -0800 Received: by wx-out-0506.google.com with SMTP id i26so972353wxd for ; Sat, 16 Dec 2006 06:41:07 -0800 (PST) Received: by 10.90.69.8 with SMTP id r8mr2104911aga.1166280057519; Sat, 16 Dec 2006 06:40:57 -0800 (PST) Received: by 10.90.63.10 with HTTP; Sat, 16 Dec 2006 06:40:57 -0800 (PST) Message-ID: <7b774c950612160640j30835f9fi141705d037f4800a@mail.gmail.com> Date: Sat, 16 Dec 2006 15:40:57 +0100 From: "Dan Diephouse" To: cxf-dev@incubator.apache.org Subject: Re: CodeFirstTest [was Re: FW: Java first question] In-Reply-To: <9A4696F35B459043970EE4A85A317390066806@amer-ems1.IONAGLOBAL.COM> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_133740_10988608.1166280057380" References: <9A4696F35B459043970EE4A85A317390066806@amer-ems1.IONAGLOBAL.COM> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_133740_10988608.1166280057380 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Jervis, Comments inline... On 12/13/06, Liu, Jervis wrote: > > Hi, I am trying to understand how the code first approach works on a > client side. Presumably what the code first implies on a client side is that > we can not do any code generation from WSDL, and users shall already have an > object model in place. What I mean by the object model is the user defined > types, such as Person, Address etc. It can be written manually in POJO or > can be generated previously from JAXB, xmlbean etc. So my question is how > user defined types are supported, more precisely, how code first works under > following scenarios: > > A. Code first client with an object model written in JAXB: In order to do > the marshal/unmarshal for user defined types, we can either provide the JAXB > context with the location of these type classes or provide JAXB with the > schema file. In the latter case, the schema file can be the WSDL published > on the server side. Currently JAXB types are loaded from the service model. See JAXBContextInitializer. We basically loop over every MessagePartInfo and add the class to the context. If its a List, we change it to any array type. I'm not sure what you mean by providing JAXB with a schema file... can you explain? B. Code first client with an object model written in xmlbean or other data > bindings: This should be same as JAXB case, so it should work (CXF needs to > support multiple data bindings both in tooling and runtime though). Databindings are initialized in Databinding.initialize(). In the JAXB case (both server and client), the context is set up via the JAXBContextInitializer. Then the service model is updated with JAXB info ( i.e. MessagePartInfo.typeName/elementName) with the JAXBServiceModelInitializer. C. Code first client with user defined types written in POJO: I don't think > this works, right? At least our current javatowsdl tool does not work with > user defined POJO types. This works fine with the servicemodel. It uses the same process as the above... BTW, why JAXB does not support List by default? I read the JAXB spec, it > says the java.util.List must be supported. Is this a JAXB implementation > issue? > > No idea... I'm just telling you what Koshuke (JAXB author) told me... Cheers, - Dan -- Dan Diephouse Envoi Solutions http://envoisolutions.com | http://netzooid.com/blog ------=_Part_133740_10988608.1166280057380--