Thanks Dan and Christian for the responses. Christian: So from your email, I gather that use some sort of dto instead of the actual domain object. However, let's say the the domain object changes due to some user requirements, now won't my dto also change beacause I may have to send extra data (again off the user requirement) requiring the clients to change their code in this scenario? for example, say Employee has name, id and so does EmployeeTransfer object. Now changing EmployeeTransfer class to include age attribute will still require me to change the wsdl, won't it? In this case, I would think I will have to publish a new version of the earlier service....
Regards, Ben On Thu, Jun 12, 2008 at 2:50 PM, Christian Schneider < [EMAIL PROTECTED]> wrote: > Hi Ben, > > if you plan to use your domain object in a public service you should be > carefull. Directly using the object means you will be quite constrained in > changing it later. It is quite normal for a domain object to change when > your users needs change. With a object that is published in a service this > is quite different. When you have many clients for the service you can not > simply change the object from one day to another as the clients will need > time to do the change in their code. So it can be a very good idea to use > separate data transfer objects even if they mean more effort. If you simply > use the webservice to talk from client to server in one application you can > safely use your domain objects as you control both sides. > > Best regards > > Christian > > Ben Berner schrieb: > > I have generated my domain classes (with middlegen tool for hibernate) and >> there is a operation in my wsdl document that returns a domain object >> (e.g. >> Employee), so I have to define that domain object as a port-type >> (<xs:complexType name="employee">...</>)in the wsdl document. Now when I >> run wsdl2java, won't this overwrite my pre-existing domain class >> (Employee.java, that has been decorated with annotations for persistence >> by >> hibernate), as wsdl2java will generate this type when going contract first >> development? Or is there a way, I can ask wsdl2java not to generate that >> particular domain object and just reuse the existing class? >> >> Regards, >> Ben >> >> >> > >
