/Users/detro/workspace-nb/JAEBI/src/java/org/jaebi/test/server/xml/MainTestJAXBXresponse.java

Vai alla documentazione di questo file.
00001 /*
00002  * MainTestJAXBXresponse.java
00003  *
00004  * Created on May 31, 2005, 4:43 PM
00005  *
00006  * To change this template, choose Tools | Options and locate the template under
00007  * the Source Creation and Management node. Right-click the template and choose
00008  * Open. You can then make changes to the template in the Source Editor.
00009  */
00010 
00011 package org.jaebi.test.server.xml;
00012 import org.jaebi.server.service.xml.JAXBMarshallerWrapper;
00013 import org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl;
00014 import org.jaebi.server.service.xml.JAXBXResponseFactory;
00015 import org.jaebi.server.service.xml.exception.JAXBMarshallerWrapperInitException;
00016 import org.jaebi.server.service.xml.exception.JAXBMarshallerWrapperMarshallException;
00017 import org.jaebi.server.service.xml.exception.JAXBMarshallerWrapperUnmarshallException;
00018 import org.jaebi.server.service.xml.exception.JAXBXResponseFactoryBuildingException;
00019 import org.jaebi.server.service.xml.xresponse.Xresponse;
00024 public class MainTestJAXBXresponse {
00025     
00029     public static void main(String[] args) {
00030         JAXBMarshallerWrapper marshWrap = null;
00031         JAXBXResponseFactory xrespFactory = new JAXBXResponseFactory();
00032         Xresponse responseXML = null;
00033         String responseXMLStr = null;
00034         
00035         try {
00036             responseXML = (Xresponse)xrespFactory.buildXresponse(true, "query ok");
00037             marshWrap = new JAXBMarshallerWrapperImpl("org.jaebi.server.service.xml.xresponse");
00038         } catch ( JAXBMarshallerWrapperInitException e ) {
00039             e.printStackTrace();
00040         } catch ( JAXBXResponseFactoryBuildingException e ) {
00041             e.printStackTrace();
00042         }
00043         
00044         try {
00045             marshWrap.setFormattedMarshalling(true);
00046             responseXMLStr = marshWrap.marshall(responseXML);
00047         } catch ( JAXBMarshallerWrapperMarshallException e ) {
00048             e.printStackTrace();
00049         } finally {
00050             System.out.println("XML Marshalled:\n" + responseXMLStr);
00051         }
00052         
00053         try {
00054             responseXML = (Xresponse)marshWrap.unmarshall(responseXMLStr);
00055         } catch ( JAXBMarshallerWrapperUnmarshallException e ) {
00056             e.printStackTrace();
00057         }
00058         
00059         
00060     }
00061     
00062 }

Generato il Mon Jun 27 22:50:38 2005 per JAEBI - JAva Enterprice BackEnd Interfacement da  doxygen 1.4.3