Glen,
We need to get rid of 2 things now (retItemType and retItemQName)
basically by getting rid of the returnParamDesc in OperationDesc. I
wanted to see if this fixes Jonas problems (easy to revert back change
- just sync with code in axis 1.2 branche - hehehe)
-- dims
On 4 May 2005 09:45:28 -0000, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> dims 2005/05/04 02:45:28
>
> Modified: java/src/org/apache/axis/encoding/ser ArraySerializer.java
> java/src/org/apache/axis/wsdl/toJava JavaDeployWriter.java
> java/src/org/apache/axis/description ParameterDesc.java
> java/src/org/apache/axis/message RPCParam.java
> java/src/org/apache/axis/encoding SerializationContext.java
> java/src/org/apache/axis/deployment/wsdd WSDDConstants.java
> WSDDOperation.java WSDDParameter.java
> Log:
> Fix for the breakage in test/wsdl/marshall (jonas identified problem)
>
> Revision Changes Path
> 1.68 +8 -4
> ws-axis/java/src/org/apache/axis/encoding/ser/ArraySerializer.java
>
> Index: ArraySerializer.java
> ===================================================================
> RCS file:
> /home/cvs/ws-axis/java/src/org/apache/axis/encoding/ser/ArraySerializer.java,v
> retrieving revision 1.67
> retrieving revision 1.68
> diff -u -r1.67 -r1.68
> --- ArraySerializer.java 1 May 2005 19:39:25 -0000 1.67
> +++ ArraySerializer.java 4 May 2005 09:45:27 -0000 1.68
> @@ -158,13 +158,17 @@
> componentTypeQName = context.getCurrentXMLType();
> if (componentTypeQName != null) {
> if ((componentTypeQName.equals(xmlType) ||
> - componentTypeQName.equals(Constants.XSD_ANYTYPE) ||
> - componentTypeQName.equals(soap.getArrayType()))) {
> - componentTypeQName = null;
> - }
> + componentTypeQName.equals(Constants.XSD_ANYTYPE) ||
> + componentTypeQName.equals(soap.getArrayType()))) {
> + componentTypeQName = null;
> + }
> }
> }
>
> + if (componentTypeQName == null) {
> + componentTypeQName = context.getItemType();
> + }
> +
> // Then check the type mapping for the class
> if (componentTypeQName == null) {
> componentTypeQName = context.getQNameForClass(componentClass);
>
> 1.94 +10 -1
> ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaDeployWriter.java
>
> Index: JavaDeployWriter.java
> ===================================================================
> RCS file:
> /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaDeployWriter.java,v
> retrieving revision 1.93
> retrieving revision 1.94
> diff -u -r1.93 -r1.94
> --- JavaDeployWriter.java 2 May 2005 11:39:36 -0000 1.93
> +++ JavaDeployWriter.java 4 May 2005 09:45:27 -0000 1.94
> @@ -573,12 +573,21 @@
>
> Parameter retParam = params.returnParam;
> if (retParam != null) {
> - QName returnItemQName = Utils.getItemQName(retParam.getType());
> + TypeEntry type = retParam.getType();
> + QName returnItemQName = Utils.getItemQName(type);
> if (returnItemQName != null) {
> pw.print(" returnItemQName=\"");
> pw.print(Utils.genQNameAttributeString(returnItemQName,
> "tns"));
> pw.print("\"");
> }
> + if(type.getComponentType()!=null){
> + QName returnItemType = type.getComponentType();
> + if (returnItemType != null) {
> + pw.print(" returnItemType=\"");
> + pw.print(Utils.genQNameAttributeString(returnItemType,
> "tns2"));
> + pw.print("\"");
> + }
> + }
> }
>
> if (SOAPAction != null) {
>
> 1.33 +26 -18
> ws-axis/java/src/org/apache/axis/description/ParameterDesc.java
>
> Index: ParameterDesc.java
> ===================================================================
> RCS file:
> /home/cvs/ws-axis/java/src/org/apache/axis/description/ParameterDesc.java,v
> retrieving revision 1.32
> retrieving revision 1.33
> diff -u -r1.32 -r1.33
> --- ParameterDesc.java 12 Apr 2005 22:18:15 -0000 1.32
> +++ ParameterDesc.java 4 May 2005 09:45:27 -0000 1.33
> @@ -59,22 +59,22 @@
> * determine if it gets written as a "bare" or a "wrapped" schema.
> */
> private QName itemQName;
> + private QName itemType;
>
> /** Indicates whether input/output values are stored in the header */
> private boolean inHeader = false;
> - private boolean outHeader = false;
> + private boolean outHeader = false;
>
> /** The documentation for the parameter */
> private String documentation = null;
>
> -
> public ParameterDesc() {
> }
>
> /**
> * Constructor-copy
> *
> - * @param copy the copy
> + * @param copy the copy
> */
> public ParameterDesc(ParameterDesc copy) {
> name = copy.name;
> @@ -138,9 +138,9 @@
> String text="";
> text+=indent + "name: " + name + "\n";
> text+=indent + "typeEntry: " + typeEntry + "\n";
> - text+=indent + "mode: " + (mode == IN ?
> - "IN" : mode == INOUT ?
> - "INOUT" : "OUT") + "\n";
> + text+=indent + "mode: " + (mode == IN ?
> + "IN" : mode == INOUT ?
> + "INOUT" : "OUT") + "\n";
> text+=indent + "position: " + order + "\n";
> text+=indent + "isReturn: " + isReturn + "\n";
> text+=indent + "typeQName: " + typeQName + "\n";
> @@ -149,15 +149,15 @@
> text+=indent + "outHeader: " + outHeader+ "\n";
> return text;
> } // toString
> -
> +
> /**
> * Get a mode constant from a string. Defaults to IN, and returns
> * OUT or INOUT if the string matches (ignoring case).
> - */
> + */
> public static byte modeFromString(String modeStr)
> {
> byte ret = IN;
> - if (modeStr == null) {
> + if (modeStr == null) {
> return IN;
> } else if (modeStr.equalsIgnoreCase("out")) {
> ret = OUT;
> @@ -166,7 +166,7 @@
> }
> return ret;
> }
> -
> +
> public static String getModeAsString(byte mode)
> {
> if (mode == INOUT) {
> @@ -176,7 +176,7 @@
> } else if (mode == IN) {
> return "in";
> }
> -
> +
> throw new IllegalArgumentException(
> Messages.getMessage("badParameterMode",
> Byte.toString(mode)));
> }
> @@ -210,7 +210,7 @@
> this.typeQName = typeQName;
> }
>
> - /**
> + /**
> * Get the java type (note that this is javaType in the signature.)
> * @return Class javaType
> */
> @@ -218,8 +218,8 @@
> return javaType;
> }
>
> - /**
> - * Set the java type (note that this is javaType in the signature.)
> + /**
> + * Set the java type (note that this is javaType in the signature.)
> */
> public void setJavaType(Class javaType) {
> // The javaType must match the mode. A Holder is expected for
> OUT/INOUT
> @@ -230,10 +230,10 @@
> mode != IN && !isReturn &&
>
> !javax.xml.rpc.holders.Holder.class.isAssignableFrom(javaType)) {
> throw new IllegalArgumentException(
> - Messages.getMessage("setJavaTypeErr00",
> + Messages.getMessage("setJavaTypeErr00",
> javaType.getName(),
> getModeAsString(mode)));
> - }
> + }
> }
>
> this.javaType = javaType;
> @@ -290,7 +290,7 @@
> * get the documentation for the parameter
> */
> public String getDocumentation() {
> - return documentation;
> + return documentation;
> }
>
> /**
> @@ -343,4 +343,12 @@
> public void setItemQName(QName itemQName) {
> this.itemQName = itemQName;
> }
> -} // class ParameterDesc
> +
> + public QName getItemType() {
> + return itemType;
> + }
> +
> + public void setItemType(QName itemType) {
> + this.itemType = itemType;
> + }
> +}
>
> 1.65 +3 -0 ws-axis/java/src/org/apache/axis/message/RPCParam.java
>
> Index: RPCParam.java
> ===================================================================
> RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/RPCParam.java,v
> retrieving revision 1.64
> retrieving revision 1.65
> diff -u -r1.64 -r1.65
> --- RPCParam.java 12 Apr 2005 22:18:15 -0000 1.64
> +++ RPCParam.java 4 May 2005 09:45:27 -0000 1.65
> @@ -193,6 +193,9 @@
> }
> }
> context.setItemQName(itemQName);
> +
> + QName itemType = paramDesc.getItemType();
> + context.setItemType(itemType);
> }
> context.serialize(getQName(), // element qname
> null, // no extra attrs
>
> 1.108 +11 -1
> ws-axis/java/src/org/apache/axis/encoding/SerializationContext.java
>
> Index: SerializationContext.java
> ===================================================================
> RCS file:
> /home/cvs/ws-axis/java/src/org/apache/axis/encoding/SerializationContext.java,v
> retrieving revision 1.107
> retrieving revision 1.108
> diff -u -r1.107 -r1.108
> --- SerializationContext.java 12 Apr 2005 22:18:15 -0000 1.107
> +++ SerializationContext.java 4 May 2005 09:45:27 -0000 1.108
> @@ -101,6 +101,8 @@
> private QName currentXMLType;
> /** The item QName if we're serializing a literal array... */
> private QName itemQName;
> + /** The item type if we're serializing a literal array... */
> + private QName itemType;
>
> /** The SOAP context we're using */
> private SOAPConstants soapConstants = SOAPConstants.SOAP11_CONSTANTS;
> @@ -167,7 +169,7 @@
>
> /** The encoding to serialize */
> private String encoding = XMLEncoderFactory.DEFAULT_ENCODING;
> -
> +
> class MultiRefItem {
> String id;
> QName xmlType;
> @@ -1595,4 +1597,12 @@
> public void setItemQName(QName itemQName) {
> this.itemQName = itemQName;
> }
> +
> + public QName getItemType() {
> + return itemType;
> + }
> +
> + public void setItemType(QName itemType) {
> + this.itemType = itemType;
> + }
> }
> \ No newline at end of file
>
> 1.37 +3 -1
> ws-axis/java/src/org/apache/axis/deployment/wsdd/WSDDConstants.java
>
> Index: WSDDConstants.java
> ===================================================================
> RCS file:
> /home/cvs/ws-axis/java/src/org/apache/axis/deployment/wsdd/WSDDConstants.java,v
> retrieving revision 1.36
> retrieving revision 1.37
> diff -u -r1.36 -r1.37
> --- WSDDConstants.java 18 Apr 2005 17:17:12 -0000 1.36
> +++ WSDDConstants.java 4 May 2005 09:45:28 -0000 1.37
> @@ -138,7 +138,9 @@
> public static final String ATTR_RETQNAME = "returnQName";
> public static final String ATTR_RETTYPE = "returnType";
> public static final String ATTR_RETITEMQNAME = "returnItemQName";
> - public static final String ATTR_ITEMQNAME = "itemQName";
> + public static final String ATTR_RETITEMTYPE = "returnItemType";
> + public static final String ATTR_ITEMQNAME = "itemQName";
> + public static final String ATTR_ITEMTYPE = "itemType";
> public static final String ATTR_MODE = "mode";
> public static final String ATTR_INHEADER = "inHeader";
> public static final String ATTR_OUTHEADER = "outHeader";
>
> 1.32 +12 -6
> ws-axis/java/src/org/apache/axis/deployment/wsdd/WSDDOperation.java
>
> Index: WSDDOperation.java
> ===================================================================
> RCS file:
> /home/cvs/ws-axis/java/src/org/apache/axis/deployment/wsdd/WSDDOperation.java,v
> retrieving revision 1.31
> retrieving revision 1.32
> diff -u -r1.31 -r1.32
> --- WSDDOperation.java 18 Apr 2005 17:17:12 -0000 1.31
> +++ WSDDOperation.java 4 May 2005 09:45:28 -0000 1.32
> @@ -90,11 +90,17 @@
> param.setItemQName(XMLUtils.getQNameFromString(retItemQName,
> e));
> }
>
> + String retItemType = e.getAttribute(ATTR_RETITEMTYPE);
> + if (retItemType != null && !retItemType.equals("")) {
> + ParameterDesc param = desc.getReturnParamDesc();
> + param.setItemType(XMLUtils.getQNameFromString(retItemType, e));
> + }
> +
> String soapAction = e.getAttribute(ATTR_SOAPACTION);
> if (soapAction != null) {
> desc.setSoapAction(soapAction);
> }
> -
> +
> String mepString = e.getAttribute(ATTR_MEP);
> if (mepString != null) {
> desc.setMep(mepString);
> @@ -106,7 +112,7 @@
> WSDDParameter parameter = new WSDDParameter(paramEl, desc);
> desc.addParameter(parameter.getParameter());
> }
> -
> +
> Element [] faultElems = getChildElements(e, ELEM_WSDD_FAULT);
> for (int i = 0; i < faultElems.length; i++) {
> Element faultElem = faultElems[i];
> @@ -118,7 +124,7 @@
> if (docElem != null) {
> WSDDDocumentation documentation = new
> WSDDDocumentation(docElem);
> desc.setDocumentation(documentation.getValue());
> - }
> + }
> }
>
> /**
> @@ -147,10 +153,10 @@
> if (desc.getName() != null) {
> attrs.addAttribute("", ATTR_NAME, ATTR_NAME, "CDATA",
> desc.getName());
> }
> -
> +
> if (desc.getElementQName() != null) {
> - attrs.addAttribute("", ATTR_QNAME, ATTR_QNAME,
> - "CDATA",
> + attrs.addAttribute("", ATTR_QNAME, ATTR_QNAME,
> + "CDATA",
>
> context.qName2String(desc.getElementQName()));
> }
>
> 1.20 +11 -0
> ws-axis/java/src/org/apache/axis/deployment/wsdd/WSDDParameter.java
>
> Index: WSDDParameter.java
> ===================================================================
> RCS file:
> /home/cvs/ws-axis/java/src/org/apache/axis/deployment/wsdd/WSDDParameter.java,v
> retrieving revision 1.19
> retrieving revision 1.20
> diff -u -r1.19 -r1.20
> --- WSDDParameter.java 18 Apr 2005 17:17:12 -0000 1.19
> +++ WSDDParameter.java 4 May 2005 09:45:28 -0000 1.20
> @@ -73,6 +73,11 @@
>
> parameter.setItemQName(XMLUtils.getQNameFromString(itemQNameStr, e));
> }
>
> + String itemTypeStr = e.getAttribute(ATTR_ITEMTYPE);
> + if (itemTypeStr != null && !itemTypeStr.equals("")) {
> + parameter.setItemType(XMLUtils.getQNameFromString(itemTypeStr,
> e));
> + }
> +
> Element docElem = getChildElement(e, ELEM_WSDD_DOC);
> if (docElem != null) {
> WSDDDocumentation documentation = new
> WSDDDocumentation(docElem);
> @@ -136,6 +141,12 @@
> context.qName2String(itemQName));
> }
>
> + QName itemType = parameter.getItemType();
> + if (itemType != null) {
> + attrs.addAttribute("", ATTR_ITEMTYPE, ATTR_ITEMTYPE, "CDATA",
> + context.qName2String(itemType));
> + }
> +
> context.startElement(getElementName(), attrs);
>
> if (parameter.getDocumentation() != null) {
>
>
--
Davanum Srinivas - http://webservices.apache.org/~dims/