Author: keithc
Date: Fri Oct 12 04:09:03 2007
New Revision: 584132

URL: http://svn.apache.org/viewvc?rev=584132&view=rev
Log:
Updating HTTPLocationBasedDispatcher to work for the common case where the 
endpoint url cannot distinguish the endpopint.


Modified:
    
webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/dispatchers/HTTPLocationBasedDispatcher.java

Modified: 
webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/dispatchers/HTTPLocationBasedDispatcher.java
URL: 
http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/dispatchers/HTTPLocationBasedDispatcher.java?rev=584132&r1=584131&r2=584132&view=diff
==============================================================================
--- 
webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/dispatchers/HTTPLocationBasedDispatcher.java
 (original)
+++ 
webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/dispatchers/HTTPLocationBasedDispatcher.java
 Fri Oct 12 04:09:03 2007
@@ -59,12 +59,30 @@
             if (httpLocation != null) {
                 AxisEndpoint axisEndpoint = (AxisEndpoint) messageContext
                         .getProperty(WSDL2Constants.ENDPOINT_LOCAL_NAME);
+                // Here we check whether the request was dispatched to the 
correct endpoint. If it
+                // was we can dispatch the operation using the 
HTTPLocationDispatcher table of that
+                // specific endpoint. In most cases we wont be able to do 
this. So as a last resort
+                // iterate through the endpoint map and try to dispatch the 
operation.
                 if (axisEndpoint != null) {
                     Map httpLocationTable = (Map) axisEndpoint.getBinding()
                             .getProperty(WSDL2Constants.HTTP_LOCATION_TABLE);
                     if (httpLocationTable != null) {
                         return getOperationFromHTTPLocation(httpLocation, 
httpLocationTable);
                     }
+                } else {
+                    Map endpoints = axisService.getEndpoints();
+                    if (endpoints != null) {
+                        Iterator iterator = endpoints.values().iterator();
+                        while (iterator.hasNext()) {
+                            AxisEndpoint endpoint = (AxisEndpoint) 
iterator.next();
+                            Map httpLocationTable = (Map) endpoint.getBinding()
+                                    
.getProperty(WSDL2Constants.HTTP_LOCATION_TABLE);
+                            if (httpLocationTable != null) {
+                                return 
getOperationFromHTTPLocation(httpLocation,
+                                                                    
httpLocationTable);
+                            }
+                        }
+                    }
                 }
             } else {
                 log.debug("Attempt to check for Operation using HTTP Location 
failed");
@@ -118,6 +136,7 @@
      * Given the requestPath that the request came to his method returns the 
corresponding axisOperation
      *
      * @param requestPath - Part of the request url which is the part after 
the service name
+     * @param httpLocationTable - The httpLocationTable stored in the relavant 
binding
      * @return AxisOperation - The corresponding AxisOperation
      */
     private AxisOperation getOperationFromHTTPLocation(String requestPath, Map 
httpLocationTable) {



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to