You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by bu...@apache.org on 2003/12/03 19:04:15 UTC

DO NOT REPLY [Bug 25173] New: - Namespace is significant for port QNames used in HandlerRegistry mappings

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25173>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25173

Namespace is significant for port QNames used in HandlerRegistry mappings

           Summary: Namespace is significant for port QNames used in
                    HandlerRegistry mappings
           Product: Axis
           Version: 1.1
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: WSDL processing
        AssignedTo: axis-dev@ws.apache.org
        ReportedBy: arh14@cornell.edu


While the WSDL4J API does not use QNames to refer to Port objects, instead 
using plain Strings, JAX-RPC HandlerRegistry API uses QNames to registry 
HandlerChains.  Axis treats the namespace of the QName as significant with 
regard to hash mapping but NOT meaningful (i.e. the namespace is included when 
determining the hash but is itself of no use).  In presence of a bug like 
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25170, there will be a 
discrepency between Ports names that HandlerChains are mapped to in the 
HandlerRegistry, and Port names returned by the 
org.apache.axis.client.Service 'getPorts' method, potentially resulting in a 
HandlerChain registered for a port, not being called for that port.

The solution is to make inner class HandlerRegistryImpl in the Service object 
accepting of QNames, but ONLY use the LocalPart of the QName for hashing 
purposes.  That will allow Service object to return fully qualified Port names, 
and the HandlerRegistryImpl to accept fully qualified Port names, but only 
treat the LocalPart as significant with regard to mapping.  Patch:

--- Copy of Service.java.bak	2003-06-13 10:47:02.000000000 -0400
+++ Service.java	2003-12-03 13:03:03.662750000 -0500
@@ -849,7 +869,9 @@
         Map map = new HashMap();
 
         public List getHandlerChain(QName portName) {
-            List list = (List) map.get(portName);
+            // namespace is not significant, so use local part directly
+            String key = portName.getLocalPart();
+            List list = (List) map.get(key);
             if (list == null) {
                 list = new java.util.ArrayList();
                 setHandlerChain(portName, list);
@@ -858,7 +880,8 @@
         }
 
         public void setHandlerChain(QName portName, List chain) {
-            map.put(portName, chain);
+            // namespace is not significant, so use local part directly
+            map.put(portName.getLocalPart(), chain);
         }
     }