public static void Main(string[] args) { AirlineService service = new AirlineService(); service.Url = "http://localhost:8080/airline/Airline"; if (args.Length > 0) { service.Url = args[0]; } else { service.Url = "http://localhost:8080/airline/Airline"; } MessageGetFlightsRequest getFlightsRequest = new MessageGetFlightsRequest(); getFlightsRequest.startOfPeriod = new DateTime(2006, 1, 31); getFlightsRequest.startOfPeriodSpecified = true; Console.WriteLine("Requesting flights after {0:d}", getFlightsRequest.startOfPeriod); Flight[] flights = service.GetFlights(getFlightsRequest); Console.WriteLine("Got {0} results", flights.Length); foreach (Flight flight in flights) { Console.WriteLine("Booking ticket for flight with number {0}", flight.number); MessageBookFlightRequest bookFlightRequest = new MessageBookFlightRequest(); bookFlightRequest.flightNumber = flight.number; bookFlightRequest.customerId = 1L; Ticket ticket = service.BookFlight(bookFlightRequest); WriteTicket(ticket); } }
public Flight[] GetFlights([System.Xml.Serialization.XmlElement(Namespace = "http://www.springframework.org/spring-ws/samples/airline")] MessageGetFlightsRequest GetFlightsRequest) { object[] results = this.Invoke("GetFlights", new object[] { GetFlightsRequest }); return((Flight[])(results[0])); }
public System.IAsyncResult BeginGetFlights(MessageGetFlightsRequest GetFlightsRequest, System.AsyncCallback callback, object asyncState) { return(this.BeginInvoke("GetFlights", new object[] { GetFlightsRequest }, callback, asyncState)); }