You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by TMG <tm...@nc.rr.com> on 2004/11/21 00:11:34 UTC

RE: Help! String xs:attributes not supported

David,

I have the same problem as you described in your e-mail to the Axis user 
list, regarding schema attributes of type String (java.lang.String :) ).

Walking through the RC2 code, and comparing the code w/ 1.1, it appears 
something got dropped when the modules were refactored.  Meaning, it is 
definately a bug.  The test for a SimpleType of the attribute is using 
its element's namespace, not the attributes namespace, so it never 
matches the http://www.w3.org/2001/XMLSchema namespace (or whatever year 
(1999-2001) you are using.

I am in a similar situation, in that I can't change the wsdl to work 
around the problem ... a third party (a standards group in this case) 
manages it.

Since I know the problem, I will have a patch to submit in a day or so, 
but if there is already any solution you have found, it would be much 
appreciated.


Thanks,

Tom Gordon

Re: Help! String xs:attributes not supported

Posted by Davanum Srinivas <da...@gmail.com>.
David, Tom,

Please log a bug report with the "diff -u"....i'd make a case for a
tiny unit test to make sure that this does not break again.

thanks,
dims


On Mon, 22 Nov 2004 07:39:37 -0500, David Robison
<dr...@openroadsconsulting.com> wrote:
> The following patch to ArraySerializer fixes the problem. I hope this helps. I have not committed it to CVS since I do not have privileges. Maybe it is not to late to put it in the final 1.2 release.
> 
> David Robison
> 
> Index: ArraySerializer.java
> ===================================================================
> RCS file: /home/cvspublic/ws-axis/java/src/org/apache/axis/encoding/ser/ArraySerializer.java,v
> retrieving revision 1.61
> diff -r1.61 ArraySerializer.java
> 371c371
> <                     context.serialize(elementName, serializeAttr, aValue,
> ---
> >                     context.serialize(elementName, new AttributesImpl(serializeAttr), aValue,
> 379c379
> <                     context.serialize(elementName, serializeAttr, aValue,
> ---
> >                     context.serialize(elementName, new AttributesImpl(serializeAttr), aValue,
> 
> ***** CVS exited normally with code 1 *****
> 
> ----- Original Message -----
> From: David Robison <dr...@openroadsconsulting.com>
> To: axis-user@ws.apache.org
> Sent: Sun, 21 Nov 2004 18:18:01 -0500
> Subject: RE: Help! String xs:attributes not supported
> 
> > As near as I can tell, the problem is in the Array Serializer. When it
> > begins to serialize each element in the array, it creates a collection of
> > Attributes containing name space definitions. To this is added any
> > attributes specific for each element. However, the collection of attributes
> > is being reused. So the value of a attribute for the second element is added
> > to the collection along with that from the first element. What probably
> > needs to happen is that the attribute collection needs to be cloned for each
> > element in the array prior to adding in the attribute values for that
> > element.
> >
> > I'm sure this is clear as mud...
> >
> > David Robison
> >
> > ----- Original Message -----
> > From: TMG <tm...@nc.rr.com>
> > To: axis-user@ws.apache.org
> > Sent: Sat, 20 Nov 2004 18:11:34 -0500
> > Subject: RE: Help! String xs:attributes not supported
> >
> >
> > > David,
> > >
> > > I have the same problem as you described in your e-mail to the Axis user
> > > list, regarding schema attributes of type String (java.lang.String :) ).
> > >
> > > Walking through the RC2 code, and comparing the code w/ 1.1, it appears
> > > something got dropped when the modules were refactored.  Meaning, it is
> > > definately a bug.  The test for a SimpleType of the attribute is using
> > > its element's namespace, not the attributes namespace, so it never
> > > matches the http://www.w3.org/2001/XMLSchema namespace (or whatever year
> > > (1999-2001) you are using.
> > >
> > > I am in a similar situation, in that I can't change the wsdl to work
> > > around the problem ... a third party (a standards group in this case)
> > > manages it.
> > >
> > > Since I know the problem, I will have a patch to submit in a day or so,
> > > but if there is already any solution you have found, it would be much
> > > appreciated.
> > >
> > >
> > > Thanks,
> > >
> > > Tom Gordon
> > >
> >
> >
> 
> 


-- 
Davanum Srinivas - http://webservices.apache.org/~dims/

RE: Help! String xs:attributes not supported

Posted by David Robison <dr...@openroadsconsulting.com>.
The following patch to ArraySerializer fixes the problem. I hope this helps. I have not committed it to CVS since I do not have privileges. Maybe it is not to late to put it in the final 1.2 release.

David Robison


Index: ArraySerializer.java
===================================================================
RCS file: /home/cvspublic/ws-axis/java/src/org/apache/axis/encoding/ser/ArraySerializer.java,v
retrieving revision 1.61
diff -r1.61 ArraySerializer.java
371c371
<                     context.serialize(elementName, serializeAttr, aValue,
---
>                     context.serialize(elementName, new AttributesImpl(serializeAttr), aValue,
379c379
<                     context.serialize(elementName, serializeAttr, aValue,
---
>                     context.serialize(elementName, new AttributesImpl(serializeAttr), aValue,

***** CVS exited normally with code 1 *****



----- Original Message -----
From: David Robison <dr...@openroadsconsulting.com>
To: axis-user@ws.apache.org
Sent: Sun, 21 Nov 2004 18:18:01 -0500
Subject: RE: Help! String xs:attributes not supported


> As near as I can tell, the problem is in the Array Serializer. When it
> begins to serialize each element in the array, it creates a collection of
> Attributes containing name space definitions. To this is added any
> attributes specific for each element. However, the collection of attributes
> is being reused. So the value of a attribute for the second element is added
> to the collection along with that from the first element. What probably
> needs to happen is that the attribute collection needs to be cloned for each
> element in the array prior to adding in the attribute values for that
> element.
> 
> I'm sure this is clear as mud...
> 
> David Robison
> 
> ----- Original Message -----
> From: TMG <tm...@nc.rr.com>
> To: axis-user@ws.apache.org
> Sent: Sat, 20 Nov 2004 18:11:34 -0500
> Subject: RE: Help! String xs:attributes not supported
> 
> 
> > David,
> > 
> > I have the same problem as you described in your e-mail to the Axis user 
> > list, regarding schema attributes of type String (java.lang.String :) ).
> > 
> > Walking through the RC2 code, and comparing the code w/ 1.1, it appears 
> > something got dropped when the modules were refactored.  Meaning, it is 
> > definately a bug.  The test for a SimpleType of the attribute is using 
> > its element's namespace, not the attributes namespace, so it never 
> > matches the http://www.w3.org/2001/XMLSchema namespace (or whatever year 
> > (1999-2001) you are using.
> > 
> > I am in a similar situation, in that I can't change the wsdl to work 
> > around the problem ... a third party (a standards group in this case) 
> > manages it.
> > 
> > Since I know the problem, I will have a patch to submit in a day or so, 
> > but if there is already any solution you have found, it would be much 
> > appreciated.
> > 
> > 
> > Thanks,
> > 
> > Tom Gordon
> > 
> 
> 


RE: Help! String xs:attributes not supported

Posted by David Robison <dr...@openroadsconsulting.com>.
As near as I can tell, the problem is in the Array Serializer. When it begins to serialize each element in the array, it creates a collection of Attributes containing name space definitions. To this is added any attributes specific for each element. However, the collection of attributes is being reused. So the value of a attribute for the second element is added to the collection along with that from the first element. What probably needs to happen is that the attribute collection needs to be cloned for each element in the array prior to adding in the attribute values for that element.

I'm sure this is clear as mud...

David Robison

----- Original Message -----
From: TMG <tm...@nc.rr.com>
To: axis-user@ws.apache.org
Sent: Sat, 20 Nov 2004 18:11:34 -0500
Subject: RE: Help! String xs:attributes not supported


> David,
> 
> I have the same problem as you described in your e-mail to the Axis user 
> list, regarding schema attributes of type String (java.lang.String :) ).
> 
> Walking through the RC2 code, and comparing the code w/ 1.1, it appears 
> something got dropped when the modules were refactored.  Meaning, it is 
> definately a bug.  The test for a SimpleType of the attribute is using 
> its element's namespace, not the attributes namespace, so it never 
> matches the http://www.w3.org/2001/XMLSchema namespace (or whatever year 
> (1999-2001) you are using.
> 
> I am in a similar situation, in that I can't change the wsdl to work 
> around the problem ... a third party (a standards group in this case) 
> manages it.
> 
> Since I know the problem, I will have a patch to submit in a day or so, 
> but if there is already any solution you have found, it would be much 
> appreciated.
> 
> 
> Thanks,
> 
> Tom Gordon
>