473,395 Members | 1,885 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Custom Datatypes and how to get rid of ArrayOfAnyType.

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.
Nov 21 '05 #1
1 6543
I should add that the <ArrayOfAnyType> nonesense is associated with the HTTP
POST test. If the documentation of the test Web page is to be believed,
using
[return : XmlElement(typeof(TheRealType))]
on the web method definition gives the correct sort of soap message.

But it would be nice if this were worked in the HTTP POST test.

Thanks.
"Eric Porter" <bo********@hotmail.com> wrote in message
news:cc*******************@news.demon.co.uk...
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.

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: John Bentley | last post by:
John Bentley: INTRO The phrase "decimal number" within a programming context is ambiguous. It could refer to the decimal datatype or the related but separate concept of a generic decimal number....
3
by: Steve | last post by:
Guys, I've written a custom control (or at least tweaked someone else's!) in C# to be used on forms (rather than asp.net forms). The control is a date time picker, but its Value property returns...
3
by: xAvailx | last post by:
I apologize ahead of time for the long post... Background: Working on a CRM type custom application. The application is for an event management company. The company will provide the application...
1
by: qdm | last post by:
Below is a snippet that I'm sure is quite familiar to most ... <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" Here, I've given the XMLSchema namespace the prefix 'xsd', and with...
1
by: Josue Avila M. | last post by:
HI I Design a Class Wich contains severals DataTypes . (2 Strings and Other Data Types from a Class wich i Desing to) Its Something like This <serializable()> Public Class Emitor Public...
2
by: Mark Gibson | last post by:
Hello, I've been experimenting with dblink recently, and have encountered some limitations I'd like to discuss. I've been trying to create views of remote tables, like so: CREATE VIEW stuff...
4
by: Gibb | last post by:
Hi All.. i need help in this issue... Public Attributes & Properties for shared classes amoung webservice are accessible, but how can we call the methods. i have a webMethod that returns a custom...
8
by: a | last post by:
I'm trying to save data from a custom object into the profile object, but it is not structured the way that I want. I'm trying to get the custom object to serialize as xml to a Profile object...
2
by: Ratnakar .N | last post by:
hello, please define any custom datatypes in .net and provide one example regards ratnakar
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.