PDA

View Full Version : spring-ws-1.0-m2 airline sample



jwoolf330
Oct 13th, 2006, 01:18 AM
Hi-

I just downloaded spring-ws-1.0-m2-full.zip and while going through the airline sample code noticed that the package (and classes within) org.springframework.ws.samples.airline.schema and org.springframework.ws.samples.airline.schema.Impl are missing. FYI.

Also, the class org.springframework.ws.samples.airline.ws.GetFligh tsEndpoint (well, the entire application) uses separate POJOs for the schema and the domain objects. It's not an architectural decision I have considered before. Can someone explain the pros of this approach over straight mapping of the domain objects? Is it a function of the XML binding framework being used?

In advance, thanks a bunch.

Best,
John

Arjen Poutsma
Oct 13th, 2006, 02:51 AM
I just downloaded spring-ws-1.0-m2-full.zip and while going through the airline sample code noticed that the package (and classes within) org.springframework.ws.samples.airline.schema and org.springframework.ws.samples.airline.schema.Impl are missing. FYI.


Yes, these are generated by the build from the xsd schema.


Also, the class org.springframework.ws.samples.airline.ws.GetFligh tsEndpoint (well, the entire application) uses separate POJOs for the schema and the domain objects. It's not an architectural decision I have considered before. Can someone explain the pros of this approach over straight mapping of the domain objects? Is it a function of the XML binding framework being used?


This is by design. The danger about using your domain objects in the web service interface is that you're making them part of a public interface. That basically means that you cannot change them without changing the contract of the web service.

So, by separating the public contract from the internal workings, you can change the two independently.

jwoolf330
Oct 13th, 2006, 09:04 AM
Thank you, Arjen.

Whenkatz
Dec 29th, 2006, 03:31 AM
Yes, these are generated by the build from the xsd schema.



This is by design. The danger about using your domain objects in the web service interface is that you're making them part of a public interface. That basically means that you cannot change them without changing the contract of the web service.

So, by separating the public contract from the internal workings, you can change the two independently.
Hi Arjen,

I can't use Maven in my work environment. I tired using the XJC utility from JAXB, to generate the required source files from the airline.xsd . It did not generate the Impl files for some reason. I would appriciate it if could you help me out on this.

By the way i am trying to run this example from within Eclipse.

Thanks
-Venkatesh

Whenkatz
Dec 29th, 2006, 06:41 AM
Ok. I found the problem... I was using jaxb 2.0. The required files were generated when i used the 1.6 version.