AxisService service) {
try {
BookList availableBookList = (BookList) service.getParameterValue(LibraryConstants.AVAILABLE_BOOK);
BookList allBookList = (BookList) service.getParameterValue(LibraryConstants.ALL_BOOK);
BookList lendBookList = (BookList) service.getParameterValue(LibraryConstants.LEND_BOOK);
UserList userList = (UserList) service.getParameterValue(LibraryConstants.USER_LIST);
OMFactory fac = OMAbstractFactory.getOMFactory();
OMElement libElement = fac.createOMElement("library", null);
Book[] bookList = allBookList.getBookList();
libElement.addChild(BeanUtil.getOMElement(
new QName(LibraryConstants.ALL_BOOK),
bookList, new QName("book"), false, null));
libElement.addChild(BeanUtil.getOMElement(
new QName(LibraryConstants.AVAILABLE_BOOK),
availableBookList.getBookList(), new QName("book"), false, null));
libElement.addChild(BeanUtil.getOMElement(
new QName(LibraryConstants.LEND_BOOK),
lendBookList.getBookList(), new QName("book"), false, null));
libElement.addChild(BeanUtil.getOMElement(
new QName(LibraryConstants.USER_LIST),
userList.getUsers(), new QName("user"), false, null));
String tempDir = System.getProperty("java.io.tmpdir");
File tempFile = new File(tempDir);
File libFile = new File(tempFile, "library.xml");
OutputStream out = new FileOutputStream(libFile);