axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntha...@apache.org
Subject svn commit: r718408 - in /webservices/axis2/trunk/java/modules: jaxws-integration/test-resources/wsdl/ jaxws-integration/test/org/apache/axis2/jaxws/proxy/ jaxws-integration/test/org/apache/axis2/jaxws/proxy/gorilla_dlw/ jaxws-integration/test/org/apac...
Date Mon, 17 Nov 2008 22:10:23 GMT
Author: nthaker
Date: Mon Nov 17 14:10:23 2008
New Revision: 718408

URL: http://svn.apache.org/viewvc?rev=718408&view=rev
Log:
AXIS2-4133

Modified:
    webservices/axis2/trunk/java/modules/jaxws-integration/test-resources/wsdl/gorilla_dlw.wsdl
    webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/GorillaDLWProxyTests.java
    webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/gorilla_dlw/GorillaProxyImpl.java
    webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/gorilla_dlw/META-INF/gorilla_dlw.wsdl
    webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/gorilla_dlw/sei/GorillaInterface.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMethodMarshaller.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedPlusMethodMarshaller.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/LegacyExceptionUtil.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/utility/PropertyDescriptorPlus.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/wrapper/JAXBWrapperTool.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/wrapper/impl/JAXBWrapperToolImpl.java
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/utility/PropertyDescriptorPlusTests.java

Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test-resources/wsdl/gorilla_dlw.wsdl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test-resources/wsdl/gorilla_dlw.wsdl?rev=718408&r1=718407&r2=718408&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test-resources/wsdl/gorilla_dlw.wsdl
(original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test-resources/wsdl/gorilla_dlw.wsdl
Mon Nov 17 14:10:23 2008
@@ -189,6 +189,14 @@
           </s:sequence>
         </s:complexType>
       </s:element>
+	  
+	  <s:element name="echoStringListAsLinkedListResponse">
+        <s:complexType>
+          <s:sequence>
+            <s:element minOccurs="0" maxOccurs="1" name="data" type="data:stringList"
/>
+          </s:sequence>
+        </s:complexType>
+      </s:element>
 
       <s:element name="echoStringListAltAsLinkedListResponse">
         <s:complexType>
@@ -360,7 +368,43 @@
           </s:sequence>
         </s:complexType>
       </s:element>
-
+	  
+     <s:element name="echoDate">     	 
+           <s:complexType>
+		   <s:choice>
+				<s:element name="RequestedTerminationTime" nillable="true" type="s:dateTime" />
+				<s:element name="RequestedLifetimeDuration" type="s:duration" />
+			</s:choice>
+			
+             <!--<s:sequence>
+               <s:element name="request" nillable="true" type="s:date" />
+             </s:sequence> -->
+			 
+           </s:complexType>
+	  </s:element>
+
+	  <s:element name="echoDateResponse">
+           <s:complexType>
+             <s:sequence>
+               <s:element name="response" type="s:date" />
+             </s:sequence>
+           </s:complexType>
+	  </s:element>
+	  
+	  <s:complexType name="echoBasetype">
+	            <s:sequence>
+	               <s:element name="request" type="s:date" />
+	            </s:sequence>
+	         </s:complexType>
+			 
+	  	 <s:element name="echoPolymorphicDate">
+			 <s:complexType>
+				<s:complexContent>
+					<s:extension base="data:echoBasetype"/>
+				</s:complexContent>
+			</s:complexType>
+		 </s:element>
+		 	  
     </s:schema>
 
     <s:schema elementFormDefault="qualified" 
@@ -385,8 +429,6 @@
         </s:complexType>
     </s:schema>
  
-
-
   </types>
 
   <!-- messages -->
@@ -510,6 +552,19 @@
   <message name="echoAnyTypeArrayResponse">
     <part name="x" element="data:echoAnyTypeArrayResponse" />
   </message>
+  
+  
+   <message name="echoPolymorphicDateMessage">
+      <part name="dateRequest" element="data:echoPolymorphicDate"/>
+   </message>
+   
+   <message name="echoDateMessage">
+      <part name="dateRequest" element="data:echoDate"/>
+   </message>
+
+   <message name="echoDateResponseMessage">
+      <part name="dateResponse" element="data:echoDateResponse"/>
+   </message>
 
   <!-- operation -->
   <portType name="GorillaInterface">
@@ -605,6 +660,13 @@
       <output message="tns:echoAnyTypeArrayResponse" />
       <fault  name="assertFault" message="tns:assertFault" />
     </operation>
+    <operation name="echoPolymorphicDate">
+      <input message="tns:echoPolymorphicDateMessage" />
+    </operation>
+	<operation name="echoDate">
+      <input message="tns:echoDateMessage" />
+      <output message="tns:echoDateResponseMessage" />
+	</operation>
   </portType>
 
   <!-- binding -->
@@ -817,6 +879,21 @@
         <soap:fault name="assertFault" use="literal" />
       </fault>
     </operation>
+    <operation name="echoDate">
+      <soap:operation soapAction=""/>
+      <input>
+         <soap:body use="literal"/>
+      </input>
+      <output>
+         <soap:body use="literal"/>
+      </output>
+    </operation>  
+	<operation name="echoPolymorphicDate">
+      <soap:operation soapAction=""/>
+      <input>
+        <soap:body use="literal"/>
+      </input>
+    </operation>
  </binding>
 
   <service name="GorillaService">

Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/GorillaDLWProxyTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/GorillaDLWProxyTests.java?rev=718408&r1=718407&r2=718408&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/GorillaDLWProxyTests.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/GorillaDLWProxyTests.java
Mon Nov 17 14:10:23 2008
@@ -25,7 +25,11 @@
 import org.apache.axis2.jaxws.framework.AbstractTestCase;
 import org.apache.axis2.jaxws.message.databinding.JAXBUtilsMonitor;
 import org.apache.axis2.jaxws.proxy.gorilla_dlw.sei.GorillaInterface;
+import org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl;
 
+import javax.xml.datatype.DatatypeFactory;
+import javax.xml.datatype.Duration;
+import javax.xml.datatype.XMLGregorianCalendar;
 import javax.xml.namespace.QName;
 import javax.xml.ws.BindingProvider;
 import javax.xml.ws.Dispatch;
@@ -34,6 +38,9 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
 import java.util.List;
 
 public class GorillaDLWProxyTests extends AbstractTestCase {
@@ -469,6 +476,39 @@
         }
     }
     
+    public void testEchoDate() throws Exception{
+    	try{
+    		System.out.println("TestEchoDate");
+	    	GorillaInterface proxy = getProxy();
+	    	GregorianCalendar cal = new GregorianCalendar(Calendar.YEAR, Calendar.MONTH, Calendar.DAY_OF_MONTH);
+	    	DatatypeFactory javaxtypeFactory = DatatypeFactory.newInstance();
+	    	DatatypeFactory xercesfactoryImpl = DatatypeFactoryImpl.newInstance();
+	    	XMLGregorianCalendar request=  javaxtypeFactory.newXMLGregorianCalendar(cal);
+	    	System.out.println("Javax Factory Clazz Name = "+request.getClass().getName());
+	    	Duration d = javaxtypeFactory.newDuration(System.currentTimeMillis());
+	    	XMLGregorianCalendar response = proxy.echoDate(request, d);
+	    	System.out.println(response.toString());
+	    	assertNotNull(response);
+    	}catch(Exception e){
+    		e.printStackTrace();
+    		fail("Exception in testEchoDate :"+e);
+    	}
+    }
+    
+    public void testPolymorphicDate() throws Exception{
+    	try{
+	    	GorillaInterface proxy = getProxy();
+	    	GregorianCalendar cal = new GregorianCalendar(Calendar.YEAR, Calendar.MONTH, Calendar.DAY_OF_MONTH);
+	    	DatatypeFactory typeFactory = DatatypeFactory.newInstance();
+	    	XMLGregorianCalendar request =  typeFactory.newXMLGregorianCalendar(cal);
+	        proxy.echoPolymorphicDate(request);
+	    	
+    	}catch(Exception e){
+    		e.printStackTrace();
+    		fail("Exception in testEchoDate :"+e);
+    	}
+    }
+    
     private boolean compareLists(List in, List out) {
         if (in.size() != out.size()) {
             TestLogger.logger.debug("Size mismatch " + in.size() + "!=" + out.size());

Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/gorilla_dlw/GorillaProxyImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/gorilla_dlw/GorillaProxyImpl.java?rev=718408&r1=718407&r2=718408&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/gorilla_dlw/GorillaProxyImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/gorilla_dlw/GorillaProxyImpl.java
Mon Nov 17 14:10:23 2008
@@ -24,6 +24,8 @@
 import org.apache.axis2.jaxws.proxy.gorilla_dlw.sei.GorillaInterface;
 
 import javax.jws.WebService;
+import javax.xml.datatype.Duration;
+import javax.xml.datatype.XMLGregorianCalendar;
 import javax.xml.ws.Holder;
 import java.util.List;
 
@@ -135,4 +137,18 @@
     public List<Fruit> echoEnumArray(List<Fruit> data) throws AssertFault {
         return data;
     }
+
+	public XMLGregorianCalendar echoDate(XMLGregorianCalendar requestedTerminationTime, Duration
requestedLifetimeDuration) {
+
+		return requestedTerminationTime;
+	}
+
+
+	public void echoPolymorphicDate(XMLGregorianCalendar request) { 
+		//Test to make sure polymorpic cases can marshal on client and server.
+		if(request==null){
+			
+		}
+	}
+    
 }

Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/gorilla_dlw/META-INF/gorilla_dlw.wsdl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/gorilla_dlw/META-INF/gorilla_dlw.wsdl?rev=718408&r1=718407&r2=718408&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/gorilla_dlw/META-INF/gorilla_dlw.wsdl
(original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/gorilla_dlw/META-INF/gorilla_dlw.wsdl
Mon Nov 17 14:10:23 2008
@@ -189,6 +189,14 @@
           </s:sequence>
         </s:complexType>
       </s:element>
+	  
+	  <s:element name="echoStringListAsLinkedListResponse">
+        <s:complexType>
+          <s:sequence>
+            <s:element minOccurs="0" maxOccurs="1" name="data" type="data:stringList"
/>
+          </s:sequence>
+        </s:complexType>
+      </s:element>
 
       <s:element name="echoStringListAltAsLinkedListResponse">
         <s:complexType>
@@ -360,7 +368,43 @@
           </s:sequence>
         </s:complexType>
       </s:element>
-
+	  
+     <s:element name="echoDate">     	 
+           <s:complexType>
+		   <s:choice>
+				<s:element name="RequestedTerminationTime" nillable="true" type="s:dateTime" />
+				<s:element name="RequestedLifetimeDuration" type="s:duration" />
+			</s:choice>
+			
+             <!--<s:sequence>
+               <s:element name="request" nillable="true" type="s:date" />
+             </s:sequence> -->
+			 
+           </s:complexType>
+	  </s:element>
+
+	  <s:element name="echoDateResponse">
+           <s:complexType>
+             <s:sequence>
+               <s:element name="response" type="s:date" />
+             </s:sequence>
+           </s:complexType>
+	  </s:element>
+	  
+	  <s:complexType name="echoBasetype">
+	            <s:sequence>
+	               <s:element name="request" type="s:date" />
+	            </s:sequence>
+	         </s:complexType>
+			 
+	  	 <s:element name="echoPolymorphicDate">
+			 <s:complexType>
+				<s:complexContent>
+					<s:extension base="data:echoBasetype"/>
+				</s:complexContent>
+			</s:complexType>
+		 </s:element>
+		 	  
     </s:schema>
 
     <s:schema elementFormDefault="qualified" 
@@ -385,8 +429,6 @@
         </s:complexType>
     </s:schema>
  
-
-
   </types>
 
   <!-- messages -->
@@ -510,6 +552,19 @@
   <message name="echoAnyTypeArrayResponse">
     <part name="x" element="data:echoAnyTypeArrayResponse" />
   </message>
+  
+  
+   <message name="echoPolymorphicDateMessage">
+      <part name="dateRequest" element="data:echoPolymorphicDate"/>
+   </message>
+   
+   <message name="echoDateMessage">
+      <part name="dateRequest" element="data:echoDate"/>
+   </message>
+
+   <message name="echoDateResponseMessage">
+      <part name="dateResponse" element="data:echoDateResponse"/>
+   </message>
 
   <!-- operation -->
   <portType name="GorillaInterface">
@@ -605,6 +660,13 @@
       <output message="tns:echoAnyTypeArrayResponse" />
       <fault  name="assertFault" message="tns:assertFault" />
     </operation>
+    <operation name="echoPolymorphicDate">
+      <input message="tns:echoPolymorphicDateMessage" />
+    </operation>
+	<operation name="echoDate">
+      <input message="tns:echoDateMessage" />
+      <output message="tns:echoDateResponseMessage" />
+	</operation>
   </portType>
 
   <!-- binding -->
@@ -817,6 +879,21 @@
         <soap:fault name="assertFault" use="literal" />
       </fault>
     </operation>
+    <operation name="echoDate">
+      <soap:operation soapAction=""/>
+      <input>
+         <soap:body use="literal"/>
+      </input>
+      <output>
+         <soap:body use="literal"/>
+      </output>
+    </operation>  
+	<operation name="echoPolymorphicDate">
+      <soap:operation soapAction=""/>
+      <input>
+        <soap:body use="literal"/>
+      </input>
+    </operation>
  </binding>
 
   <service name="GorillaService">

Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/gorilla_dlw/sei/GorillaInterface.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/gorilla_dlw/sei/GorillaInterface.java?rev=718408&r1=718407&r2=718408&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/gorilla_dlw/sei/GorillaInterface.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/gorilla_dlw/sei/GorillaInterface.java
Mon Nov 17 14:10:23 2008
@@ -22,12 +22,15 @@
 
 import org.apache.axis2.jaxws.proxy.gorilla_dlw.data.Fruit;
 
+import javax.jws.Oneway;
 import javax.jws.WebMethod;
 import javax.jws.WebParam;
 import javax.jws.WebParam.Mode;
 import javax.jws.WebResult;
 import javax.jws.WebService;
 import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.datatype.Duration;
+import javax.xml.datatype.XMLGregorianCalendar;
 import javax.xml.ws.Holder;
 import javax.xml.ws.RequestWrapper;
 import javax.xml.ws.ResponseWrapper;
@@ -301,5 +304,31 @@
         List<Object> data)
         throws AssertFault
     ;
+    /**
+     * 
+     * @param requestedTerminationTime
+     * @param requestedLifetimeDuration
+     * @return
+     *     returns javax.xml.datatype.XMLGregorianCalendar
+     */
+    @WebMethod
+    @WebResult(name = "response", targetNamespace = "http://org/apache/axis2/jaxws/proxy/gorilla_dlw/data")
+    @RequestWrapper(localName = "echoDate", targetNamespace = "http://org/apache/axis2/jaxws/proxy/gorilla_dlw/data",
className = "org.apache.axis2.jaxws.proxy.gorilla_dlw.data.EchoDate")
+    @ResponseWrapper(localName = "echoDateResponse", targetNamespace = "http://org/apache/axis2/jaxws/proxy/gorilla_dlw/data",
className = "org.apache.axis2.jaxws.proxy.gorilla_dlw.data.EchoDateResponse")
+    public XMLGregorianCalendar echoDate(
+        @WebParam(name = "RequestedTerminationTime", targetNamespace = "http://org/apache/axis2/jaxws/proxy/gorilla_dlw/data")
+        XMLGregorianCalendar requestedTerminationTime,
+        @WebParam(name = "RequestedLifetimeDuration", targetNamespace = "http://org/apache/axis2/jaxws/proxy/gorilla_dlw/data")
+        Duration requestedLifetimeDuration);
 
+    /**
+     * 
+     * @param request
+     */
+    @WebMethod
+    @Oneway
+    @RequestWrapper(localName = "echoPolymorphicDate", targetNamespace = "http://org/apache/axis2/jaxws/proxy/gorilla_dlw/data",
className = "org.apache.axis2.jaxws.proxy.gorilla_dlw.data.EchoPolymorphicDate")
+    public void echoPolymorphicDate(
+        @WebParam(name = "request", targetNamespace = "http://org/apache/axis2/jaxws/proxy/gorilla_dlw/data")
+        XMLGregorianCalendar request);
 }

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMethodMarshaller.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMethodMarshaller.java?rev=718408&r1=718407&r2=718408&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMethodMarshaller.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMethodMarshaller.java
Mon Nov 17 14:10:23 2008
@@ -345,14 +345,18 @@
             // Create the inputs to the wrapper tool
             ArrayList<String> nameList = new ArrayList<String>();
             Map<String, Object> objectList = new HashMap<String, Object>();
+            Map<String, Class>  declaredClassMap = new HashMap<String, Class>();
 
             for (PDElement pde : pdeList) {
                 String name = pde.getParam().getParameterName();
-
+                
                 // The object list contains type rendered objects
                 Object value = pde.getElement().getTypeValue();
+                Class dclClass = pde.getParam().getParameterActualType();
+                
                 nameList.add(name);
                 objectList.put(name, value);
+                declaredClassMap.put(name, dclClass);
             }
 
             // Add the return object to the nameList and objectList
@@ -372,7 +376,7 @@
                 cls = MethodMarshallerUtils.loadClass(wrapperName, endpointDesc.getAxisService().getClassLoader());
             }
             JAXBWrapperTool wrapperTool = new JAXBWrapperToolImpl();
-            Object object = wrapperTool.wrap(cls, nameList, objectList,
+            Object object = wrapperTool.wrap(cls, nameList, objectList, declaredClassMap,
                                              marshalDesc.getPropertyDescriptorMap(cls));
 
             QName wrapperQName = new QName(operationDesc.getResponseWrapperTargetNamespace(),
@@ -454,14 +458,17 @@
             // Create the inputs to the wrapper tool
             ArrayList<String> nameList = new ArrayList<String>();
             Map<String, Object> objectList = new HashMap<String, Object>();
+            Map<String, Class> declaredClassMap = new HashMap<String, Class>();
 
             for (PDElement pv : pvList) {
                 String name = pv.getParam().getParameterName();
 
                 // The object list contains type rendered objects
                 Object value = pv.getElement().getTypeValue();
+                Class dclClass = pv.getParam().getParameterActualType();
                 nameList.add(name);
                 objectList.put(name, value);
+                declaredClassMap.put(name, dclClass);
             }
 
             // Now create the single JAXB element 
@@ -473,7 +480,7 @@
                 cls = MethodMarshallerUtils.loadClass(wrapperName, endpointDesc.getAxisService().getClassLoader());
             }
             JAXBWrapperTool wrapperTool = new JAXBWrapperToolImpl();
-            Object object = wrapperTool.wrap(cls, nameList, objectList,
+            Object object = wrapperTool.wrap(cls, nameList, objectList, declaredClassMap,

                                              marshalDesc.getPropertyDescriptorMap(cls));
 
             QName wrapperQName = new QName(operationDesc.getRequestWrapperTargetNamespace(),

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedPlusMethodMarshaller.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedPlusMethodMarshaller.java?rev=718408&r1=718407&r2=718408&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedPlusMethodMarshaller.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedPlusMethodMarshaller.java
Mon Nov 17 14:10:23 2008
@@ -468,6 +468,7 @@
             // Create the inputs to the wrapper tool
             ArrayList<String> nameList = new ArrayList<String>();
             Map<String, Object> objectList = new HashMap<String, Object>();
+            Map<String, Class> declaredClassMap = new HashMap<String, Class>();
             List<PDElement> headerPDEList = new ArrayList<PDElement>();
 
             Iterator<PDElement> it = pdeList.iterator();
@@ -478,8 +479,10 @@
                     // Normal case
                     // The object list contains type rendered objects
                     Object value = pde.getElement().getTypeValue();
+                    Class dclClass = pde.getParam().getParameterActualType();
                     nameList.add(name);
                     objectList.put(name, value);
+                    declaredClassMap.put(name, dclClass);
                 } else {
                     // Header Case:
                     // Remove the header from the list, it will
@@ -495,8 +498,10 @@
 
                 if (returnType != void.class) {
                     String name = operationDesc.getResultName();
+                    Class dclClass = operationDesc.getResultActualType();
                     nameList.add(name);
                     objectList.put(name, returnObject);
+                    declaredClassMap.put(name, dclClass);
                 }
             } else {
                 // Header Result:
@@ -533,7 +538,7 @@
                 cls = MethodMarshallerUtils.loadClass(wrapperName, endpointDesc.getAxisService().getClassLoader());
             }
             JAXBWrapperTool wrapperTool = new JAXBWrapperToolImpl();
-            Object object = wrapperTool.wrap(cls, nameList, objectList,
+            Object object = wrapperTool.wrap(cls, nameList, objectList, declaredClassMap,
                                              marshalDesc.getPropertyDescriptorMap(cls));
 
             QName wrapperQName = new QName(operationDesc.getResponseWrapperTargetNamespace(),
@@ -632,6 +637,7 @@
             // Create the inputs to the wrapper tool
             ArrayList<String> nameList = new ArrayList<String>();
             Map<String, Object> objectList = new HashMap<String, Object>();
+            Map<String, Class> declardClassMap = new HashMap<String, Class>();
             List<PDElement> headerPDEList = new ArrayList<PDElement>();
 
             Iterator<PDElement> it = pdeList.iterator();
@@ -642,8 +648,10 @@
                     // Normal case:
                     // The object list contains type rendered objects
                     Object value = pde.getElement().getTypeValue();
+                    Class dclClass = pde.getParam().getParameterActualType();
                     nameList.add(name);
                     objectList.put(name, value);
+                    declardClassMap.put(name, dclClass);
                 } else {
                     // Header Case:
                     // Remove the header from the list, it will
@@ -662,7 +670,7 @@
                 cls = MethodMarshallerUtils.loadClass(wrapperName, endpointDesc.getAxisService().getClassLoader());
             }
             JAXBWrapperTool wrapperTool = new JAXBWrapperToolImpl();
-            Object object = wrapperTool.wrap(cls, nameList, objectList,
+            Object object = wrapperTool.wrap(cls, nameList, objectList, declardClassMap,
                                              marshalDesc.getPropertyDescriptorMap(cls));
 
             QName wrapperQName = new QName(operationDesc.getRequestWrapperTargetNamespace(),

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/LegacyExceptionUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/LegacyExceptionUtil.java?rev=718408&r1=718407&r2=718408&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/LegacyExceptionUtil.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/LegacyExceptionUtil.java
Mon Nov 17 14:10:23 2008
@@ -137,7 +137,7 @@
 
                 // Get the map of child objects
                 Map<String, Object> childObjects = getChildObjectsMap(t, pdMap);
-
+                Map<String, Class> declaringClass = new HashMap<String, Class>();
                 List<String> childNames = new ArrayList<String>(childObjects.keySet());
 
                 if (log.isErrorEnabled()) {
@@ -148,7 +148,7 @@
                 Map<String, PropertyDescriptorPlus> pdMapForBean =
                         marshalDesc.getPropertyDescriptorMap(faultBeanClass);
                 faultBean =
-                        wrapperTool.wrap(faultBeanClass, childNames, childObjects, pdMapForBean);
+                        wrapperTool.wrap(faultBeanClass, childNames, childObjects, declaringClass,
pdMapForBean);
                 if (log.isErrorEnabled()) {
                     log.debug("Completed creation of the fault bean.");
                 }

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/utility/PropertyDescriptorPlus.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/utility/PropertyDescriptorPlus.java?rev=718408&r1=718407&r2=718408&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/utility/PropertyDescriptorPlus.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/utility/PropertyDescriptorPlus.java
Mon Nov 17 14:10:23 2008
@@ -150,7 +150,7 @@
      * @throws IllegalAccessException
      * @throws JAXBWrapperException
      */
-    public void set(Object targetBean, Object propValue)
+    public void set(Object targetBean, Object propValue, Class dclClass)
             throws InvocationTargetException, IllegalAccessException, JAXBWrapperException
{
 
         Method writeMethod  = null;
@@ -174,7 +174,7 @@
                 setList(targetBean, propValue);
             } else if (descriptor.getPropertyType() == JAXBElement.class) {
                 if (propValue != null) {
-                    Class clazz = propValue.getClass();
+                    Class clazz = dclClass!=null ? dclClass : propValue.getClass();
                     JAXBElement element = new JAXBElement(xmlName, clazz, propValue);
                     setAtomic(targetBean, element, writeMethod);
                 }

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/wrapper/JAXBWrapperTool.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/wrapper/JAXBWrapperTool.java?rev=718408&r1=718407&r2=718408&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/wrapper/JAXBWrapperTool.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/wrapper/JAXBWrapperTool.java
Mon Nov 17 14:10:23 2008
@@ -68,6 +68,7 @@
     public Object wrap(Class jaxbClass,
                        List<String> childNames,
                        Map<String, Object> childObjects,
+                       Map<String, Class> declaredClassMap,
                        Map<String, PropertyDescriptorPlus> pdMap) throws JAXBWrapperException;
 
     /**

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/wrapper/impl/JAXBWrapperToolImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/wrapper/impl/JAXBWrapperToolImpl.java?rev=718408&r1=718407&r2=718408&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/wrapper/impl/JAXBWrapperToolImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/wrapper/impl/JAXBWrapperToolImpl.java
Mon Nov 17 14:10:23 2008
@@ -28,6 +28,7 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -117,6 +118,7 @@
     public Object wrap(Class jaxbClass,
                        List<String> childNames,
                        Map<String, Object> childObjects,
+                       Map<String, Class> declaredClassMap,
                        Map<String, PropertyDescriptorPlus> pdMap) throws JAXBWrapperException
{
 
 
@@ -153,13 +155,14 @@
         for (String childName : childNames) {
             PropertyDescriptorPlus propInfo = pdMap.get(childName);
             Object value = childObjects.get(childName);
+            Class dclClass = declaredClassMap.get(childName);
             if (propInfo == null) {
                 throw new JAXBWrapperException(Messages.getMessage("JAXBWrapperErr6", 
                                                                    jaxbClass.getName(), 
                                                                    childName));
             }
             try {
-                propInfo.set(jaxbObject, value);
+                propInfo.set(jaxbObject, value, dclClass);
             } catch (Throwable t) {
 
                 if (log.isDebugEnabled()) {
@@ -261,9 +264,9 @@
             log.debug("  The JAXBClass is:" + jaxbClass.getName());
             throw new JAXBWrapperException(t);
         }
-
+        HashMap<String, Class> declaringClass = new HashMap<String, Class>();
         // Delegate
-        return wrap(jaxbClass, childNames, childObjects, pdMap);
+        return wrap(jaxbClass, childNames, childObjects, declaringClass, pdMap);
     }
 
 

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/utility/PropertyDescriptorPlusTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/utility/PropertyDescriptorPlusTests.java?rev=718408&r1=718407&r2=718408&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/utility/PropertyDescriptorPlusTests.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/utility/PropertyDescriptorPlusTests.java
Mon Nov 17 14:10:23 2008
@@ -47,7 +47,7 @@
         assertNotNull(propertyDescriptor);
         PropertyDescriptorPlus plus = new PropertyDescriptorPlus(propertyDescriptor, qName);
         byte[] testValue = {0xd, 0xe, 0xa, 0xd, 0xb, 0xe, 0xe, 0xf};
-        plus.set(object, testValue);
+        plus.set(object, testValue, null);
 
         JAXBElement<byte[]> arg0 = object.getArg0();
         assertEquals(arg0.getDeclaredType(), byte[].class);



Mime
View raw message