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

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Sep 25 12:24:54 EDT 2006


Author: thomas.diesler at jboss.com
Date: 2006-09-25 12:24:52 -0400 (Mon, 25 Sep 2006)
New Revision: 1042

Modified:
   branches/tdiesler/trunk/src/main/java/javax/xml/ws/Endpoint.java
Log:
Conformance (Endpoint publish(String address, Object implementor)

Modified: branches/tdiesler/trunk/src/main/java/javax/xml/ws/Endpoint.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/javax/xml/ws/Endpoint.java	2006-09-25 14:27:41 UTC (rev 1041)
+++ branches/tdiesler/trunk/src/main/java/javax/xml/ws/Endpoint.java	2006-09-25 16:24:52 UTC (rev 1042)
@@ -21,11 +21,14 @@
  */
 package javax.xml.ws;
 
+import java.net.MalformedURLException;
+import java.net.URL;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.Executor;
 
 import javax.xml.transform.Source;
+import javax.xml.ws.soap.SOAPBinding;
 import javax.xml.ws.spi.Provider;
 
 /**
@@ -113,7 +116,33 @@
     */
    public static Endpoint publish(String address, Object implementor)
    {
-      return Provider.provider().createAndPublishEndpoint(address, implementor);
+      String bindingId;
+      try
+      {
+         URL url = new URL(address);
+         String protocol = url.getProtocol();
+         if (protocol.startsWith("http"))
+         {
+            bindingId = SOAPBinding.SOAP11HTTP_BINDING;
+         }
+         else
+         {
+            throw new IllegalArgumentException("Unsupported protocol: " + address);
+         }
+      }
+      catch (MalformedURLException e)
+      {
+         throw new IllegalArgumentException("Invalid endpoint addess: " + address);
+      }
+      
+      // 5.5 Conformance (Endpoint publish(String address, Object implementor) Method): The effect of invoking the
+      // publishmethod on an EndpointMUST be the same as first invoking the createmethod with the binding
+      // ID appropriate to the URL scheme used by the address, then invoking the publish(String address)
+      // method on the resulting endpoint.
+      Endpoint endpoint = Endpoint.create(bindingId, implementor);
+      endpoint.publish(address);
+      
+      return endpoint;
    }
 
    /**




More information about the jboss-svn-commits mailing list