Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48297
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 8 Jul 2010 22:22:34 +0000 (22:22 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 8 Jul 2010 22:22:34 +0000 (22:22 +0000)
Use the HandlerInfo to initialise the HandlerChain, rather than adding to it which clearly isn't correct.
From looking at the javadoc, I believe this is the fix required but I don't have a test case.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@961963 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/naming/factory/webservices/ServiceRefFactory.java
webapps/docs/changelog.xml

index e28cb1e..526c104 100644 (file)
@@ -45,6 +45,7 @@ import javax.wsdl.factory.WSDLFactory;
 import javax.wsdl.xml.WSDLReader;
 
 import javax.xml.namespace.QName;
+import javax.xml.rpc.handler.Handler;
 import javax.xml.rpc.handler.HandlerChain;
 import javax.xml.rpc.handler.HandlerInfo;
 import javax.xml.rpc.handler.HandlerRegistry;
@@ -355,7 +356,11 @@ public class ServiceRefFactory
     private void initHandlerChain(QName portName, HandlerRegistry handlerRegistry,
             HandlerInfo handlerInfo, ArrayList<String> soaprolesToAdd) {
         HandlerChain handlerChain = (HandlerChain) handlerRegistry.getHandlerChain(portName);
-        handlerChain.add(handlerInfo);
+        Iterator<Handler> iter = handlerChain.iterator();
+        while (iter.hasNext()) {
+            Handler handler = iter.next();
+            handler.init(handlerInfo);
+        }
         String[] soaprolesRegistered = handlerChain.getRoles();
         String [] soaproles = new String[soaprolesRegistered.length + soaprolesToAdd.size()];
         int i;
index 1203173..9443056 100644 (file)
         Add entryPoint support to the CSRF prevention filter. (markt)
       </add>
       <fix>
+        <bug>48297</bug>: Correctly initialise handler chain for web services
+        resources. (markt)
+      </fix>
+      <fix>
         <bug>49030</bug>: When initializing/starting/stopping connectors and
         one of them fails, do not ignore the others. (markt/kkolinko)
       </fix>