You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by pr...@apache.org on 2008/02/18 16:58:36 UTC

svn commit: r628788 - /webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionFactoryImpl.java

Author: pradine
Date: Mon Feb 18 07:58:35 2008
New Revision: 628788

URL: http://svn.apache.org/viewvc?rev=628788&view=rev
Log:
Allow an endpoint reference that does not contain any (recognized) metadata to work.

Modified:
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionFactoryImpl.java

Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionFactoryImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionFactoryImpl.java?rev=628788&r1=628787&r2=628788&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionFactoryImpl.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionFactoryImpl.java Mon Feb 18 07:58:35 2008
@@ -372,16 +372,15 @@
             ServiceName serviceName = EndpointReferenceHelper.getServiceNameMetadata(epr, addressingNamespace);
             QName serviceQName = serviceDescription.getServiceQName();
             
-            //The javadoc says that a WebServiceException should be thrown if the service name
-            //in the EPR metadata does not match the service name in the WSDL of the JAX-WS
-            //service instance.
-            if (!serviceQName.equals(serviceName.getName()))
+            //We need to throw an exception if the service name in the EPR metadata does not
+            //match the service name associated with the JAX-WS service instance.
+            if (serviceName.getName() != null && !serviceQName.equals(serviceName.getName()))
                 throw ExceptionFactory.makeWebServiceException("The service name of the endpoint reference does not match the service name of the service client.");
             
-            //TODO The javadoc seems to suggest, inconsistently, that the port name can be
-            //resolved by looking in the following places: 1) the EPR metadata, 2) the SEI, and
-            //3) the WSDL. At the moment only 1) is implemented. May need to revisit the others.
-            portQName = new QName(serviceQName.getNamespaceURI(), serviceName.getEndpointName());
+            //If a port name is available from the EPR metadata then use that, otherwise
+            //leave it to the runtime to find a suitable port, based on WSDL/annotations.
+            if (serviceName.getEndpointName() != null)
+                portQName = new QName(serviceQName.getNamespaceURI(), serviceName.getEndpointName());
         }
         catch (Exception e) {
             //TODO NLS enable.



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org