[jboss-svn-commits] JBossWS SVN: r1018 - trunk/src/main/java/javax/xml/ws

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Sep 20 05:04:21 EDT 2006


Author: thomas.diesler at jboss.com
Date: 2006-09-20 05:04:19 -0400 (Wed, 20 Sep 2006)
New Revision: 1018

Modified:
   trunk/src/main/java/javax/xml/ws/Service.java
Log:
4.2 Conformance (Service Creation Failure)

Modified: trunk/src/main/java/javax/xml/ws/Service.java
===================================================================
--- trunk/src/main/java/javax/xml/ws/Service.java	2006-09-20 08:29:33 UTC (rev 1017)
+++ trunk/src/main/java/javax/xml/ws/Service.java	2006-09-20 09:04:19 UTC (rev 1018)
@@ -24,6 +24,7 @@
 import java.net.URL;
 import java.util.Iterator;
 import java.util.concurrent.Executor;
+import java.util.concurrent.ExecutorService;
 
 import javax.xml.bind.JAXBContext;
 import javax.xml.namespace.QName;
@@ -31,6 +32,9 @@
 import javax.xml.ws.spi.Provider;
 import javax.xml.ws.spi.ServiceDelegate;
 
+import org.jboss.ws.jaxws.client.DispatchImpl;
+import org.jboss.ws.metadata.EndpointMetaData;
+
 /**
  * Service objects provide the client view of a Web service.
  * 
@@ -132,7 +136,16 @@
     */
    public static Service create(URL wsdlDocumentLocation, QName serviceName)
    {
-      return new Service(wsdlDocumentLocation, serviceName);
+      Service service = null;
+      try
+      {
+         service = new Service(wsdlDocumentLocation, serviceName);
+      }
+      catch (Exception ex)
+      {
+         handleServiceCreationFailure(ex);
+      }
+      return service;
    }
 
    /**
@@ -140,6 +153,27 @@
     */
    public static Service create(QName serviceName)
    {
-      return new Service(null, serviceName);
+      Service service = null;
+      try
+      {
+         service = new Service(null, serviceName);
+      }
+      catch (Exception ex)
+      {
+         handleServiceCreationFailure(ex);
+      }
+      return service;
    }
+
+   // 4.2 Conformance (Service Creation Failure): If a create method fails to create a service object, it MUST
+   // throw WebServiceException. The cause of that exception SHOULD be set to an exception that provides
+   // more information on the cause of the error (e.g. an IOException).
+   private static void handleServiceCreationFailure(Exception ex)
+   {
+      if (ex instanceof WebServiceException)
+      {
+         throw (WebServiceException)ex;
+      }
+      throw new WebServiceException(ex);
+   }
 }
\ No newline at end of file




More information about the jboss-svn-commits mailing list