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. 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). 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. 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? Thanks, Jervis > -----Original Message----- > From: Johnson, Eric [mailto:[EMAIL PROTECTED] > Sent: Tuesday, December 12, 2006 10:38 PM > To: [email protected] > Subject: RE: CodeFirstTest [was Re: FW: Java first question] > > > My simple test case involved a class with three fields: two > strings and > float. The consumer and service both run like a charm except that the > object returned to the consumer mainline is empty.... It is > instantiated > but has no data. > The response sent by the service impl does have data in it... > > > -----Original Message----- > > From: Willem Jiang [mailto:[EMAIL PROTECTED] > > Sent: Monday, December 11, 2006 9:06 PM > > To: [email protected] > > Subject: Re: CodeFirstTest [was Re: FW: Java first question] > > > > Hi Dan, > > > > That comes to my question. If there are some complex types > > used in SEI's method, and they can not be handled by JAXB > by default. > > How can we make sure the JAXB can make the xml marshal and > > unmarshal right without get the type info from the SEI's annotation? > > > > Willem. > > > > Dan Diephouse wrote: > > > > > No, JAXB can't deal with List<String> - but you can make > it work. I > > > managed to have it working at one point. Its a hack. You need to > > > convert it to an array and tell JAXB that the type class is > > String[]. > > > I will look at the test and see if I can get it working again... > > > > > > - Dan > > > > > > On 12/12/06, Willem Jiang <[EMAIL PROTECTED]> wrote: > > > > > >> > > >> Hi Dan, > > >> > > >> You can take a look at the test which I add for the > CodeFirstTest > > >> client side test. > > >> It is org.apache.cxf.jaxws.CodeFirstTest.testClient(), I > commented > > >> the last 2 line codes which can not work yet. > > >> AFAIK, JAXB can't deal with the List<string> as default. > > >> Can you point out what else I should do to make the test work? > > >> > > >> Regards, > > >> > > >> Willem. > > >> > > >> Dan Diephouse wrote: > > >> > > >> > Hi Willem, > > >> > > > >> > Sorry for the delayed response. Can you explain more > > what you mean > > >> > or give an example? I'm not sure I understand. > > >> > Thanks, > > >> > - Dan > > >> > > > >> > On 12/7/06, Willem Jiang <[EMAIL PROTECTED]> wrote: > > >> > > > >> >> > > >> >> Hi Eric and Dan, > > >> >> > > >> >> I wrote a unit test in the CodeFirstTest, and found > that in code > > >> first > > >> >> mode the client side can't deal with the complex type > result or > > >> >> parameters' marshal and unmarshal. > > >> >> > > >> >> Eric , IMO the WSDL first option could be the best solution. > > >> >> > > >> >> Dan , I have no ideal about how to build up the type > > info (for XML > > >> >> marshal an unmarshal) in the parameters without read > annotation > > >> >> from SEI, Can you point it out? > > >> >> > > >> >> Cheers, > > >> >> > > >> >> Willem. > > >> >> > > >> > > >> > > > > > > > > > > >
