File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes  JAX WS marshalling, Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark " JAX WS marshalling," Watch " JAX WS marshalling," New topic

JAX WS marshalling,

John Bates

Joined: May 31, 2012
Posts: 9
I am developing web service using JAX WS,
my coursework is to utilise web services to compose a travel agency. The travel agency consists of three independent services: flight booking, hotel reservation, and currency conversion. i will build the first two application services by myself but i should consume a publically available service for currency conversion.

My issue is getting the flight information from java objects to xml document,
would you please hlp me in this issue,

Thanks for your time.
Chao Fan,

@WebMethod(operationName = “Flightfile”)
public Boolean CreateItinerary() {
Flights ss = new Flights();
List newSegments = (List) setSegments.getFlightSegments();
ss toflights;
toflights = new ss();
toflights.setAirline(“American Airlines”);
toflights.setOriginCity(“long beach”); toflights.setDestinationCity(“aus islands”);
try {
javax.xml.bind.JAXBContext jaxbCtx =
javax.xml.bind.Marshaller marshaller = jaxbCtx.createMarshaller();
marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_ENCODING, “UTF-8″); //NOI18N
marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
File flightstore = new File(“file.xml”);
marshaller.marshal(ss, flightstore);
James Boswell

Joined: Nov 09, 2011
Posts: 1051

You need to provide more information here. Simply saying you have an issue is not very helpful.
Consider Paul's rocket mass heater.
subject: JAX WS marshalling,
It's not a secret anymore!