This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
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


JavaRanch » Java Forums » Java » Web Services
Bookmark " JAX WS marshalling," Watch " JAX WS marshalling," New topic
Author

JAX WS marshalling,

John Bates
Greenhorn

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.JAXBContext.newInstance(ss.getClass().getPackage().getName());
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
Bartender

Joined: Nov 09, 2011
Posts: 1025
    
    5

You need to provide more information here. Simply saying you have an issue is not very helpful.
 
GeeCON Prague 2014
 
subject: JAX WS marshalling,