E
Eric Porter
I am writing a Web Service, using ASP.NET. I have two different collections
in a separate DLL, which I want to return from two different WebMethods in
the same Web Service. However, when serialized, both collections appear in
the XML message something like this :
<?xml version="1.0" encoding="utf-8" ?>
<ArrayOfAnyType xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
xmlns="http://eric.the.name.space.com">
<anyType xsi:type="TheRealType">
<OwnerId>Id</OwnerId>
<Key>Key</Key>
</anyType>
<anyType xsi:type="TheRealType">
<OwnerId>Id</OwnerId>
<Key>Key</Key>
</anyType>
</ArrayOfAnyType>
Now, how can I force the WebMethod to make the elements within the array not
be <anyType xsi:type="TheRealType">...</>, but be <TheRealType> ... </>, and
the array not to be ArrayOfAnyType, but to be ArrayOfTheRealType?
Currently, because the two methods return ArrayOfAnyType, it causes a
confusion in .NET, when it creates the temporary C# DLL, and I get an
InvalidCastException (see previous posting).
Thanks.
in a separate DLL, which I want to return from two different WebMethods in
the same Web Service. However, when serialized, both collections appear in
the XML message something like this :
<?xml version="1.0" encoding="utf-8" ?>
<ArrayOfAnyType xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
xmlns="http://eric.the.name.space.com">
<anyType xsi:type="TheRealType">
<OwnerId>Id</OwnerId>
<Key>Key</Key>
</anyType>
<anyType xsi:type="TheRealType">
<OwnerId>Id</OwnerId>
<Key>Key</Key>
</anyType>
</ArrayOfAnyType>
Now, how can I force the WebMethod to make the elements within the array not
be <anyType xsi:type="TheRealType">...</>, but be <TheRealType> ... </>, and
the array not to be ArrayOfAnyType, but to be ArrayOfTheRealType?
Currently, because the two methods return ArrayOfAnyType, it causes a
confusion in .NET, when it creates the temporary C# DLL, and I get an
InvalidCastException (see previous posting).
Thanks.