Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 79173 invoked from network); 9 Apr 2007 22:55:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Apr 2007 22:55:28 -0000 Received: (qmail 81681 invoked by uid 500); 9 Apr 2007 22:55:34 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 81582 invoked by uid 500); 9 Apr 2007 22:55:34 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 81571 invoked by uid 500); 9 Apr 2007 22:55:34 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 81568 invoked by uid 99); 9 Apr 2007 22:55:33 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Apr 2007 15:55:33 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Apr 2007 15:55:26 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 08CDD1A983E; Mon, 9 Apr 2007 15:55:05 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r526943 [2/2] - in /webservices/axis2/trunk/java/modules: jaxws/ jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/ jaxws/src/org/apache/axis2/jaxws/message/databinding/ jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/ jaxws/te... Date: Mon, 09 Apr 2007 22:55:04 -0000 To: axis2-cvs@ws.apache.org From: nthaker@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070409225506.08CDD1A983E@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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?view=diff&rev=526943&r1=526942&r2=526943 ============================================================================== --- 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 Mon Apr 9 15:55:00 2007 @@ -33,6 +33,7 @@ import org.apache.axis2.jaxws.message.XMLFaultReason; import org.apache.axis2.jaxws.message.databinding.JAXBBlockContext; import org.apache.axis2.jaxws.message.databinding.JAXBUtils; +import org.apache.axis2.jaxws.message.databinding.XSDListUtils; import org.apache.axis2.jaxws.message.factory.JAXBBlockFactory; import org.apache.axis2.jaxws.message.util.XMLFaultUtils; import org.apache.axis2.jaxws.registry.FactoryRegistry; @@ -57,6 +58,7 @@ import javax.xml.ws.ProtocolException; import javax.xml.ws.WebServiceException; import javax.xml.ws.soap.SOAPFaultException; +import java.lang.reflect.Array; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -65,7 +67,9 @@ import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import java.util.ArrayList; +import java.util.Arrays; import java.util.Calendar; +import java.util.Collection; import java.util.Date; import java.util.GregorianCalendar; import java.util.List; @@ -146,7 +150,24 @@ // Create an Element rendering Element element = null; if (!marshalDesc.getAnnotationDesc(formalType).hasXmlRootElement()) { - element = new Element(value, qName, formalType); + /* when a schema defines a SimpleType with xsd list jaxws tooling generates art-effects with array rather than a java.util.List + * However the ObjectFactory definition uses a List and thus marshalling fails. Lets convert the Arrays to List and recreate + * the JAXBElements for the same. + */ + if(pd.isListType()){ + + List list= new ArrayList(); + if(formalType.isArray()){ + for(int count = 0; count < Array.getLength(value); count++){ + Object obj = Array.get(value, count); + list.add(obj); + } + element = new Element(list, qName, List.class); + } + } + else{ + element = new Element(value, qName, formalType); + } } else { element = new Element(value, qName); } Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/XSDListUtils.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/XSDListUtils.java?view=diff&rev=526943&r1=526942&r2=526943 ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/XSDListUtils.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/XSDListUtils.java Mon Apr 9 15:55:00 2007 @@ -77,7 +77,7 @@ IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException { // TODO only supports arrays right now. Need to implement this for List - if (container.getClass().isArray()) { + if (container !=null && container.getClass().isArray()) { String xsdString = ""; for (int i = 0; i < Array.getLength(container); i++) { Object component = Array.get(container, i); @@ -87,7 +87,20 @@ xsdString += getAsText(component); } return xsdString; - } else { + + } else if(container!=null && List.class.isAssignableFrom(container.getClass())){ + String xsdString = ""; + List containerAsList = (List)container; + for (Object component:containerAsList) { + if (xsdString.length() != 0) { + xsdString += " "; + } + xsdString += getAsText(component); + } + return xsdString; + + } + else { throw new IllegalArgumentException(container.getClass().toString()); } } @@ -129,7 +142,7 @@ } Object array = Array.newInstance(arrayType, list.size()); return list.toArray((Object[])array); - } else { + }else { throw new IllegalArgumentException(type.toString()); } } Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/JAXBBlockImpl.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/JAXBBlockImpl.java?view=diff&rev=526943&r1=526942&r2=526943 ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/JAXBBlockImpl.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/JAXBBlockImpl.java Mon Apr 9 15:55:00 2007 @@ -423,4 +423,5 @@ } return obj; } + } Added: webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/StringList.wsdl URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/StringList.wsdl?view=auto&rev=526943 ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/StringList.wsdl (added) +++ webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/StringList.wsdl Mon Apr 9 15:55:00 2007 @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java?view=diff&rev=526943&r1=526942&r2=526943 ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java Mon Apr 9 15:55:00 2007 @@ -72,6 +72,7 @@ import org.apache.axis2.jaxws.sample.FaultyWebServiceTests; import org.apache.axis2.jaxws.sample.MtomSampleTests; import org.apache.axis2.jaxws.sample.NonWrapTests; +import org.apache.axis2.jaxws.sample.StringListTests; import org.apache.axis2.jaxws.sample.WSGenTests; import org.apache.axis2.jaxws.sample.WrapTests; import org.apache.axis2.jaxws.security.BasicAuthSecurityTests; @@ -178,7 +179,7 @@ suite.addTestSuite(SchemaReaderTests.class); suite.addTestSuite(RPCLitEnumTests.class); suite.addTestSuite(BindingProviderTests.class); - + suite.addTestSuite(StringListTests.class); // Start (and stop) the server only once for all the tests TestSetup testSetup = new TestSetup(suite) { public void setUp() { Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/StringListTests.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/StringListTests.java?view=auto&rev=526943 ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/StringListTests.java (added) +++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/StringListTests.java Mon Apr 9 15:55:00 2007 @@ -0,0 +1,42 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.axis2.jaxws.sample; + +import org.apache.axis2.jaxws.stringlist.sei.StringListPortType; +import org.apache.axis2.jaxws.stringlist.sei.StringListService; + +import junit.framework.TestCase; + + +public class StringListTests extends TestCase{ + public void testStringListScenario(){ + System.out.println("----------------------------------"); + System.out.println("test: " + getName()); + try{ + StringListService sls = new StringListService(); + StringListPortType portType =sls.getStringListPort(); + String[] retString = portType.stringList(new String[]{"String1","String2","String3"}); + assertNotNull(retString); + assertTrue(retString.length == 3); + }catch(Exception e){ + e.printStackTrace(); + fail(); + } + } +} Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/stringlist/META-INF/StringList.wsdl URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/stringlist/META-INF/StringList.wsdl?view=auto&rev=526943 ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/stringlist/META-INF/StringList.wsdl (added) +++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/stringlist/META-INF/StringList.wsdl Mon Apr 9 15:55:00 2007 @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/stringlist/META-INF/services.xml URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/stringlist/META-INF/services.xml?view=auto&rev=526943 ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/stringlist/META-INF/services.xml (added) +++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/stringlist/META-INF/services.xml Mon Apr 9 15:55:00 2007 @@ -0,0 +1,8 @@ + + + + + + org.apache.axis2.jaxws.stringlist.StringListPortTypeImpl + + Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/stringlist/StringListPortTypeImpl.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/stringlist/StringListPortTypeImpl.java?view=auto&rev=526943 ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/stringlist/StringListPortTypeImpl.java (added) +++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/stringlist/StringListPortTypeImpl.java Mon Apr 9 15:55:00 2007 @@ -0,0 +1,34 @@ +/* + * Copyright 2006 The Apache Software Foundation. + * Copyright 2006 International Business Machines Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.axis2.jaxws.stringlist; + +import javax.jws.WebService; + +import org.apache.axis2.jaxws.stringlist.sei.StringListPortType; + +@WebService(endpointInterface="org.apache.axis2.jaxws.stringlist.sei.StringListPortType") +public class StringListPortTypeImpl implements StringListPortType { + + /* (non-Javadoc) + * @see org.apache.axis2.jaxws.stringlist.sei.StringListPortType#stringList(java.lang.String[]) + */ + public String[] stringList(String[] parameters) { + // TODO Auto-generated method stub + return new String[]{"str1", "str2", "str3"}; + } + +} Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/stringlist/sei/StringListPortType.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/stringlist/sei/StringListPortType.java?view=auto&rev=526943 ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/stringlist/sei/StringListPortType.java (added) +++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/stringlist/sei/StringListPortType.java Mon Apr 9 15:55:00 2007 @@ -0,0 +1,38 @@ + +package org.apache.axis2.jaxws.stringlist.sei; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; +import javax.jws.WebService; +import javax.jws.soap.SOAPBinding; +import javax.jws.soap.SOAPBinding.ParameterStyle; +import javax.xml.bind.annotation.XmlList; + + +/** + * This class was generated by the JAXWS SI. + * JAX-WS RI 2.0_01-b15-fcs + * Generated source version: 2.0 + * + */ +@WebService(name = "StringListPortType", targetNamespace = "http://org/test/StringList") +@SOAPBinding(parameterStyle = ParameterStyle.BARE) +public interface StringListPortType { + + + /** + * + * @param parameters + * @return + * returns java.lang.String[] + */ + @XmlList + @WebMethod(operationName = "StringList") + @WebResult(name = "StringListResponse", targetNamespace = "http://org/test/StringList", partName = "result") + public String[] stringList( + @XmlList + @WebParam(name = "StringList", targetNamespace = "http://org/test/StringList", partName = "parameters") + String[] parameters); + +} Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/stringlist/sei/StringListService.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/stringlist/sei/StringListService.java?view=auto&rev=526943 ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/stringlist/sei/StringListService.java (added) +++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/stringlist/sei/StringListService.java Mon Apr 9 15:55:00 2007 @@ -0,0 +1,61 @@ + +package org.apache.axis2.jaxws.stringlist.sei; + +import java.io.File; +import java.net.MalformedURLException; +import java.net.URL; +import javax.xml.namespace.QName; +import javax.xml.ws.Service; +import javax.xml.ws.WebEndpoint; +import javax.xml.ws.WebServiceClient; + + +/** + * This class was generated by the JAXWS SI. + * JAX-WS RI 2.0_01-b15-fcs + * Generated source version: 2.0 + * + */ +@WebServiceClient(name = "StringListService", targetNamespace = "http://org/test/StringList", wsdlLocation = "StringList.wsdl") +public class StringListService + extends Service +{ + + private final static URL STRINGLISTSERVICE_WSDL_LOCATION; + private static String wsdlLocation="/test/org/apache/axis2/jaxws/stringlist/META-INF/StringList.wsdl"; + static { + URL url = null; + try { + try{ + String baseDir = new File(System.getProperty("basedir",".")).getCanonicalPath(); + wsdlLocation = new File(baseDir + wsdlLocation).getAbsolutePath(); + }catch(Exception e){ + e.printStackTrace(); + } + File file = new File(wsdlLocation); + url = file.toURL(); + } catch (MalformedURLException e) { + e.printStackTrace(); + } + STRINGLISTSERVICE_WSDL_LOCATION = url; + } + + public StringListService(URL wsdlLocation, QName serviceName) { + super(wsdlLocation, serviceName); + } + + public StringListService() { + super(STRINGLISTSERVICE_WSDL_LOCATION, new QName("http://org/test/StringList", "StringListService")); + } + + /** + * + * @return + * returns StringListPortType + */ + @WebEndpoint(name = "StringListPort") + public StringListPortType getStringListPort() { + return (StringListPortType)super.getPort(new QName("http://org/test/StringList", "StringListPort"), StringListPortType.class); + } + +} Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/OperationDescription.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/OperationDescription.java?view=diff&rev=526943&r1=526942&r2=526943 ============================================================================== --- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/OperationDescription.java (original) +++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/OperationDescription.java Mon Apr 9 15:55:00 2007 @@ -68,6 +68,9 @@ public ParameterDescription getParameterDescription(String parameterName); public ParameterDescription[] getParameterDescriptions(); + + // indicates whether or not an @XmlList annotation was found on the method + public boolean isListType(); public abstract AxisOperation getAxisOperation(); Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/ParameterDescription.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/ParameterDescription.java?view=diff&rev=526943&r1=526942&r2=526943 ============================================================================== --- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/ParameterDescription.java (original) +++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/ParameterDescription.java Mon Apr 9 15:55:00 2007 @@ -59,7 +59,10 @@ public String getPartName(); public boolean isHolderType(); - + + // Indicates whether or not an @XMLList annotation was found on a parameter + public boolean isListType(); + public Class getParameterType(); public Class getParameterActualType(); Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/FieldDescriptionComposite.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/FieldDescriptionComposite.java?view=diff&rev=526943&r1=526942&r2=526943 ============================================================================== --- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/FieldDescriptionComposite.java (original) +++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/FieldDescriptionComposite.java Mon Apr 9 15:55:00 2007 @@ -9,6 +9,9 @@ //Method reflective information private String fieldName; //field name private String modifierType; //field modifier + + // indicates whether the field was annotated with @XmlList or not + private boolean isListType = false; private HandlerChainAnnot handlerChainAnnot; private WebServiceRefAnnot webServiceRefAnnot; @@ -72,6 +75,14 @@ this.webServiceRefAnnot = webServiceRefAnnot; } + public void setIsListType(boolean isListType) { + this.isListType = isListType; + } + + public boolean isListType() { + return isListType; + } + /** * Convenience method for unit testing. We will print all of the * data members here. Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/MethodDescriptionComposite.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/MethodDescriptionComposite.java?view=diff&rev=526943&r1=526942&r2=526943 ============================================================================== --- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/MethodDescriptionComposite.java (original) +++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/MethodDescriptionComposite.java Mon Apr 9 15:55:00 2007 @@ -16,6 +16,8 @@ private String declaringClass; //the class/interface that actually declares this method boolean oneWayAnnotated; + // boolean that indicates if an @XmlList annotation was found on the method + private boolean isListType = false; private WebMethodAnnot webMethodAnnot; private WebResultAnnot webResultAnnot; private WebServiceContextAnnot webServiceContextAnnot; @@ -337,6 +339,14 @@ } } + public void setIsListType(boolean isListType) { + this.isListType = isListType; + } + + public boolean isListType() { + return isListType; + } + /** * Convenience method for unit testing. We will print all of the * data members here. Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/ParameterDescriptionComposite.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/ParameterDescriptionComposite.java?view=diff&rev=526943&r1=526942&r2=526943 ============================================================================== --- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/ParameterDescriptionComposite.java (original) +++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/ParameterDescriptionComposite.java Mon Apr 9 15:55:00 2007 @@ -10,6 +10,8 @@ private WebServiceRefAnnot webServiceRefAnnot; private WebServiceContextAnnot webServiceContextAnnot; private int listOrder; + // Will indicate whether or not we found an @XMLList annotation on the parameter + private boolean isListType; private MethodDescriptionComposite parentMDC; @@ -173,6 +175,15 @@ } } + + public void setIsListType(boolean isListType) { + this.isListType = isListType; + } + + public boolean isListType() { + return isListType; + } + /** Convenience method for unit testing. We will print all of the data members here. */ public String toString() { StringBuffer sb = new StringBuffer(); @@ -207,4 +218,5 @@ public boolean isHolderType() { return DescriptionBuilderUtils.isHolderType(parameterType); } + } Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java?view=diff&rev=526943&r1=526942&r2=526943 ============================================================================== --- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java (original) +++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java Mon Apr 9 15:55:00 2007 @@ -47,6 +47,7 @@ import javax.jws.WebParam.Mode; import javax.jws.WebResult; import javax.jws.soap.SOAPBinding; +import javax.xml.bind.annotation.XmlList; import javax.xml.namespace.QName; import javax.xml.ws.AsyncHandler; import javax.xml.ws.RequestWrapper; @@ -94,6 +95,9 @@ private Oneway onewayAnnotation; private Boolean onewayIsOneway; + // ANNOTATION: @XmlList + private boolean isListType = false; + // ANNOTATION: @RequestWrapper private RequestWrapper requestWrapperAnnotation; private String requestWrapperTargetNamespace; @@ -162,7 +166,7 @@ // TODO: Look for WebMethod anno; get name and action off of it parentEndpointInterfaceDescription = parent; setSEIMethod(method); - + checkForXmlListAnnotation(method.getAnnotations()); // The operationQName is intentionally unqualified to be consistent with the remaining parts of the system. // Using a qualified name will cause breakage. // Don't do --> this.operationQName = new QName(parent.getTargetNamespace(), getOperationName()); @@ -190,6 +194,7 @@ parameterDescriptions = createParameterDescriptions(); faultDescriptions = createFaultDescriptions(); + isListType = mdc.isListType(); //If an AxisOperation was already created for us by populateService then just use that one //Otherwise, create it @@ -1488,6 +1493,18 @@ runtimeDescMap.put(ord.getKey(), ord); } + private void checkForXmlListAnnotation(Annotation[] annotations) { + for(Annotation annotation : annotations) { + if(annotation.annotationType() == XmlList.class) { + isListType = true; + } + } + } + + public boolean isListType() { + return isListType; + } + public String toString() { final String newline = "\n"; final String sameline = "; "; Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ParameterDescriptionImpl.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ParameterDescriptionImpl.java?view=diff&rev=526943&r1=526942&r2=526943 ============================================================================== --- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ParameterDescriptionImpl.java (original) +++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ParameterDescriptionImpl.java Mon Apr 9 15:55:00 2007 @@ -27,6 +27,7 @@ import javax.jws.WebParam; import javax.jws.soap.SOAPBinding; +import javax.xml.bind.annotation.XmlList; import javax.xml.ws.Holder; import java.lang.annotation.Annotation; import java.lang.reflect.Array; @@ -60,7 +61,10 @@ private WebParam.Mode webParamMode; public static final Boolean WebParam_Header_DEFAULT = new Boolean(false); private Boolean webParamHeader; - + + // This boolean indicates whether or not there was an @XMLList on the parameter + private boolean isListType = false; + ParameterDescriptionImpl(int parameterNumber, Class parameterType, Type parameterGenericType, Annotation[] parameterAnnotations, OperationDescription parent) { this.parameterNumber = parameterNumber; @@ -75,6 +79,7 @@ getGenericParameterActualType((ParameterizedType)parameterGenericType); } findWebParamAnnotation(parameterAnnotations); + findXmlListAnnotation(parameterAnnotations); } ParameterDescriptionImpl(int parameterNumber, ParameterDescriptionComposite pdc, @@ -83,6 +88,7 @@ this.parameterNumber = parameterNumber; this.parentOperationDescription = parent; webParamAnnotation = pdc.getWebParamAnnot(); + this.isListType = pdc.isListType(); //TODO: Need to build the schema map. Need to add logic to add this parameter // to the schema map. @@ -107,6 +113,18 @@ } } + /** + * This method will search array of parameter annotations for the presence of the @XmlList + * annotation. + */ + private void findXmlListAnnotation(Annotation[] annotations) { + for (Annotation checkAnnotation:annotations) { + if (checkAnnotation.annotationType() == XmlList.class) { + isListType = true; + } + } + } + public OperationDescription getOperationDescription() { return parentOperationDescription; } @@ -363,5 +381,9 @@ return string.toString(); } return string.toString(); + } + + public boolean isListType() { + return isListType; } } --------------------------------------------------------------------- To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org For additional commands, e-mail: axis-cvs-help@ws.apache.org