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 bu...@apache.org on 2002/09/20 21:17:02 UTC
DO NOT REPLY [Bug 12873] New: -
Axis clients don�t set xsi:type attribute when marshalling arrays of java.lang.Objects.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12873>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12873
Axis clients don�t set xsi:type attribute when marshalling arrays of java.lang.Objects.
Summary: Axis clients don�t set xsi:type attribute when
marshalling arrays of java.lang.Objects.
Product: Axis
Version: current (nightly)
Platform: PC
OS/Version: Windows NT/2K
Status: NEW
Severity: Major
Priority: Other
Component: Serialization/Deserialization
AssignedTo: axis-dev@xml.apache.org
ReportedBy: ckowal@actional.com
When an Axis client sends an array of object, the xsi:type attribute should be
set on each element, so that the server knows what type it is. The Axis client
should also look at this attribute when receiving a reply to know what type
it�s dealing with.
The problem can be reproduced with .NET using the following client and server:
(The server will get a cast failure because it doesn't know the arguments real
type).
Axis Client:
public void doIt() throws Exception
{
ArrayOfAnyType arg = new ArrayOfAnyType();
ArrayOfAnyType rtrn;
Object[] obj = new Object[10];
for (int i = 0; i < 10; i++)
{
obj[i] = new MyType();
((MyType)obj[i]).setI(i);
((MyType)obj[i]).setS("string " + i);
}
arg.setAnyType(obj);
rtrn = fport.test(arg);
for (int i = 0; i < 10; i++)
System.out.println((MyType)rtrn.getAnyType(i));
}
ASP.NET C# Server:
public struct myType
{
public int i;
public string s;
}
[WebMethod]
public object[] Test(object[] arg)
{
object[] rtrn = new object[arg.Length];
for (int i = 0; i < arg.Length; i++)
{
myType str = new myType();
// This will cause a cast failure because .NET
// doesn't know arg[i] is really of type myType
str = (myType)arg[i];
rtrn[i] = str;
}
return rtrn;
}