1 6 7 28 package javax.xml.soap; 29 30 31 import java.io.IOException ; 32 import java.io.InputStream ; 33 34 69 public abstract class MessageFactory { 70 71 static private final String DEFAULT_MESSAGE_FACTORY 72 = "com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl"; 73 74 static private final String MESSAGE_FACTORY_PROPERTY 75 = "javax.xml.soap.MessageFactory"; 76 77 100 101 public static MessageFactory newInstance() 102 throws SOAPException { 103 try { 104 MessageFactory factory = (MessageFactory ) 105 FactoryFinder.find(MESSAGE_FACTORY_PROPERTY); 106 107 if (factory != null) 108 return factory; 109 110 return newInstance(SOAPConstants.SOAP_1_1_PROTOCOL); 111 } catch (Exception ex) { 112 throw new SOAPException ( 113 "Unable to create message factory for SOAP: " 114 +ex.getMessage()); 115 } 116 117 } 118 119 143 public static MessageFactory newInstance(String protocol) throws SOAPException { 144 return SAAJMetaFactory.getInstance().newMessageFactory(protocol); 145 } 146 147 166 public abstract SOAPMessage createMessage() 167 throws SOAPException ; 168 169 195 public abstract SOAPMessage createMessage(MimeHeaders headers, 196 InputStream in) 197 throws IOException , SOAPException ; 198 } 199 | Popular Tags |