1 28 29 package com.caucho.soap.wsdl; 30 31 import com.caucho.log.Log; 32 import com.caucho.util.L10N; 33 34 import javax.xml.bind.JAXBContext; 35 import javax.xml.bind.JAXBException; 36 import javax.xml.bind.Unmarshaller; 37 import java.io.IOException ; 38 import java.io.InputStream ; 39 import java.util.logging.Logger ; 40 41 44 public class WSDLParser { 45 private final static Logger log = Log.open(WSDLParser.class); 46 private final static L10N L = new L10N(WSDLParser.class); 47 private static JAXBContext _context = null; 48 49 52 public static WSDLDefinitions parse(InputStream is) 53 throws IOException , JAXBException 54 { 55 try { 56 if (_context == null) 57 _context = JAXBContext.newInstance("com.caucho.soap.wsdl"); 58 59 Unmarshaller unmarshaller = _context.createUnmarshaller(); 60 return (WSDLDefinitions) unmarshaller.unmarshal(is); 61 } catch (JAXBException e) { 62 throw e; 63 } catch (Exception e) { 64 throw new JAXBException(e); 65 } 66 } 67 } 68 | Popular Tags |