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 nt...@apache.org on 2007/06/22 18:49:07 UTC
svn commit: r549873 - in /webservices/axis2/trunk/java/modules/jaxws: ./
src/org/apache/axis2/jaxws/marshaller/impl/alt/
src/org/apache/axis2/jaxws/message/databinding/
src/org/apache/axis2/jaxws/message/databinding/impl/
src/org/apache/axis2/jaxws/uti...
Author: nthaker
Date: Fri Jun 22 09:49:05 2007
New Revision: 549873
URL: http://svn.apache.org/viewvc?view=rev&rev=549873
Log:
JIRA - Axis2-2841
JIRA - Axis2-2640
Added:
webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/rpclitstringarray.wsdl
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/EchoImpl.java
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/META-INF/
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/META-INF/rpclitstringarray.wsdl
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/META-INF/services.xml
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/sei/
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/sei/Echo.java
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/sei/RPCLitStringArrayService.java
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/tests/
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/tests/RPCLitStringArrayTests.java
Modified:
webservices/axis2/trunk/java/modules/jaxws/maven.xml
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMinimalMethodMarshaller.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMinimalMethodMarshaller.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/MethodMarshallerUtils.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/RPCLitMethodMarshaller.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBBlockContext.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBUtils.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/JAXBBlockImpl.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/utility/XMLRootElementUtil.java
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java
Modified: webservices/axis2/trunk/java/modules/jaxws/maven.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/maven.xml?view=diff&rev=549873&r1=549872&r2=549873
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/maven.xml (original)
+++ webservices/axis2/trunk/java/modules/jaxws/maven.xml Fri Jun 22 09:49:05 2007
@@ -260,6 +260,14 @@
<arg line="-d ${schema.generated.src.dir} -quiet -wsdl ${wsdl.source.dir}/rpclitenum.wsdl"/>
</java>
+ <ant:echo>Generating java from rpclitstringarray.wsdl</ant:echo>
+ <java classname="com.sun.tools.xjc.Driver" fork="true">
+ <jvmarg line="${maven.junit.jvmargs2}"/>
+ <classpath refid="maven.dependency.classpath"/>
+ <classpath location="${compiled.classes.dir}"/>
+ <arg line="-d ${schema.generated.src.dir} -quiet -wsdl ${wsdl.source.dir}/rpclitstringarray.wsdl"/>
+ </java>
+
<ant:echo>Generating java from StringList.wsdl</ant:echo>
<java classname="com.sun.tools.xjc.Driver" fork="true">
<jvmarg line="${maven.junit.jvmargs2}"/>
@@ -764,7 +772,18 @@
<ant:include name="org/apache/axis2/jaxws/server/**"/>
</ant:fileset>
</ant:copy>
-
+ <ant:copy toDir="target/test-classes/services/RPCLitStringArrayService/">
+ <ant:fileset dir="target/test-classes">
+ <ant:include name="org/apache/axis2/jaxws/rpclit/stringarray/**"/>
+ <ant:include name="org/test/rpclit/stringarray/**"/>
+ </ant:fileset>
+ <ant:fileset dir="test/org/apache/axis2/jaxws/rpclit/stringarray/">
+ <ant:include name="META-INF/**"/>
+ </ant:fileset>
+ <ant:fileset dir="target/classes">
+ <ant:include name="org/apache/axis2/jaxws/server/**"/>
+ </ant:fileset>
+ </ant:copy>
</postGoal>
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java?view=diff&rev=549873&r1=549872&r2=549873
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java Fri Jun 22 09:49:05 2007
@@ -87,14 +87,14 @@
Element returnElement = null;
if (operationDesc.isResultHeader()) {
returnElement =
- MethodMarshallerUtils.getReturnElement(packages, message, null, true,
+ MethodMarshallerUtils.getReturnElement(packages, message, null, false, true,
operationDesc.getResultTargetNamespace(),
operationDesc.getResultName(),
MethodMarshallerUtils.numOutputBodyParams(pds) > 0);
} else {
returnElement = MethodMarshallerUtils
- .getReturnElement(packages, message, null, false, null, null,
+ .getReturnElement(packages, message, null, false, false, null, null,
MethodMarshallerUtils.numOutputBodyParams(pds) > 0);
hasReturnInBody = true;
}
@@ -232,8 +232,11 @@
returnElement = new Element(returnObject, returnQName, returnType);
}
}
- MethodMarshallerUtils.toMessage(returnElement, returnType,
- marshalDesc, m,
+ MethodMarshallerUtils.toMessage(returnElement,
+ returnType,
+ operationDesc.isListType(),
+ marshalDesc,
+ m,
null, // always marshal using "by element" mode
operationDesc.isResultHeader());
}
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMinimalMethodMarshaller.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMinimalMethodMarshaller.java?view=diff&rev=549873&r1=549872&r2=549873
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMinimalMethodMarshaller.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMinimalMethodMarshaller.java Fri Jun 22 09:49:05 2007
@@ -96,14 +96,14 @@
Element returnElement = null;
if (operationDesc.isResultHeader()) {
returnElement = MethodMarshallerUtils
- .getReturnElement(packages, message, byJavaType, true,
+ .getReturnElement(packages, message, byJavaType, operationDesc.isListType(), true,
operationDesc.getResultTargetNamespace(),
operationDesc.getResultName(),
MethodMarshallerUtils.numOutputBodyParams(pds) > 0);
} else {
returnElement = MethodMarshallerUtils
- .getReturnElement(packages, message, byJavaType, false, null, null,
+ .getReturnElement(packages, message, byJavaType, operationDesc.isListType(), false, null, null,
MethodMarshallerUtils.numOutputBodyParams(pds) > 0);
hasReturnInBody = true;
}
@@ -258,7 +258,7 @@
} else {
returnElement = new Element(returnObject, returnQName, returnType);
}
- MethodMarshallerUtils.toMessage(returnElement, returnType,
+ MethodMarshallerUtils.toMessage(returnElement, returnType, operationDesc.isListType(),
marshalDesc, m,
byJavaType,
operationDesc.isResultHeader());
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMinimalMethodMarshaller.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMinimalMethodMarshaller.java?view=diff&rev=549873&r1=549872&r2=549873
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMinimalMethodMarshaller.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMinimalMethodMarshaller.java Fri Jun 22 09:49:05 2007
@@ -306,6 +306,7 @@
}
MethodMarshallerUtils.toMessage(returnElement,
returnType,
+ operationDesc.isListType(),
marshalDesc,
m,
returnType, // force marshal by type
@@ -388,7 +389,7 @@
returnElement = MethodMarshallerUtils.getReturnElement(packages,
message,
returnType,
- // Hmm we may want to refine this
+ operationDesc.isListType(),
true, // is a header
operationDesc.getResultTargetNamespace(),
// header ns
@@ -399,7 +400,7 @@
returnElement = MethodMarshallerUtils.getReturnElement(packages,
message,
returnType,
- // Force Unmarshal by type
+ operationDesc.isListType(),
false,
null,
null,
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?view=diff&rev=549873&r1=549872&r2=549873
==============================================================================
--- 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 Fri Jun 22 09:49:05 2007
@@ -222,6 +222,7 @@
Class actualType = pd.getParameterActualType();
if (MethodMarshallerUtils.isNotJAXBRootElement(actualType, marshalDesc)) {
blkContext.setProcessType(actualType);
+ blkContext.setIsxmlList(pd.isListType());
}
}
block = message.getHeaderBlock(pd.getTargetNamespace(), localName, blkContext,
@@ -247,7 +248,7 @@
} else {
// Header result: Get the value from the headers
Element returnElement =
- MethodMarshallerUtils.getReturnElement(packages, message, null, true,
+ MethodMarshallerUtils.getReturnElement(packages, message, null, false, true,
operationDesc.getResultTargetNamespace(),
operationDesc.getResultPartName(),
false);
@@ -379,6 +380,7 @@
Annotation annos[] = actualType.getAnnotations();
if (annos == null || annos.length == 0) {
blkContext.setProcessType(actualType);
+ blkContext.setIsxmlList(pd.isListType());
}
}
}
@@ -507,8 +509,11 @@
Class byJavaType =
MethodMarshallerUtils.isNotJAXBRootElement(returnType, marshalDesc) ? returnType : null;
- MethodMarshallerUtils.toMessage(returnElement, returnType,
- marshalDesc, m,
+ MethodMarshallerUtils.toMessage(returnElement,
+ returnType,
+ operationDesc.isListType(),
+ marshalDesc,
+ m,
byJavaType,
true);
}
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=549873&r1=549872&r2=549873
==============================================================================
--- 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 Fri Jun 22 09:49:05 2007
@@ -242,6 +242,7 @@
// Trigger unmarshal by java type if necessary
if (unmarshalByJavaType != null && unmarshalByJavaType[i] != null) {
context.setProcessType(unmarshalByJavaType[i]);
+ context.setIsxmlList(pd.isListType());
}
// Unmarshal the object into a JAXB object or JAXBElement
@@ -418,6 +419,9 @@
// Marshal by type only if necessary
if (pde.getByJavaTypeClass() != null) {
context.setProcessType(pde.getByJavaTypeClass());
+ if(pde.getParam()!=null){
+ context.setIsxmlList(pde.getParam().isListType());
+ }
}
// Create a JAXBBlock out of the value.
@@ -460,6 +464,7 @@
*/
static void toMessage(Element returnElement,
Class returnType,
+ boolean isList,
MarshalServiceRuntimeDescription marshalDesc,
Message message,
Class marshalByJavaTypeClass,
@@ -471,6 +476,7 @@
JAXBBlockContext context = new JAXBBlockContext(marshalDesc.getPackages());
if (marshalByJavaTypeClass != null) {
context.setProcessType(marshalByJavaTypeClass);
+ context.setIsxmlList(isList);
}
// Create a JAXBBlock out of the value.
@@ -504,6 +510,7 @@
static Element getReturnElement(TreeSet<String> packages,
Message message,
Class unmarshalByJavaTypeClass, // normally null
+ boolean isList,
boolean isHeader,
String headerNS,
String headerLocalPart,
@@ -515,6 +522,7 @@
JAXBBlockContext context = new JAXBBlockContext(packages);
if (unmarshalByJavaTypeClass != null && !isHeader) {
context.setProcessType(unmarshalByJavaTypeClass);
+ context.setIsxmlList(isList);
}
Block block = null;
if (isHeader) {
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/RPCLitMethodMarshaller.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/RPCLitMethodMarshaller.java?view=diff&rev=549873&r1=549872&r2=549873
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/RPCLitMethodMarshaller.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/RPCLitMethodMarshaller.java Fri Jun 22 09:49:05 2007
@@ -322,6 +322,7 @@
}
MethodMarshallerUtils.toMessage(returnElement,
returnType,
+ operationDesc.isListType(),
marshalDesc,
m,
byJavaType,
@@ -410,14 +411,14 @@
}
if (operationDesc.isResultHeader()) {
returnElement = MethodMarshallerUtils
- .getReturnElement(packages, message, byJavaType, true,
+ .getReturnElement(packages, message, byJavaType, operationDesc.isListType(), true,
operationDesc.getResultTargetNamespace(),
operationDesc.getResultPartName(),
MethodMarshallerUtils.numOutputBodyParams(pds) > 0);
} else {
returnElement = MethodMarshallerUtils
- .getReturnElement(packages, message, byJavaType, false, null, null,
+ .getReturnElement(packages, message, byJavaType, operationDesc.isListType(), false, null, null,
MethodMarshallerUtils.numOutputBodyParams(pds) > 0);
hasReturnInBody = true;
}
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBBlockContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBBlockContext.java?view=diff&rev=549873&r1=549872&r2=549873
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBBlockContext.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBBlockContext.java Fri Jun 22 09:49:05 2007
@@ -50,6 +50,7 @@
// Please don't use "by java type" processing to get around errors.
private Class processType = null;
+ private boolean isxmlList =false;
/**
* Full Constructor JAXBBlockContext (most performant)
@@ -138,4 +139,13 @@
public JAXBUtils.CONSTRUCTION_TYPE getConstructionType() {
return constructionType;
}
+
+ public boolean isxmlList() {
+ return isxmlList;
+ }
+
+ public void setIsxmlList(boolean isxmlList) {
+ this.isxmlList = isxmlList;
+ }
+
}
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBUtils.java?view=diff&rev=549873&r1=549872&r2=549873
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBUtils.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBUtils.java Fri Jun 22 09:49:05 2007
@@ -302,6 +302,8 @@
String pkg = it.next();
fullList.addAll(getAllClassesFromPackage(pkg, cl));
}
+ //Lets add all common array classes
+ addCommonArrayClasses(fullList);
Class[] classArray = fullList.toArray(new Class[0]);
JAXBContext context = JAXBContext_newInstance(classArray);
if (context != null) {
@@ -672,6 +674,7 @@
}
}
}
+
return classes;
}
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=549873&r1=549872&r2=549873
==============================================================================
--- 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 Fri Jun 22 09:49:05 2007
@@ -39,6 +39,7 @@
import javax.xml.bind.JAXBIntrospector;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
+import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
@@ -48,8 +49,11 @@
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.security.PrivilegedAction;
+import java.text.ParseException;
import java.io.StringReader;
import java.io.StringWriter;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import java.util.List;
/**
@@ -62,6 +66,8 @@
private static final Log log = LogFactory.getLog(JAXBBlockImpl.class);
+ private static final boolean DEBUG_ENABLED = log.isDebugEnabled();
+
/**
* Called by JAXBBlockFactory
*
@@ -117,7 +123,7 @@
jaxb = unmarshalByElement(u,
reader); // preferred and always used for style=document
} else {
- jaxb = unmarshalByType(u, reader, ctx.getProcessType());
+ jaxb = unmarshalByType(u, reader, ctx.getProcessType(), ctx.isxmlList(), ctx.getConstructionType());
}
// Successfully unmarshalled the object
@@ -190,7 +196,7 @@
if (ctx.getProcessType() == null) {
marshalByElement(busObject, m, writer);
} else {
- marshalByType(busObject, m, writer, ctx.getProcessType());
+ marshalByType(busObject, m, writer, ctx.getProcessType(), ctx.isxmlList(), ctx.getConstructionType());
}
// Successfully marshalled the data
@@ -277,45 +283,96 @@
* @param writer XMLStreamWriter
* @param type
*/
- private static void marshalByType(Object b, Marshaller m, XMLStreamWriter writer, Class type)
+ private static void marshalByType(final Object b, final Marshaller m,
+ final XMLStreamWriter writer, final Class type, final boolean isList, final JAXBUtils.CONSTRUCTION_TYPE ctype)
throws WebServiceException {
// TODO Log and trace here would be helpful
- try {
-
- // NOTE
- // Example:
- // <xsd:simpleType name="LongList">
- // <xsd:list>
- // <xsd:simpleType>
- // <xsd:restriction base="xsd:unsignedInt"/>
- // </xsd:simpleType>
- // </xsd:list>
- // </xsd:simpleType>
- // <element name="myLong" nillable="true" type="impl:LongList"/>
- //
- // LongList will be represented as an int[]
- // On the wire myLong will be represented as a list of integers
- // with intervening whitespace
- // <myLong>1 2 3</myLong>
- //
- // Unfortunately, we are trying to marshal by type. Therefore
- // we want to marshal an element (foo) that is unknown to schema.
- // If we use the normal marshal code, the wire will look like
- // this (which is incorrect):
- // <foo><item>1</item><item>2</item><item>3</item></foo>
- //
- // The solution is to detect this situation and marshal the
- // String instead. Then we get the correct wire format:
- // <foo>1 2 3</foo>
- if (isXSDList(type)) {
- QName qName = XMLRootElementUtil.getXmlRootElementQNameFromObject(b);
- String text = XSDListUtils.toXSDListString(getTypeEnabledObject(b));
- b = new JAXBElement(qName, String.class, text);
- }
- m.marshal(b, writer);
- } catch (Exception e) {
- throw ExceptionFactory.makeWebServiceException(e);
- }
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ try {
+
+ // NOTE
+ // Example:
+ // <xsd:simpleType name="LongList">
+ // <xsd:list>
+ // <xsd:simpleType>
+ // <xsd:restriction base="xsd:unsignedInt"/>
+ // </xsd:simpleType>
+ // </xsd:list>
+ // </xsd:simpleType>
+ // <element name="myLong" nillable="true" type="impl:LongList"/>
+ //
+ // LongList will be represented as an int[]
+ // On the wire myLong will be represented as a list of integers
+ // with intervening whitespace
+ // <myLong>1 2 3</myLong>
+ //
+ // Unfortunately, we are trying to marshal by type. Therefore
+ // we want to marshal an element (foo) that is unknown to schema.
+ // If we use the normal marshal code, the wire will look like
+ // this (which is incorrect):
+ // <foo><item>1</item><item>2</item><item>3</item></foo>
+ //
+ // The solution is to detect this situation and marshal the
+ // String instead. Then we get the correct wire format:
+ // <foo>1 2 3</foo>
+ Object jbo = b;
+
+ if (isList || (type!=null && type.isArray())) {
+ if(log.isDebugEnabled()){
+ log.debug("marshalling type which is a List or Array");
+ }
+ //We conver to xsdListString only if the type is not known
+ // to the context. In case a jaxbcontext is created from package
+ // the array types or list are not know to the context.
+ if(ctype == JAXBUtils.CONSTRUCTION_TYPE.BY_CONTEXT_PATH){
+ QName qName = XMLRootElementUtil
+ .getXmlRootElementQNameFromObject(b);
+ String text = XSDListUtils
+ .toXSDListString(getTypeEnabledObject(b));
+ jbo = new JAXBElement(qName, String.class, text);
+ }
+ else if(ctype == JAXBUtils.CONSTRUCTION_TYPE.BY_CLASS_ARRAY){
+ //do nothing common array types should be know to the jaxbcontext.
+ //so do not use xsdListString conversion.
+ }
+ }
+
+ // When JAXBContext is created using a context path, it will not include Enum classes
+ // These classes have @XmlEnum annotation but not @XmlType/@XmlElement, so the user
+ // will see MarshallingEx, class not known to ctxt.
+ //
+ // This is a jax-b defect, for now this fix is in place to pass CTS. This only fixes the
+ // situation where the enum is the top-level object (e.g., message-part in rpc-lit scenario)
+ //
+ // Sample of what enum looks like:
+ // @XmlEnum public enum EnumString {
+ // @XmlEnumValue("String1") STRING_1("String1"),
+ // @XmlEnumValue("String2") STRING_2("String2");
+ // ... }
+ if (type.isEnum()){
+ if (b != null){
+ if (DEBUG_ENABLED) {
+ log .debug("marshalByType. Marshaling " + type.getName() + " as Enum");
+ }
+ JAXBElement jbe = (JAXBElement) b;
+ String value = XMLRootElementUtil.getEnumValue((Enum) jbe.getValue());
+
+ jbo = new JAXBElement(jbe.getName(), String.class, value);
+ }
+ }
+
+ if (DEBUG_ENABLED) {
+ log.debug("Invoking marshalByType. Marshaling to an XMLStreamWriter. Object is "
+ + getDebugName(b));
+ }
+ m.marshal(jbo, writer);
+
+ } catch (Exception e) {
+ throw ExceptionFactory.makeWebServiceException(e);
+ }
+ return null;
+ }});
}
/**
@@ -329,41 +386,141 @@
* @return Object
* @throws WebServiceException
*/
- private static Object unmarshalByType(Unmarshaller u, XMLStreamReader reader, Class type)
- throws WebServiceException {
- // TODO Log and trace here would be helpful
- try {
- // Unfortunately RPC is type based. Thus a
- // declared type must be used to unmarshal the xml.
- Object jaxb;
-
- if (!isXSDList(type)) {
- // Normal case: We are not unmarshalling an xsd:list
- jaxb = u.unmarshal(reader, type);
- } else {
- // If this is an xsd:list, we need to return the appropriate list or array (see NOTE above)
- // First unmarshal as a String
- jaxb = u.unmarshal(reader, String.class);
-
- // Second convert the String into a list or array
- if (getTypeEnabledObject(jaxb) instanceof String) {
- QName qName = XMLRootElementUtil.getXmlRootElementQNameFromObject(jaxb);
- Object obj = XSDListUtils
- .fromXSDListString((String)getTypeEnabledObject(jaxb), type);
- jaxb = new JAXBElement(qName, type, obj);
- }
- }
+ private static Object unmarshalByType(final Unmarshaller u,
+ final XMLStreamReader reader, final Class type, final boolean isList, final JAXBUtils.CONSTRUCTION_TYPE ctype) throws WebServiceException {
+
+ if(DEBUG_ENABLED){
+ log.debug("Invoking unmarshalByType.");
+ }
+
+ return AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ try {
+ // Unfortunately RPC is type based. Thus a
+ // declared type must be used to unmarshal the xml.
+ Object jaxb;
+
+ if (!isList) {
+ // case: We are not unmarshalling an xsd:list but an Array.
+
+ if(type.isArray()){
+ //If the context is created using package
+ //we will not have common arrays or type array in the context
+ //so let use a differet way to unmarshal this type
+ if(ctype == JAXBUtils.CONSTRUCTION_TYPE.BY_CONTEXT_PATH){
+ jaxb=unmarshalAsListOrArray(reader, u, type);
+ }
+ //list on client array on server, Can happen only in start from java case.
+ else if((ctype == JAXBUtils.CONSTRUCTION_TYPE.BY_CLASS_ARRAY)){
+ //The type could be any Object or primitive
+ //I will first unmarshall the xmldata to a String[]
+ //Then use the unmarshalled jaxbElement to create
+ //proper type Object Array.
+ jaxb = u.unmarshal(reader, String[].class);
+ Object typeObj = getTypeEnabledObject(jaxb);
+ //Now convert String Array in to the required Type Array.
+ if (getTypeEnabledObject(typeObj) instanceof String[]) {
+ String[] strArray = (String[])typeObj;
+ String strTokens = new String();
+ for(String str:strArray){
+ strTokens = strTokens + " "+str;
+ }
+ QName qName = XMLRootElementUtil
+ .getXmlRootElementQNameFromObject(jaxb);
+ Object obj = XSDListUtils.fromXSDListString(
+ strTokens, type);
+ jaxb = new JAXBElement(qName, type, obj);
+ }
+ }
+ else{
+ jaxb = u.unmarshal(reader, type);
+ }
+
+ }
+ else if (type.isEnum()){
+ // When JAXBContext is created using a context path, it will not include Enum classes
+ // These classes have @XmlEnum annotation but not @XmlType/@XmlElement, so the user
+ // will see MarshallingEx, class not known to ctxt.
+ //
+ // This is a jax-b defect, for now this fix is in place to pass CTS. This only fixes the
+ // situation where the enum is the top-level object (e.g., message-part in rpc-lit scenario)
+ //
+ // Sample of what enum looks like:
+ // @XmlEnum public enum EnumString {
+ // @XmlEnumValue("String1") STRING_1("String1"),
+ // @XmlEnumValue("String2") STRING_2("String2");
+ //
+ // public static getValue(String){} <-- resolves a "value" to an emum object
+ // ... }
+ if (DEBUG_ENABLED) {
+ log .debug("unmarshalByType. Unmarshalling " + type.getName() + " as Enum");
+ }
+
+ JAXBElement<String> enumValue = u.unmarshal(reader, String.class);
+
+ if (enumValue != null) {
+ Method m = type.getMethod("fromValue", new Class[]{String.class});
+ jaxb = m.invoke(null, new Object[] {enumValue.getValue()});
+ } else {
+ jaxb = null;
+ }
+ }
+ //Normal case: We are not unmarshalling a xsd:list or Array
+ else{
+ jaxb = u.unmarshal(reader, type);
+ }
+
+ } else {
+ // If this is an xsd:list, we need to return the appropriate
+ // list or array (see NOTE above)
+ // First unmarshal as a String
+ //Second convert the String into a list or array
+ jaxb = unmarshalAsListOrArray(reader, u, type);
+ }
+ return jaxb;
+ } catch (Exception e) {
+ throw ExceptionFactory.makeWebServiceException(e);
+ }
+ }});
+ }
+
+ /**
+ * convert the String into a list or array
+ * @param <T>
+ * @param jaxb
+ * @param type
+ * @return
+ * @throws IllegalAccessException
+ * @throws ParseException
+ * @throws NoSuchMethodException
+ * @throws InstantiationException
+ * @throws DatatypeConfigurationException
+ * @throws InvocationTargetException
+ */
+ private static Object unmarshalAsListOrArray(XMLStreamReader reader, Unmarshaller u, Class type)
+ throws IllegalAccessException, ParseException, NoSuchMethodException,
+ InstantiationException, DatatypeConfigurationException, InvocationTargetException, JAXBException {
+ //If this is an xsd:list, we need to return the appropriate
+ // list or array (see NOTE above)
+ // First unmarshal as a String
+ Object jaxb = u.unmarshal(reader, String.class);
+ //Second convert the String into a list or array
+ if (getTypeEnabledObject(jaxb) instanceof String) {
+ QName qName = XMLRootElementUtil.getXmlRootElementQNameFromObject(jaxb);
+ Object obj = XSDListUtils.fromXSDListString((String) getTypeEnabledObject(jaxb), type);
+ return new JAXBElement(qName, type, obj);
+ }else{
return jaxb;
- } catch (Exception e) {
- throw ExceptionFactory.makeWebServiceException(e);
}
- }
+
+}
/**
* Detect if t represents an xsd:list
*
* @param t
* @return
+ * @deprecated - Code to check if element is list has been moved to JABXBlockContext.
*/
private static boolean isXSDList(Class t) {
// TODO This code returns true if the
@@ -403,5 +560,9 @@
}
return obj;
}
+
+ private static String getDebugName(Object o) {
+ return (o == null) ? "null" : o.getClass().getCanonicalName();
+ }
}
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/utility/XMLRootElementUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/utility/XMLRootElementUtil.java?view=diff&rev=549873&r1=549872&r2=549873
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/utility/XMLRootElementUtil.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/utility/XMLRootElementUtil.java Fri Jun 22 09:49:05 2007
@@ -22,6 +22,7 @@
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchema;
import javax.xml.namespace.QName;
@@ -97,6 +98,33 @@
}
return new QName(namespace, name);
+ }
+
+ /**
+ * @param clazz
+ * @return namespace of root element qname or null if this is not object does not represent a root element
+ */
+ public static String getEnumValue(Enum myEnum){
+ Field f;
+ String value;
+ try {
+ f = myEnum.getClass().getField(myEnum.name());
+
+ f.setAccessible(true);
+
+ XmlEnumValue xev = f.getAnnotation(XmlEnumValue.class);
+ if (xev == null){
+ value = f.getName();
+ } else {
+ value = xev.value();
+ }
+ } catch (SecurityException e) {
+ value = null;
+ } catch (NoSuchFieldException e) {
+ value = null;
+ }
+
+ return value;
}
/**
Added: webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/rpclitstringarray.wsdl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/rpclitstringarray.wsdl?view=auto&rev=549873
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/rpclitstringarray.wsdl (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/rpclitstringarray.wsdl Fri Jun 22 09:49:05 2007
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="EchoService" targetNamespace="http://sei.stringarray.rpclit.jaxws.axis2.apache.org" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://sei.stringarray.rpclit.jaxws.axis2.apache.org" xmlns:ns1= "http://stringarray.rpclit.test.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace= "http://stringarray.rpclit.test.org">
+ <xsd:complexType name="stringArray" final="#all">
+ <xsd:sequence>
+ <xsd:element name="item" type="xsd:string" minOccurs="0" maxOccurs="unbounded" nillable="true"></xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:schema>
+ </types>
+ <message name="echoStringArray">
+ <part name="arg0" type="ns1:stringArray">
+ </part>
+
+ </message>
+ <message name="echoStringArrayResponse">
+ <part name="return" type="ns1:stringArray">
+ </part>
+ </message>
+ <message name="echoStringResponse">
+ <part name="return" type="xsd:string">
+ </part>
+ </message>
+
+ <message name="echoString">
+ <part name="arg0" type="xsd:string">
+ </part>
+ </message>
+ <portType name="Echo">
+ <operation name="echoString" parameterOrder="arg0">
+ <input message="tns:echoString">
+ </input>
+ <output message="tns:echoStringResponse">
+
+ </output>
+ </operation>
+ <operation name="echoStringArray" parameterOrder="arg0">
+ <input message="tns:echoStringArray">
+ </input>
+ <output message="tns:echoStringArrayResponse">
+ </output>
+ </operation>
+ </portType>
+
+ <binding name="EchoPortBinding" type="tns:Echo">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoString">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal" namespace="http://stringarray.rpclit.test.org"/>
+ </input>
+ <output>
+ <soap:body use="literal" namespace="http://stringarray.rpclit.test.org"/>
+
+ </output>
+ </operation>
+ <operation name="echoStringArray">
+ <soap:operation soapAction="echoStringArray"/>
+ <input>
+ <soap:body use="literal" namespace="http://stringarray.rpclit.test.org"/>
+ </input>
+ <output>
+ <soap:body use="literal" namespace="http://stringarray.rpclit.test.org"/>
+
+ </output>
+ </operation>
+ </binding>
+ <service name="RPCLitStringArrayService">
+ <port name="EchoPort" binding="tns:EchoPortBinding">
+ <soap:address location="http://localhost:8080/axis2/services/RPCLitStringArrayService"/>
+ </port>
+ </service>
+</definitions>
+
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=549873&r1=549872&r2=549873
==============================================================================
--- 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 Fri Jun 22 09:49:05 2007
@@ -66,6 +66,7 @@
import org.apache.axis2.jaxws.proxy.RPCProxyTests;
import org.apache.axis2.jaxws.proxy.SOAP12ProxyTests;
import org.apache.axis2.jaxws.rpclit.enumtype.tests.RPCLitEnumTests;
+import org.apache.axis2.jaxws.rpclit.stringarray.tests.RPCLitStringArrayTests;
import org.apache.axis2.jaxws.sample.AddNumbersHandlerTests;
import org.apache.axis2.jaxws.sample.AddNumbersTests;
import org.apache.axis2.jaxws.sample.AddressBookTests;
@@ -199,7 +200,7 @@
suite.addTestSuite(BindingProviderTests.class);
// Commented due to test failure...
// suite.addTestSuite(StringListTests.class);
-
+ suite.addTestSuite(RPCLitStringArrayTests.class);
// ------ Endpoint Tests ------
suite.addTestSuite(BasicEndpointTests.class);
Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/EchoImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/EchoImpl.java?view=auto&rev=549873
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/EchoImpl.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/EchoImpl.java Fri Jun 22 09:49:05 2007
@@ -0,0 +1,39 @@
+/*
+ * 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.rpclit.stringarray;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@WebService
+@SOAPBinding(style=SOAPBinding.Style.RPC)
+public class EchoImpl {
+
+
+ public String[] echoStringArray(String[] arg0){
+ if(arg0 == null){
+ System.out.println("received null parameter");
+ }else{
+ System.out.println("received input parameter stringArray ="+arg0.toString());
+ }
+
+ return arg0;
+ }
+
+}
Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/META-INF/rpclitstringarray.wsdl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/META-INF/rpclitstringarray.wsdl?view=auto&rev=549873
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/META-INF/rpclitstringarray.wsdl (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/META-INF/rpclitstringarray.wsdl Fri Jun 22 09:49:05 2007
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="EchoService" targetNamespace="http://sei.stringarray.rpclit.jaxws.axis2.apache.org" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://sei.stringarray.rpclit.jaxws.axis2.apache.org" xmlns:ns1= "http://stringarray.rpclit.test.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace= "http://stringarray.rpclit.test.org">
+ <xsd:complexType name="stringArray" final="#all">
+ <xsd:sequence>
+ <xsd:element name="item" type="xsd:string" minOccurs="0" maxOccurs="unbounded" nillable="true"></xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:schema>
+ </types>
+ <message name="echoStringArray">
+ <part name="arg0" type="ns1:stringArray">
+ </part>
+
+ </message>
+ <message name="echoStringArrayResponse">
+ <part name="return" type="ns1:stringArray">
+ </part>
+ </message>
+ <message name="echoStringResponse">
+ <part name="return" type="xsd:string">
+ </part>
+ </message>
+
+ <message name="echoString">
+ <part name="arg0" type="xsd:string">
+ </part>
+ </message>
+ <portType name="Echo">
+ <operation name="echoString" parameterOrder="arg0">
+ <input message="tns:echoString">
+ </input>
+ <output message="tns:echoStringResponse">
+
+ </output>
+ </operation>
+ <operation name="echoStringArray" parameterOrder="arg0">
+ <input message="tns:echoStringArray">
+ </input>
+ <output message="tns:echoStringArrayResponse">
+ </output>
+ </operation>
+ </portType>
+
+ <binding name="EchoPortBinding" type="tns:Echo">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echoString">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal" namespace="http://stringarray.rpclit.test.org"/>
+ </input>
+ <output>
+ <soap:body use="literal" namespace="http://stringarray.rpclit.test.org"/>
+
+ </output>
+ </operation>
+ <operation name="echoStringArray">
+ <soap:operation soapAction="echoStringArray"/>
+ <input>
+ <soap:body use="literal" namespace="http://stringarray.rpclit.test.org"/>
+ </input>
+ <output>
+ <soap:body use="literal" namespace="http://stringarray.rpclit.test.org"/>
+
+ </output>
+ </operation>
+ </binding>
+ <service name="RPCLitStringArrayService">
+ <port name="EchoPort" binding="tns:EchoPortBinding">
+ <soap:address location="http://localhost:7777/axis2/services/RPCLitStringArrayService"/>
+ </port>
+ </service>
+</definitions>
+
Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/META-INF/services.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/META-INF/services.xml?view=auto&rev=549873
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/META-INF/services.xml (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/META-INF/services.xml Fri Jun 22 09:49:05 2007
@@ -0,0 +1,8 @@
+<serviceGroup>
+ <service name="RPCLitStringArrayService">
+ <messageReceivers>
+ <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" class="org.apache.axis2.jaxws.server.JAXWSMessageReceiver"/>
+ </messageReceivers>
+ <parameter locked="false" name="ServiceClass">org.apache.axis2.jaxws.rpclit.stringarray.EchoImpl</parameter>
+ </service>
+</serviceGroup>
Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/sei/Echo.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/sei/Echo.java?view=auto&rev=549873
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/sei/Echo.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/sei/Echo.java Fri Jun 22 09:49:05 2007
@@ -0,0 +1,48 @@
+
+package org.apache.axis2.jaxws.rpclit.stringarray.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.Style;
+import org.test.rpclit.stringarray.StringArray;
+
+
+/**
+ * This class was generated by the JAXWS SI.
+ * JAX-WS RI 2.0_01-b15-fcs
+ * Generated source version: 2.0
+ *
+ */
+@WebService(name = "Echo", targetNamespace = "http://sei.stringarray.rpclit.jaxws.axis2.apache.org")
+@SOAPBinding(style = Style.RPC)
+public interface Echo {
+
+
+ /**
+ *
+ * @param arg0
+ * @return
+ * returns java.lang.String
+ */
+ @WebMethod
+ @WebResult(partName = "return")
+ public String echoString(
+ @WebParam(name = "arg0", partName = "arg0")
+ String arg0);
+
+ /**
+ *
+ * @param arg0
+ * @return
+ * returns org.test.rpclit.stringarray.StringArray
+ */
+ @WebMethod
+ @WebResult(partName = "return")
+ public StringArray echoStringArray(
+ @WebParam(name = "arg0", partName = "arg0")
+ StringArray arg0);
+
+}
Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/sei/RPCLitStringArrayService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/sei/RPCLitStringArrayService.java?view=auto&rev=549873
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/sei/RPCLitStringArrayService.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/sei/RPCLitStringArrayService.java Fri Jun 22 09:49:05 2007
@@ -0,0 +1,62 @@
+
+package org.apache.axis2.jaxws.rpclit.stringarray.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 = "RPCLitStringArrayService", targetNamespace = "http://sei.stringarray.rpclit.jaxws.axis2.apache.org", wsdlLocation = "echoservice.wsdl")
+public class RPCLitStringArrayService
+ extends Service
+{
+
+ private final static URL RPCLITSTRINGARRAYSERVICE_WSDL_LOCATION;
+ private static String wsdlLocation =
+ "/test/org/apache/axis2/jaxws/rpclit/stringarray/META-INF/rpclitstringarray.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();
+ }
+ RPCLITSTRINGARRAYSERVICE_WSDL_LOCATION = url;
+ }
+
+ public RPCLitStringArrayService(URL wsdlLocation, QName serviceName) {
+ super(wsdlLocation, serviceName);
+ }
+
+ public RPCLitStringArrayService() {
+ super(RPCLITSTRINGARRAYSERVICE_WSDL_LOCATION, new QName("http://sei.stringarray.rpclit.jaxws.axis2.apache.org", "RPCLitStringArrayService"));
+ }
+
+ /**
+ *
+ * @return
+ * returns Echo
+ */
+ @WebEndpoint(name = "EchoPort")
+ public Echo getEchoPort() {
+ return (Echo)super.getPort(new QName("http://sei.stringarray.rpclit.jaxws.axis2.apache.org", "EchoPort"), Echo.class);
+ }
+
+}
Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/tests/RPCLitStringArrayTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/tests/RPCLitStringArrayTests.java?view=auto&rev=549873
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/tests/RPCLitStringArrayTests.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/rpclit/stringarray/tests/RPCLitStringArrayTests.java Fri Jun 22 09:49:05 2007
@@ -0,0 +1,47 @@
+/*
+ * 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.rpclit.stringarray.tests;
+
+import java.util.Arrays;
+
+import junit.framework.TestCase;
+
+import org.apache.axis2.jaxws.rpclit.stringarray.sei.Echo;
+import org.apache.axis2.jaxws.rpclit.stringarray.sei.RPCLitStringArrayService;
+import org.test.rpclit.stringarray.StringArray;
+
+
+public class RPCLitStringArrayTests extends TestCase {
+ public void testStringArrayType() {
+ System.out.println("------------------------------");
+ System.out.println("Test : " + getName());
+ try {
+
+ RPCLitStringArrayService service = new RPCLitStringArrayService();
+ Echo portType = service.getEchoPort();
+ String[] strArray= {"str1", "str2", "str3"};
+ StringArray array = new StringArray();
+ array.getItem().addAll(Arrays.asList(strArray));
+ portType.echoStringArray(array);
+
+ System.out.print("---------------------------------");
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail();
+ }
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org