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 da...@apache.org on 2008/04/17 23:07:48 UTC

svn commit: r649275 - in /webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt: MethodMarshallerUtils.java UnmarshalMessageContextListener.java

Author: damrhei
Date: Thu Apr 17 14:07:45 2008
New Revision: 649275

URL: http://svn.apache.org/viewvc?rev=649275&view=rev
Log:
Fix for issue documented in AXIS2-3750.

Modified:
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/UnmarshalMessageContextListener.java

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java?rev=649275&r1=649274&r2=649275&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java Thu Apr 17 14:07:45 2008
@@ -20,6 +20,7 @@
 package org.apache.axis2.jaxws.marshaller.impl.alt;
 
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.Parameter;
 import org.apache.axis2.java.security.AccessController;
@@ -1340,21 +1341,25 @@
         // The information is registered on the AxisService.
         if (mc == null ||
             mc.getAxisMessageContext() == null ||
-            mc.getAxisMessageContext().getAxisService() == null) {
+            mc.getAxisMessageContext().getAxisService() == null ||
+            mc.getAxisMessageContext().getAxisOperation() == null) {
             return;
         }
-        AxisService ac = mc.getAxisMessageContext().getAxisService();
+        
+        // This needs to be stored on the AxisOperation as unmarshalling
+        // info will be specific to a method and its parameters
+        AxisOperation axisOp = mc.getAxisMessageContext().getAxisOperation();
         
         // There are two things that need to be saved.
         // 1) The UnmarshalInfo object containing the packages 
         //    (which will be used by the CustomBuilder)
         // 2) A MessageContextListener which (when triggered) registers
         //    the JAXBCustomBuilder
-        Parameter param = ac.getParameter(UnmarshalInfo.KEY);
+        Parameter param = axisOp.getParameter(UnmarshalInfo.KEY);
         if (param == null) {
             UnmarshalInfo info = new UnmarshalInfo(packages, packagesKey);
-            ac.addParameter(UnmarshalInfo.KEY, info);
-            param = ac.getParameter(UnmarshalInfo.KEY);
+            axisOp.addParameter(UnmarshalInfo.KEY, info);
+            param = axisOp.getParameter(UnmarshalInfo.KEY);
             param.setTransient(true);
             // Add a listener that will set the JAXBCustomBuilder
             UnmarshalMessageContextListener.

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/UnmarshalMessageContextListener.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/UnmarshalMessageContextListener.java?rev=649275&r1=649274&r2=649275&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/UnmarshalMessageContextListener.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/UnmarshalMessageContextListener.java Thu Apr 17 14:07:45 2008
@@ -25,6 +25,7 @@
 import org.apache.axis2.context.ServiceContext;
 import org.apache.axis2.datasource.jaxb.JAXBCustomBuilder;
 import org.apache.axis2.datasource.jaxb.JAXBDSContext;
+import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.MessageContextListener;
 import org.apache.axis2.description.Parameter;
@@ -94,11 +95,12 @@
 
         // Get the UnmarshalInfo object.
         // This contains information from prior unmarshalling
-        AxisService as = sc.getAxisService();
-        if (as == null) {
+        AxisOperation axisOp = mc.getAxisOperation();
+        if (axisOp == null) {
             return;
         }
-        Parameter parameterInfo = as.getParameter(UnmarshalInfo.KEY);
+        
+        Parameter parameterInfo = axisOp.getParameter(UnmarshalInfo.KEY);
         if (parameterInfo == null) {
             return;
         }
@@ -114,7 +116,7 @@
         JAXBCustomBuilder jcb = new JAXBCustomBuilder(jaxbDSC);
         ((StAXOMBuilder) envelope.getBuilder()).registerCustomBuilderForPayload(jcb);
         if (log.isDebugEnabled()) {
-            log.debug("Registering JAXBCustomBuilder: " + jcb);
+            log.debug("Registering JAXBCustomBuilder: " + jcb + " for AxisOperation: " + axisOp.getName());
         }
     }
 



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