1 /* |
1 /* |
2 * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
50 * A constant representing the property used to lookup the name of |
50 * A constant representing the property used to lookup the name of |
51 * a <code>SOAPFactory</code> implementation class. |
51 * a <code>SOAPFactory</code> implementation class. |
52 */ |
52 */ |
53 static private final String SOAP_FACTORY_PROPERTY = |
53 static private final String SOAP_FACTORY_PROPERTY = |
54 "javax.xml.soap.SOAPFactory"; |
54 "javax.xml.soap.SOAPFactory"; |
|
55 |
|
56 /** |
|
57 * A constant representing the name of the default <code>SOAPFactory</code> |
|
58 * factory class to be used if another cannot be found. |
|
59 * a <code>SOAPFactory</code> implementation class. |
|
60 */ |
|
61 static private final String DEFAULT_SOAP_FACTORY |
|
62 = "com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPFactory1_1Impl"; |
55 |
63 |
56 /** |
64 /** |
57 * Creates a <code>SOAPElement</code> object from an existing DOM |
65 * Creates a <code>SOAPElement</code> object from an existing DOM |
58 * <code>Element</code>. If the DOM <code>Element</code> that is passed in |
66 * <code>Element</code>. If the DOM <code>Element</code> that is passed in |
59 * as an argument is already a <code>SOAPElement</code> then this method |
67 * as an argument is already a <code>SOAPElement</code> then this method |
253 */ |
261 */ |
254 public static SOAPFactory newInstance() |
262 public static SOAPFactory newInstance() |
255 throws SOAPException |
263 throws SOAPException |
256 { |
264 { |
257 try { |
265 try { |
258 SOAPFactory factory = (SOAPFactory) FactoryFinder.find(SOAP_FACTORY_PROPERTY); |
266 SOAPFactory factory = (SOAPFactory) FactoryFinder.find( |
|
267 SOAP_FACTORY_PROPERTY, DEFAULT_SOAP_FACTORY, false); |
259 if (factory != null) |
268 if (factory != null) |
260 return factory; |
269 return factory; |
261 return newInstance(SOAPConstants.SOAP_1_1_PROTOCOL); |
270 return newInstance(SOAPConstants.SOAP_1_1_PROTOCOL); |
262 } catch (Exception ex) { |
271 } catch (Exception ex) { |
263 throw new SOAPException( |
272 throw new SOAPException( |