@Test public void testBook() { assertThat(bookReservationClient.reserveBook(1L), notNullValue()); }
public Reservation reserveBook(long bookId) { StreamSource source = new StreamSource(new StringReader(MESSAGE)); JDOMResult jdomResult = new JDOMResult(); webServiceTemplate.sendSourceAndReceiveToResult(source, jdomResult); Document document = jdomResult.getDocument(); Element reservationElement = document.getRootElement(); Long reservationId = Long.valueOf(reservationElement.getChild("reservationId",namespace).getValue()); Long bookIdRet = Long.valueOf(reservationElement.getChild("bookId",namespace).getValue()); ReservationImpl reservationImpl = new ReservationImpl(); reservationImpl.setBookId(bookIdRet); reservationImpl.setReservationId(reservationId); return reservationImpl; }
BookReservationClientWS { public Reservation reserveBook(long bookId) { StreamSource source = new StreamSource(new StringReader(MESSAGE)); JDOMResult jdomResult = new JDOMResult(); webServiceTemplate.sendSourceAndReceiveToResult(source, jdomResult); Document document = jdomResult.getDocument(); Element reservationElement = document.getRootElement(); Long reservationId = Long.valueOf(reservationElement.getChild("reservationId",namespace).getValue()); Long bookIdRet = Long.valueOf(reservationElement.getChild("bookId",namespace).getValue()); ReservationImpl reservationImpl = new ReservationImpl(); reservationImpl.setBookId(bookIdRet); reservationImpl.setReservationId(reservationId); return reservationImpl; } }
BookReservationClientWS { public Reservation reserveBook(long bookId) { StreamSource source = new StreamSource(new StringReader(MESSAGE)); JDOMResult jdomResult = new JDOMResult(); webServiceTemplate.sendSourceAndReceiveToResult(source, jdomResult); Document document = jdomResult.getDocument(); Element reservationElement = document.getRootElement(); Long reservationId = Long.valueOf(reservationElement.getChild("reservationId",namespace).getValue()); Long bookIdRet = Long.valueOf(reservationElement.getChild("bookId",namespace).getValue()); ReservationImpl reservationImpl = new ReservationImpl(); reservationImpl.setBookId(bookIdRet); reservationImpl.setReservationId(reservationId); return reservationImpl; }  }
BookReservationClientWS { public Reservation reserveBook(long bookId) { StreamSource source = new StreamSource(new StringReader(MESSAGE)); JDOMResult jdomResult = new JDOMResult(); webServiceTemplate.sendSourceAndReceiveToResult(source, jdomResult); Document document = jdomResult.getDocument(); Element reservationElement = document.getRootElement(); Long reservationId = Long.valueOf(reservationElement.getChild("reservationId",namespace).getValue()); Long bookIdRet = Long.valueOf(reservationElement.getChild("bookId",namespace).getValue()); ReservationImpl reservationImpl = new ReservationImpl(); reservationImpl.setBookId(bookIdRet); reservationImpl.setReservationId(reservationId); return reservationImpl; }  Reservation reserveBook(long bookId); }
BookReservationClientWS { public Reservation reserveBook(long bookId) { StreamSource source = new StreamSource(new StringReader(MESSAGE)); JDOMResult jdomResult = new JDOMResult(); webServiceTemplate.sendSourceAndReceiveToResult(source, jdomResult); Document document = jdomResult.getDocument(); Element reservationElement = document.getRootElement(); Long reservationId = Long.valueOf(reservationElement.getChild("reservationId",namespace).getValue()); Long bookIdRet = Long.valueOf(reservationElement.getChild("bookId",namespace).getValue()); ReservationImpl reservationImpl = new ReservationImpl(); reservationImpl.setBookId(bookIdRet); reservationImpl.setReservationId(reservationId); return reservationImpl; }  Reservation reserveBook(long bookId);  }